Webhook Events
If you have setup webhook when adding your device you will be receiving events on your webhook.
connected
Emitted when wapi is connected
to whatsapp server and is authenticated
{
"event":"connected",
"data":null
}
disconnected
Emitted when websocket connection is closed by whatsapp server
{
"event":"disconnected",
"data":null
}
receipt
receipt:sent
Emitted by other devices(except from WAPI devices) when message we have sent via API is delivered to them
{
"is_from_me":true,
"receiver":"<RECEIVER_PHONE_NUMBER>",
"sender":"<SENDER_PHONE_NUMBER>",
"timestamp":"2023-05-13T17:44:54+07:00"
}
receipt:delivered
Emitted when message is delivered to receiver but not seen
{
"is_from_me":false,
"receiver":"<RECEIVER_PHONE_NUMBER>",
"timestamp":"2023-05-13T17:54:52+07:00"
}
receipt:read
Emitted when message is seen by the receiver
{
"is_from_me":true,
"receiver":"<RECEIVER_PHONE_NUMBER>",
"sender":"<SENDER_PHONE_NUMBER>",
"timestamp":"2023-05-13T17:44:54+07:00"
}
message
Emitted when a message is received
{
"content": "Utgg",
"isFromMe": false,
"is_document_with_caption": false,
"is_edit": false,
"is_ephemeral": false,
"is_view_once": false,
"is_view_once_v2": false,
"media_type": "",
"multicast": false,
"push_name": "popop",
"receiver": "226063681784",
"sender": "<SENDER_PHONE_NUMBER>",
"timestamp": "2023-05-13T19:17:35+07:00",
"type": "",
"verified_name": null
}
qr_code
TIP
You will need to convert the QR(base64) to images to be able to scan
Triggered by:
{
"event":"qr_code",
"data": {
"codes": [
"<BASE64_QR_CODE_1>",
"<BASE64_QR_CODE_2>",
"<BASE64_QR_CODE_3>",
"<BASE64_QR_CODE_4>",
"<BASE64_QR_CODE_5>",
"<BASE64_QR_CODE_6>",
]
}
}
pair_success
Emitted when you scanned the QR code and have successfully logged in
{
"event":"pair_success",
"data":{
"id":"<DEVICE_PHONE_NUMBER>.0:17@s.whatsapp.net",
"business_name":"",
"platform":"android"
}
}
pair_error
Emitted when you scanned the QR code but pairing failed
{
"event":"pair_error",
"data":{
"id":"<DEVICE_PHONE_NUMBER>.0:17@s.whatsapp.net",
"business_name":"",
"platform":"android",
"error": "<ERROR_MESSAGE>"
}
}
history_sync
Emitted when the phone send historical messages
history_sync:pushnames
{
"event":"history_sync:pushnames",
"data":[
{
"id":"<CONTACT_PHONE>@s.whatsapp.net",
"pushname":"joe",
},
.....
.....
]
}
history_sync:initial_bootstrap
{
"event":"history_sync:initial_bootstrap",
"data":{
"conversations": [
.......
]
}
}
privacy_settings_change
Emitted when the user changes the privacy settings
{
"event":"privacy_settings_change",
"data": {
"group_add_changed": false,
"last_seen_changed": false,
"status_changed": false,
"profile_changed": false,
"read_receipts_changed": false,
}
}