# Delete a message

`POST /chat.delete`

## Description

Delete a previously posted bot message. The bot must own the message being deleted (matched by address ID). Personal access tokens are not supported for this endpoint.

Deleting an already-deleted message is idempotent and returns success.

**Access:** Organization only.

**Required scope:** `chat:send_message` or `chat:write`

---

**OpenAPI Spec:** [chat.json](https://developer.ro.am/chat.json)

## Authentication

```
Authorization: Bearer YOUR_API_KEY
```

## Request Body

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `chat` | string | Yes | Tagged ID of the chat containing the message. |
| `timestamp` | integer | Yes | Timestamp of the message to delete. |
| `threadTimestamp` | integer | No | Thread timestamp, if the message is in a thread. |

## Responses

### 200 - Message deleted successfully

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `chat` | TaggedUUID | No | Tagged ID of the chat. |
| `timestamp` | integer | No | Timestamp of the deleted message. |
| `threadTimestamp` | integer | No | Thread timestamp, if the message was in a thread. |

**TaggedUUID**:

A UUID prefixed by a tag identifying the specific type of object

#### Example Response

```json
{
  "chat": "D-757dfe66-37b4-4772-baa5-8c86ec68c176",
  "timestamp": 1765602474760032
}
```

### 400 - Bad request. Common causes:
- Invalid chat ID
- Invalid or missing `timestamp`
- Personal access token used (not supported)
- Bot does not own the message


### 401 - Presented invalid authentication credentials.

### 403 - Forbidden. The bot lacks access to the target chat.


### 405 - An unsupported method was requested.

### 500 - An internal error occured.

---

*Machine-readable API documentation.*
*Full documentation: https://developer.ro.am/docs/chat-api/chat-delete*
