Delete conversation
DELETE/v2/agents/{agentId}/conversations/{conversationId}
Permanently delete one conversation of an agent, with all of its messages and feedback, by its conversation ID.
Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.
Permanently deletes one conversation with all of its messages and feedback. Call it to remove a test chat, or a single conversation that a person asked you to erase. The deletion cannot be undone.
Request
DELETE /v2/agents/{agentId}/conversations/{conversationId}
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
agentId |
string | Yes | The ID of the agent, starting with agt_. |
conversationId |
string | Yes | The ID of the conversation, starting with conv_. |
The call has no query parameters and no body. Tickets that were created from the conversation in the Helpdesk are not deleted, because they are records of your team.
To remove everything one person said, use Delete all conversations for a user instead of deleting conversations one by one. To keep a copy first, use Export conversations.
Example request
curl -X DELETE https://api.askocto.co/v2/agents/agt_8f3k2m/conversations/conv_5n2p8w \
-H "Authorization: Bearer $OCTO_API_KEY"
const response = await fetch(
"https://api.askocto.co/v2/agents/agt_8f3k2m/conversations/conv_5n2p8w",
{
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.OCTO_API_KEY}` },
},
)
const result = await response.json()
console.log(result.id, result.deleted)
Example response
A successful call returns 200 OK.
{
"id": "conv_5n2p8w",
"deleted": true
}
Response fields
| Name | Type | Description |
|---|---|---|
id |
string | The ID of the conversation that was deleted. |
deleted |
boolean | Always true on success. |
After the deletion, Get a conversation with the same ID returns 404.
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized |
The API key is missing, malformed or deleted. |
| 403 | forbidden |
The key is valid but is not allowed to delete this data. |
| 404 | not_found |
The agent or the conversation does not exist, or it was already deleted. |
| 429 | rate_limited |
Too many requests. Wait for the number of seconds in the Retry-After header. |