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
| Field | Type | Required | Description |
|---|---|---|---|
type | String | Yes | "message:delete" |
id | String | Yes | Unique event ID. |
time | Long | Yes | Event generation time (Unix ms). |
data | Array | Yes | Array containing one deletion event object. See Data fields. |
Data fields
| Field | Type | Required | Description |
|---|---|---|---|
operationType | Number | Yes | Operation type. 1 = recalled — the message is deleted for all recipients. 2 = deleted — the message is removed only for the user who performed the action. |
userId | String | Yes | The user ID of the person who performed the operation. |
optTime | Long | Yes | Time the operation was performed (Unix ms). |
os | String | Yes | Platform where the action originated. |
channelInfo | Object | Yes | Information about the channel containing the message. See channelInfo fields. |
originalMsgInfo | Object | Yes | Information about the original message. See originalMsgInfo fields. |
deleteInfo | Object | No | Recall details. Present only when operationType is 1. See deleteInfo fields. |
removeInfo | Object | No | Deletion details. Present only when operationType is 2. See removeInfo fields. |
channelInfo fields
| Field | Type | Required | Description |
|---|---|---|---|
channelType | Number | Yes | Channel type. See Channel types. |
channelId | String | Yes | The channel ID. |
busChannelId | String | No | Subchannel ID. Only present in community channels. |
originalMsgInfo fields
| Field | Type | Required | Description |
|---|---|---|---|
messageId | String | Yes | The unique ID of the message that was recalled or deleted. |
messageTime | Long | Yes | The original send time of the recalled or deleted message (Unix ms). |
deleteInfo fields
Present only when operationType is 1 (recall).
| Field | Type | Required | Description |
|---|---|---|---|
removeLocally | Number | No | Whether recipients should also delete the message locally. 0 = no. 1 = yes. |
isAdminAction | Number | No | Whether the recall was performed by an administrator. 0 = no. 1 = yes. |
extra | String | No | Extended data attached to the recall operation. |
removeInfo fields
Present only when operationType is 2 (delete).
| Field | Type | Required | Description |
|---|---|---|---|
removeType | Number | Yes | Deletion scope. 1 = delete specific message. 2 = delete all messages up to a timestamp. |
time | Long | No | Cutoff 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
}
}
]
}