> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trellis.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Multiple Chats

> Delete multiple chats and all their messages in a single request

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.

<ParamField header="Authorization" type="string" required>
  Bearer token obtained from the authenticate endpoint.
</ParamField>

<ParamField body="chat_ids" type="string[]" required>
  List of chat IDs to delete. Must not be empty.
</ParamField>

## Response

<ResponseField name="deleted" type="string[]" required>
  List of chat IDs that were successfully deleted.
</ResponseField>

<ResponseField name="not_found" type="string[]" required>
  List of chat IDs that were not found (invalid UUIDs or belonging to another user).
</ResponseField>

<ResponseField name="deleted_count" type="integer" required>
  Number of chats that were successfully deleted.
</ResponseField>

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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"]}'
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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")
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "deleted": ["chat_abc123", "chat_def456"],
    "not_found": ["chat_invalid"],
    "deleted_count": 2
  }
  ```

  ```json 422 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "detail": "chat_ids must not be empty"
  }
  ```
</ResponseExample>
