Skip to main content

Message deleted

The message:delete event fires when a message is recalled (soft-deleted, allowing recipients to be notified) or permanently deleted. The operationType field in the event payload distinguishes between the two operations.

For the complete webhook setup and signature verification guide, see Webhooks overview.

Event type

message:delete

Payload

Envelope

FieldTypeRequiredDescription
typeStringYes"message:delete"
idStringYesUnique event ID.
timeLongYesEvent generation time (Unix ms).
dataArrayYesArray containing one deletion event object. See Data fields.

Data fields

FieldTypeRequiredDescription
operationTypeNumberYesOperation type. 1 = recalled — the message is deleted for all recipients. 2 = deleted — the message is removed only for the user who performed the action.
userIdStringYesThe user ID of the person who performed the operation.
optTimeLongYesTime the operation was performed (Unix ms).
osStringYesPlatform where the action originated.
channelInfoObjectYesInformation about the channel containing the message. See channelInfo fields.
originalMsgInfoObjectYesInformation about the original message. See originalMsgInfo fields.
deleteInfoObjectNoRecall details. Present only when operationType is 1. See deleteInfo fields.
removeInfoObjectNoDeletion details. Present only when operationType is 2. See removeInfo fields.

channelInfo fields

FieldTypeRequiredDescription
channelTypeNumberYesChannel type. See Channel types.
channelIdStringYesThe channel ID.
busChannelIdStringNoSubchannel ID. Only present in community channels.

originalMsgInfo fields

FieldTypeRequiredDescription
messageIdStringYesThe unique ID of the message that was recalled or deleted.
messageTimeLongYesThe original send time of the recalled or deleted message (Unix ms).

deleteInfo fields

Present only when operationType is 1 (recall).

FieldTypeRequiredDescription
removeLocallyNumberNoWhether recipients should also delete the message locally. 0 = no. 1 = yes.
isAdminActionNumberNoWhether the recall was performed by an administrator. 0 = no. 1 = yes.
extraStringNoExtended data attached to the recall operation.

removeInfo fields

Present only when operationType is 2 (delete).

FieldTypeRequiredDescription
removeTypeNumberYesDeletion scope. 1 = delete specific message. 2 = delete all messages up to a timestamp.
timeLongNoCutoff timestamp (Unix ms). Present only when removeType is 2.

Examples

Recall (operationType: 1)

JSON
{
"type": "message:delete",
"id": "550e8400-e29b-41d4-a716-446655440005",
"time": 1730192400000,
"data": [
{
"operationType": 1,
"userId": "user_001",
"optTime": 1730192400000,
"os": "Android",
"channelInfo": {
"channelType": 3,
"channelId": "group_001"
},
"originalMsgInfo": {
"messageId": "msg_abc123",
"messageTime": 1730192300000
},
"deleteInfo": {
"removeLocally": 1,
"isAdminAction": 0
}
}
]
}

Delete (operationType: 2)

JSON
{
"type": "message:delete",
"id": "550e8400-e29b-41d4-a716-446655440006",
"time": 1730192400000,
"data": [
{
"operationType": 2,
"userId": "user_001",
"optTime": 1730192400000,
"os": "Server",
"channelInfo": {
"channelType": 3,
"channelId": "group_001"
},
"originalMsgInfo": {
"messageId": "msg_abc123",
"messageTime": 1730192300000
},
"removeInfo": {
"removeType": 1,
"time": 1730192400000
}
}
]
}