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

# Delete Message

> Deletes a specific message from a chat

## Path Parameters

<ParamField path="chatId" type="string" required>
  Chat ID containing the message
</ParamField>

<ParamField path="messageId" type="string" required>
  Message ID to delete
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indicates if the message was deleted successfully
</ResponseField>

<ResponseField name="message" type="string">
  Success or error message
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request DELETE \
    --url https://api.yourdomain.com/api/chats/chat_123abc/messages/msg_456def \
    --header 'Authorization: Bearer <token>'
  ```

  ```javascript JavaScript theme={null}
  const chatId = 'chat_123abc';
  const messageId = 'msg_456def';

  const response = await fetch(
    `https://api.yourdomain.com/api/chats/${chatId}/messages/${messageId}`,
    {
      method: 'DELETE',
      headers: {
        'Authorization': 'Bearer <token>'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  chat_id = "chat_123abc"
  message_id = "msg_456def"

  url = f"https://api.yourdomain.com/api/chats/{chat_id}/messages/{message_id}"
  headers = {"Authorization": "Bearer <token>"}

  response = requests.delete(url, headers=headers)
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "success": true,
    "message": "Message deleted successfully"
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "success": false,
    "message": "Unauthorized"
  }
  ```

  ```json 404 - Not Found theme={null}
  {
    "success": false,
    "message": "Message not found"
  }
  ```
</ResponseExample>

## Notes

<Warning>
  Deleting a message is **irreversible** and will also remove any associated votes.
</Warning>
