resources/conversations/subresources/items/methods/delete/index.md +0 −71 deleted
File Deleted View Diff
1## Delete an item
2
3**delete** `/conversations/{conversation_id}/items/{item_id}`
4
5Delete an item from a conversation with the given IDs.
6
7### Path Parameters
8
9- `conversation_id: string`
10
11- `item_id: string`
12
13### Returns
14
15- `Conversation object { id, created_at, metadata, object }`
16
17 - `id: string`
18
19 The unique ID of the conversation.
20
21 - `created_at: number`
22
23 The time at which the conversation was created, measured in seconds since the Unix epoch.
24
25 - `metadata: unknown`
26
27 Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
28 Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
29
30 - `object: "conversation"`
31
32 The object type, which is always `conversation`.
33
34 - `"conversation"`
35
36### Example
37
38```http
39curl https://api.openai.com/v1/conversations/$CONVERSATION_ID/items/$ITEM_ID \
40 -X DELETE \
41 -H "Authorization: Bearer $OPENAI_API_KEY"
42```
43
44#### Response
45
46```json
47{
48 "id": "id",
49 "created_at": 0,
50 "metadata": {},
51 "object": "conversation"
52}
53```
54
55### Example
56
57```http
58curl -X DELETE https://api.openai.com/v1/conversations/conv_123/items/msg_abc \
59 -H "Authorization: Bearer $OPENAI_API_KEY"
60```
61
62#### Response
63
64```json
65{
66 "id": "conv_123",
67 "object": "conversation",
68 "created_at": 1741900000,
69 "metadata": {"topic": "demo"}
70}
71```