English
Webhook (Deprecated)
No longer available
Webhooks only existed in the old Zawa engine. The current engine has no /webhook endpoint, so requests to it return 404. This page is kept for reference only, please don't build new features on it.
Webhooks used to let Zawa notify your server in real time whenever a message came in. Here's a summary of how they worked.
Set Webhook
POST/webhookSaved the webhook configuration: the destination URL and an identifying token.
| Field | Type | Description |
|---|---|---|
url | string | Your server URL that receives the notifications. |
token | string | Sent back in the x-token header, so you know the request really came from Zawa. |
The response was { "id": "..." }.
Get Webhook
GET/webhookFetched the saved webhook configuration. If it had never been set, url and token were empty strings.
json
{
"webhook": {
"url": "https://example.com/zawa-webhook",
"token": "super-secret"
}
}Notification Payload
Zawa sent a request to the webhook URL with an x-token header and a body like this:
json
{
"type": "message",
"data": "{\"Info\":{...},\"Message\":{...}}"
}| Field | Type | Description |
|---|---|---|
type | string | message for incoming messages, receipt for receipts (delivered/read). |
data | string | Raw WhatsApp data as a JSON string. Its contents vary by message type. |
Zawa didn't process incoming messages at all, media included. So for an image message, you had to decrypt the file yourself. 😅
Example data for a text message
json
{
"Info": {
"Chat": "6281234567890@s.whatsapp.net",
"Sender": "6281234567890:74@s.whatsapp.net",
"IsFromMe": false,
"IsGroup": false,
"ID": "3EB05F22D34BDE64079197",
"Type": "text",
"PushName": "Azickri",
"Timestamp": "2025-07-17T13:23:12+07:00"
},
"Message": {
"conversation": "Hi, this is from Zawa"
}
}