Delete a contact

DELETE/v1/chatbots/{chatbotId}/contacts/{contactId}

Delete a single contact of a chatbot with the legacy v1 API, for example after a customer asks you to remove their profile.

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

Deletes one contact of a chatbot. Call it when a customer asks you to remove their profile, or when you clean up imported test data.

Request

DELETE /v1/chatbots/{chatbotId}/contacts/{contactId}

Path parameters:

Name Type Required Description
chatbotId string Yes The ID of the chatbot, starting with agt_.
contactId string Yes The ID of the contact, starting with con_.

The request has no body. Deleting a contact removes the profile and its custom attribute values. It does not delete the conversations the person had with the agent.

The call is final. If the same person chats again later, the agent starts without the stored attributes, so keep your own copy of anything you need.

Note: Whether a deletion request meets a legal duty is a question for your own advisers. This page is not legal advice.

Example request

curl -X DELETE https://api.askocto.co/v1/chatbots/agt_8f3k2m/contacts/con_4d7h2q \
  -H "Authorization: Bearer $OCTO_API_KEY"
const response = await fetch(
  "https://api.askocto.co/v1/chatbots/agt_8f3k2m/contacts/con_4d7h2q",
  {
    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": "con_4d7h2q",
  "deleted": true
}

Response fields

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

To remove the conversations of a person as well, see User conversations.

Errors

Status Code When
401 unauthorized The API key is missing, malformed or revoked.
404 not_found The chatbot or the contact does not exist.
429 rate_limited Too many requests. Wait for the number of seconds in the Retry-After header.

The v1 overview lists the conventions shared by all v1 endpoints.

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