Skip to main content
Delete Message
Deletes a message. The behavior differs based on who is deleting:
  • Author self-delete: userDeletedAt is set, and the message’s content, GIF, mentions and metadata are cleared. File attachments are deleted from storage. The message stays in the conversation as a placeholder that still shows its sender.
  • Group admin moderation delete: The message is marked moderationStatus: "removed". Nothing is cleared: its author still sees it in full, and everyone else gets a placeholder with the sender hidden too.
See Deleted and removed messages for exactly what a placeholder carries. A message that’s already deleted can’t be deleted or removed again, and a removed one can’t be removed again: both answer 404 chat/message-not-found, as for a missing message. A removed message’s author can still delete it, which clears its content as above. The caller must be either the message author or an active group admin. An admin who left or was removed can still delete their own messages, but not other members’. In a direct conversation where one of the two users has blocked the other, deleting answers 403 chat/conversation-read-only. The conversation stays readable.

Path Parameters

string
required
The ID of the conversation.
string
required
The ID of the message to delete.

Query Parameters

string
Service key only, and required with one: the user this request acts as. Must be the message author or an active group admin. A user token always acts as its own user and must not send it (400 chat/acting-user-not-allowed).

Response

204 No Content on success, with no body, for an author self-delete and for an admin moderation delete alike. An author self-delete also closes the message’s open report, if any (status: "auto-closed", kept as history), and the deleted message can’t be reported again.

Error Responses

A user token sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
Returned when a service key names an actingUserId that isn’t a user in this project.
The request sent userId. On this route the user a service key acts as is actingUserId.With a service key:
With a user token, or with no credentials:
A service key sent no actingUserId.
A direct conversation between two users where one has blocked the other. It stays readable, but takes no deletes. The response doesn’t say why.
No message has this ID in the conversation, or it was already deleted, or it was already removed and the caller isn’t its author.