Skip to main content
Permanently delete multiple chat conversations and all associated messages. This action cannot be undone. Partial success is allowed — chats that exist are deleted even if some IDs are not found. The endpoint always returns 200 with a breakdown of which IDs were deleted and which were not found.
Authorization
string
required
Bearer token obtained from the authenticate endpoint.
chat_ids
string[]
required
List of chat IDs to delete. Must not be empty.

Response

deleted
string[]
required
List of chat IDs that were successfully deleted.
not_found
string[]
required
List of chat IDs that were not found (invalid UUIDs or belonging to another user).
deleted_count
integer
required
Number of chats that were successfully deleted.
curl -X DELETE https://api.trellis.sh/v1/chats \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"chat_ids": ["chat_abc123", "chat_def456", "chat_invalid"]}'
import requests

response = requests.delete(
    "https://api.trellis.sh/v1/chats",
    headers={"Authorization": "Bearer YOUR_TOKEN"},
    json={"chat_ids": ["chat_abc123", "chat_def456", "chat_invalid"]}
)
result = response.json()
print(f"Deleted {result['deleted_count']} chats")
const response = await fetch("https://api.trellis.sh/v1/chats", {
  method: "DELETE",
  headers: {
    Authorization: "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    chat_ids: ["chat_abc123", "chat_def456", "chat_invalid"],
  }),
});
const { deleted, not_found, deleted_count } = await response.json();
{
  "deleted": ["chat_abc123", "chat_def456"],
  "not_found": ["chat_invalid"],
  "deleted_count": 2
}
{
  "detail": "chat_ids must not be empty"
}