Delete a chatbot

DELETE/v1/chatbots/{chatbotId}

Permanently delete a chatbot and its data from your workspace with the legacy v1 API.

Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.

Permanently deletes a chatbot. Call it when you retire a chatbot, or clean up test chatbots created by a script.

Warning: Deleting a chatbot also removes its sources, procedures, contacts and conversations. This cannot be undone. Export anything you need first.

Request

DELETE /v1/chatbots/{chatbotId}

Path parameters:

Name Type Required Description
chatbotId string Yes The ID of the chatbot to delete, starting with agt_.

The request has no body. In v2 the same job is Delete agent.

If you only want to stop a chatbot from answering for a while, do not delete it. Set its visibility to private with Update chatbot settings instead, and keep its sources and history.

Example request

curl -X DELETE https://api.askocto.co/v1/chatbots/agt_8f3k2m \
  -H "Authorization: Bearer $OCTO_API_KEY"
const response = await fetch("https://api.askocto.co/v1/chatbots/agt_8f3k2m", {
  method: "DELETE",
  headers: { Authorization: `Bearer ${process.env.OCTO_API_KEY}` },
})

if (!response.ok) {
  throw new Error(`Request failed with status ${response.status}`)
}

console.log(await response.json())

Example response

A successful call returns 200 OK.

{
  "id": "agt_8f3k2m",
  "deleted": true
}

Response fields

Name Type Description
id string The ID of the chatbot that was deleted.
deleted boolean true once the chatbot is gone.

After the call, any request that uses this chatbotId returns 404. Widgets that embed the chatbot stop answering, so remove the embed script from your site first.

Errors

Status Code When
401 unauthorized The API key is missing, malformed or revoked.
404 not_found No chatbot with this ID exists in your workspace. It may already be deleted.
429 rate_limited Too many requests. Wait for the number of seconds in the Retry-After header.

See the v1 overview for the shared conventions.

Something unclear or missing? Tell us and we will fix the page.