# Delete a message

```http
DELETE https://trydimmi.com/api/v1/conversations/{conversation}/messages/{message}
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `conversations:write`.

## Path parameters

- `conversation` (string, required): Id of the conversation, such as conv_01jx2m8k4t, or its number, such as 1042 for #1042. Find it with GET /conversations or GET /search.
- `message` (string, required): Id of the message, starting with msg_, such as msg_01jx2m8k4t. Find it with GET /conversations/{conversation}/messages.

## Response 200 (OK)

- `data` (object, required)
  - `body` (string, required): The text of an undone reply, so it can be put back in the composer. Empty when the message was deleted rather than undone.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `undone` (boolean, required): True when the message was a reply still waiting to leave and was undone; false when a message was deleted.
- `meta` (object, required)
  - `next_cursor` (string | null, required): Cursor of the next page; send it back as the cursor to read on. Null on the last page.
  - `per_page` (integer, required): Page size: the most rows one page of this list holds.
  - `prev_cursor` (string | null, required): Cursor of the previous page. Null on the first page.
  - `total` (integer): How many rows match in all, across every page. Left out when the endpoint did not count.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request DELETE \
  --url 'https://trydimmi.com/api/v1/conversations/{conversation}/messages/{message}' \
  --header 'Authorization: Bearer <token>'
```

## Example response

```json
{
  "data": {
    "body": "<string>",
    "object": "<string>",
    "undone": true
  },
  "meta": {
    "next_cursor": "<string>",
    "per_page": 123,
    "prev_cursor": "<string>",
    "total": 123
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
