Skip to content

Delete messages

A user can delete messages they sent in a DM or group chat. In a group chat, the super admin role can delete any message in the group.

When a user deletes a message, a DeleteMessage content type containing the target message ID is sent to the conversation. Clients receiving this message validate the deletion request and filter the deleted message from queries.

When you query messages, the client automatically:

  • Replaces deleted messages with a placeholder that indicates whether the sender or an admin deleted it
  • Filters out the DeleteMessage content type from message lists

The deletion mechanism does NOT remove the original message from:

  • Local databases
  • The backend
  • Backup systems
Cannot be deletedReason
Membership changes and group updatesThey are the group transcript
Leave requestsThey are the group transcript
ReactionsThey are deleted with their target
Read receiptsThey have no content to remove
Actions and intentsThey are not user-authored content
A deletionRemoving it would hide the original with no record
An unknown content typeThe SDK does not silently drop unknown data
PlatformMethod
Swiftconversation.deleteMessage(messageId:)
Kotlinconversation.deleteMessage(messageId)
Browser, NodeNot available. These SDKs can receive and render deletions.

The call throws when the message is absent, the caller is not the sender or a super admin, the message is already deleted, or its type cannot be deleted.

PlatformMethodYields
Browser, Nodeclient.conversations.streamDeletedMessages()Deleted message
Kotlin, Swiftclient.conversations.streamMessageDeletions()Deleted message

The deprecated Browser and Node streamMessageDeletions() method yields only the message ID.