Callback Events
Bot message and group events are pushed to your server via the configured callback URL.
Callback URL
Callback events are sent to the callback_url configured in the Bot settings.
| Item | Description |
|---|---|
| Method | POST |
| Content-Type | application/json |
Message Events
Event Types
| Event Type | Description |
|---|---|
message.add | New message |
message.update | Message edited |
message.delete | Message recalled/deleted |
Callback Fields
| Field | Type | Description |
|---|---|---|
event_type | string | Event type |
message_type | int | Event action type |
chat_type | int | Conversation type (one-on-one/group) |
chat_id | string | Conversation ID |
thread_id | string/uint64 | Thread ID |
id | string | Message ID |
sender_id | string | Sender ID |
message_type_id | int | Message type ID |
content | string | Normalized message content JSON |
Group Events
Event Types
| Event Type | Description |
|---|---|
group.member.add | New member joined the group |
group.member.remove | Member left or was removed from the group |
group.update | Group info updated |
Callback Fields
| Field | Type | Description |
|---|---|---|
event_type | string | Event type |
chat_type | int | Conversation type |
chat_id | string | Conversation ID |
content | object | Original group event content |
Callback Delivery Restrictions
Callbacks may not be delivered under the following conditions:
- Bot does not have
callback_urlconfigured - Bot has been banned
- Group-level permission
chat_bot_permissiondoes not allow the current event - Command/message does not match the required permission bits
Command Match Example
{
"chat_id": "7602566729281049630",
"sender_id": "7569434771739130881",
"command": "/start",
"content": "<p><at userid=\"7569434771739130881\">test bot</at> test webhook</p>"
}