BookbagBookbag

Delete a contact (v1)

DELETE /api/v1/chatbots/:chatbotId/contacts/:contactId — permanently delete a contact by external id. Returns the deleted record.

View as Markdown

DELETE /api/v1/chatbots/:chatbotId/contacts/:contactId

Permanently delete a contact, addressed by its external_id. The deleted record is echoed back in data so you can confirm what was removed.

Irreversible

Deleting a contact removes it and its custom-attribute values for the agent. There is no undo.

ParamInTypeNotes
chatbotIdpathintegerThe agent id.
contactIdpathstringThe contact's external_id.
curl -X DELETE https://app.bookbag.ai/api/v1/chatbots/123/contacts/user_8821 \
  -H "Authorization: Bearer $BOOKBAG_API_KEY"
const res = await fetch(
  "https://app.bookbag.ai/api/v1/chatbots/123/contacts/user_8821",
  {
    method: "DELETE",
    headers: { Authorization: `Bearer ${process.env.BOOKBAG_API_KEY}` },
  }
);
const { data } = await res.json();
{
  "message": "Success",
  "data": {
    "id": "contact_57",
    "external_id": "user_8821",
    "name": "Sam R.",
    "email": "sam@acme.com",
    "phonenumber": null,
    "stripe_accounts": [],
    "custom_attributes": { "plan": "enterprise" },
    "created_at": 1717286400,
    "updated_at": 1717290000
  }
}

Status codes

StatusMeaning
200Deleted; the removed record is returned.
401Missing or invalid key.
404Unknown chatbot/contact. Body: { message: "Resource not found" }.

See Errors.