> ## 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 Chat

> Delete a chat and all its messages

Permanently delete a chat conversation and all associated messages. This action cannot be undone.

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

<ParamField path="chat_id" type="string" required>
  Unique identifier of the chat to delete.
</ParamField>

## Response

<ResponseField name="message" type="string" required>
  Confirmation message.
</ResponseField>

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X DELETE https://api.trellis.sh/v1/chats/chat_abc123 \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import requests

  response = requests.delete(
      "https://api.trellis.sh/v1/chats/chat_abc123",
      headers={"Authorization": "Bearer YOUR_TOKEN"}
  )
  result = response.json()
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const response = await fetch("https://api.trellis.sh/v1/chats/chat_abc123", {
    method: "DELETE",
    headers: { Authorization: "Bearer YOUR_TOKEN" },
  });
  const result = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "message": "Chat deleted successfully"
  }
  ```

  ```json 404 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "detail": "Chat not found"
  }
  ```
</ResponseExample>
