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.
deleteForAllObjectNoRecall details. Present only when operationType is 1. See deleteForAll fields.
deleteForMeObjectNoDeletion details. Present only when operationType is 2. See deleteForMe fields.

channelInfo fields

FieldTypeRequiredDescription
channelTypeNumberYesChannel type. See Channel types.
channelIdStringYesThe channel ID.
subchannelIdStringNoSubchannel 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).

deleteForAll fields

Present only when operationType is 1 (recall).

FieldTypeRequiredDescription
isAdminNumberNoWhether the recall was performed by an administrator. 0 = no. 1 = yes.
extraStringNoExtended data attached to the recall operation.

deleteForMe fields

Present only when operationType is 2 (delete).

FieldTypeRequiredDescription
deleteTypeNumberYesDeletion scope. 1 = delete specific message. 2 = delete all messages up to a timestamp.
timeLongNoCutoff timestamp (Unix ms). Present only when deleteType 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
},
"deleteForAll": {
"isAdmin": 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
},
"deleteForMe": {
"deleteType": 1
}
}
]
}