در حال بارگذاری…
Deletes a specific message from a chat.
| Permission | Description |
|---|---|
chat_messages.delete | Delete your own messages |
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| chat-id | int | Yes | ID of the chat | 123 |
| message-id | int | Yes | ID of the message to delete | 456 |
DELETE /api/v1/chats/123/messages/456
Authorization: Bearer {token}
Despite the 204, this endpoint does return a JSON body — a localized confirmation message.
HTTP defines 204 as bodyless, so some clients and proxies discard it; treat the body as informational,
not something to depend on.
{
"message": "Message deleted successfully."
}
Localized from messages.chats.messages.deleted_successfully (fa: “پیام با موفقیت حذف شد.”).
| Status | Description | Reference |
|---|---|---|
| 401 | Unauthorized | Authentication error |
| 403 | Forbidden (no permission) | Permission error |
| 404 | Not found | Not-found error |
{message} must belong to {chat}. A message id from another chat returns 404, not 403 — a 403 would
confirm to the caller that the message exists.