Skip to content

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 /webhook

Saved the webhook configuration: the destination URL and an identifying token.

FieldTypeDescription
urlstringYour server URL that receives the notifications.
tokenstringSent back in the x-token header, so you know the request really came from Zawa.

The response was { "id": "..." }.

Get Webhook ​

GET /webhook

Fetched 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\":{...}}"
}
FieldTypeDescription
typestringmessage for incoming messages, receipt for receipts (delivered/read).
datastringRaw 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": "[email protected]",
    "Sender": "6281234567890:[email protected]",
    "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"
  }
}