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

# Delete a conversation and its messages

> Remove a conversation and every message in it. Deletion is irreversible, and only owner and admin hold it. To move one aside without losing it, archive instead.

Deletion is irreversible. It requires a role that can delete conversations, which only `owner` and `admin` hold; any other role gets `403`. To take a conversation out of the way without losing it, [archive it](/api-reference/conversations/update-conversation) instead.

An `owner` or `admin` caller can delete any conversation in the organization. A conversation that does not exist, belongs to another organization, or has a malformed ID returns `404`.

This request also resolves the conversation's assistant. If that assistant can no longer answer (it is `disabled` or `archived`, or has no knowledge attached), this request returns `400` `validation_error`.

<ParamField path="conversation_id" type="string" required>
  The conversation ID.
</ParamField>

## Response

Returns `204 No Content` with an empty body.

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl --request DELETE "$MITHUNAI_URL/arukz/api/v1/conversations/c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60" \
    --header "Authorization: Bearer $MITHUNAI_API_KEY"
  ```

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

  conversation_id = "c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60"
  response = requests.delete(
      f"{os.environ['MITHUNAI_URL']}/arukz/api/v1/conversations/{conversation_id}",
      headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
      timeout=60,
  )
  response.raise_for_status()
  print(response.status_code)
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const conversationId = 'c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60'
  const response = await fetch(
    `${process.env.MITHUNAI_URL}/arukz/api/v1/conversations/${conversationId}`,
    {
      method: 'DELETE',
      headers: { Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}` },
    },
  )
  console.log(response.status)
  ```
</RequestExample>

<ResponseExample>
  ```text 204 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  (empty body)
  ```

  ```json 403 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  { "code": "authorization_error", "message": "You do not have permission to perform this action." }
  ```

  ```json 404 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  { "code": "not_found", "message": "The requested resource was not found." }
  ```
</ResponseExample>
