Webhooks
Get an HTTPS POST on your server when customers reply, messages are delivered, contacts opt out, links are clicked or forms are submitted.
Outgoing webhooks push events from Wabee to your own server as they happen, so you don't have to poll. Each event is a signed JSON POST to a URL you choose.
To trigger messages from another tool instead, see Incoming webhooks.
Add a webhook
- Sign in as an owner or admin and go to Settings → Integrations & API.
- In Outgoing webhooks, enter your URL under Add a URL. It must start with
https://and point to a public host name or IP address. URLs with a user name or password, ports below 1024 (other than 443), and private, loopback or link-local addresses are refused. - Tick the events you want and click Add.
- Click Secret next to the new webhook and copy the signing secret to your server.
You can add several URLs, each with its own events and secret. Untick a webhook's checkbox to pause it, or use the trash icon to delete it. Each webhook shows its last result (OK 200 or the error) and how many deliveries succeeded and failed.
New webhooks and changes to the event list can take up to 30 seconds to take effect.
Events
| Event | When it's sent |
|---|---|
message.received |
A customer sent a message to one of your numbers. |
message.status |
Meta reported a status for a message you sent: sent, delivered, read or failed. |
contact.opted_out |
A customer opted out by sending an opt-out word (STOP by default). |
contact.opted_in |
A customer opted back in by sending an opt-in word (START by default). |
link.clicked |
A contact clicked a tracked link that was sent to them. |
form.submitted |
A customer submitted a WhatsApp form. |
contact.opted_out and contact.opted_in fire only for keyword replies from the customer. Changing a contact's opt-in status in the app or through the API doesn't send them.
Request format
Every delivery is an HTTP POST with these headers:
| Header | Value |
|---|---|
Content-Type |
application/json |
User-Agent |
Wabee-Webhooks/1 |
X-Wabee-Event |
The event name, for example message.received |
X-Wabee-Event-Id |
The event's ID, the same as id in the body. |
X-Wabee-Signature-V2 |
t=<unix seconds>,v1=<signature>. See Verify the signature. |
X-Wabee-Signature |
Older signature without a timestamp, kept for existing integrations. Use X-Wabee-Signature-V2 for new ones. |
The body always has the same envelope:
{
"id": "evt_4f1c0b7a9e2d58c3a6b1f0e7",
"event": "message.received",
"at": "2026-12-02T09:41:07.512Z",
"workspaceId": "k3J8sQ2mVx",
"data": { }
}
| Field | Type | Description |
|---|---|---|
id |
string | Unique ID of this event. Retries of the same event keep the same ID, so use it to ignore duplicates. |
event |
string | Event name. Same as the X-Wabee-Event header. |
at |
string | When Wabee queued the event, as an ISO 8601 UTC timestamp. Retries keep the original value. |
workspaceId |
string | The workspace the event belongs to. Useful if one server receives events for several workspaces. |
data |
object | Event details. Depends on the event; see below. |
Every event about a contact names them the same way in data:
| Field | Type | Description |
|---|---|---|
contactId |
string | The contact's ID: the phone number's digits, without +. |
phone |
string | The contact's phone number in international format with +, for example +919876543210. |
number |
object or null | Your business number the event happened on: id (Meta's phone number ID) and phone (with +). null for link.clicked. |
All phone numbers in data include the +.
message.received
{
"id": "evt_4f1c0b7a9e2d58c3a6b1f0e7",
"event": "message.received",
"at": "2026-12-02T09:41:07.512Z",
"workspaceId": "k3J8sQ2mVx",
"data": {
"id": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAEhgUM0EzRjQ2RTVBQjI4NTI2QjBBMUYA",
"contactId": "919876543210",
"phone": "+919876543210",
"from": "+919876543210",
"name": "Asha Rao",
"type": "text",
"text": "Is my order out for delivery?",
"timestamp": "1796204467",
"number": { "id": "400818646453831", "phone": "+919820000000" }
}
}
| Field | Type | Description |
|---|---|---|
id |
string | WhatsApp message ID. |
contactId, phone |
string | The sender. See above. |
from |
string | Sender's phone number, the same as phone. |
name |
string or null | Sender's WhatsApp profile name, if WhatsApp sent one. |
type |
string | Message type. See the table below. |
text |
string | A text version of the message. See the table below. |
timestamp |
string | When WhatsApp received the message, in Unix seconds, as sent by Meta. |
number |
object | The business number the customer wrote to. |
type |
text contains |
|---|---|
text |
The message text. |
button |
The text of the template quick-reply button the customer tapped. |
interactive |
The title of the reply button or list row the customer chose. |
form |
Form submitted (the customer submitted a WhatsApp form; the answers come in form.submitted). |
image, video, document, sticker, audio |
The caption, or an empty string. The file itself isn't included. |
location |
Place name, address and latitude,longitude, joined with ·. |
reaction |
The emoji. |
contacts |
Shared a contact |
unknown |
Unsupported message (...) with WhatsApp's type name. |
Each customer message is sent once, even if Meta delivers it to Wabee more than once.
message.status
{
"id": "evt_9a0d3e61b7c24f58e1a2b3c4",
"event": "message.status",
"at": "2026-12-02T09:42:15.090Z",
"workspaceId": "k3J8sQ2mVx",
"data": {
"id": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAERgSQzVGRkY1QjhBNjM2RTdBMjE5AA==",
"contactId": "919876543210",
"phone": "+919876543210",
"to": "+919876543210",
"status": "delivered",
"timestamp": "1796204535",
"errors": [],
"number": { "id": "400818646453831", "phone": "+919820000000" }
}
}
| Field | Type | Description |
|---|---|---|
id |
string | WhatsApp message ID. Matches the id returned by POST /messages. |
contactId, phone |
string | The recipient. See above. |
to |
string | Recipient's number, the same as phone. |
status |
string | Usually sent, delivered, read or failed, passed through as reported by Meta. |
timestamp |
string | When the status changed, in Unix seconds, as sent by Meta. |
errors |
array | For failed, Meta's error objects (with code, title and more). Otherwise empty. |
number |
object | The business number the message was sent from. |
This event covers every message sent from your numbers: campaigns, sequences, automations, inbox replies and the API. Statuses can arrive out of order (for example read before delivered), and the same status can arrive more than once if Meta repeats it. Each one is a separate event with its own id.
A failed message has Meta's errors:
"errors": [
{
"code": 131026,
"title": "Message undeliverable"
}
]
contact.opted_out and contact.opted_in
{
"id": "evt_1b2c3d4e5f60718293a4b5c6",
"event": "contact.opted_out",
"at": "2026-12-02T10:05:51.338Z",
"workspaceId": "k3J8sQ2mVx",
"data": {
"contactId": "919876543210",
"phone": "+919876543210",
"number": { "id": "400818646453831", "phone": "+919820000000" }
}
}
| Field | Type | Description |
|---|---|---|
contactId, phone |
string | The contact. See above. |
number |
object | The business number the opt-out (or opt-in) word was sent to. |
The opt-out and opt-in words are set in Automations in the app. The defaults are stop, unsubscribe, stop all, opt out, optout, cancel for opting out and start, subscribe, opt in, optin for opting in. Polite extras such as "please stop" also count.
link.clicked
{
"id": "evt_7e6d5c4b3a2918f7e6d5c4b3",
"event": "link.clicked",
"at": "2026-12-02T11:20:03.774Z",
"workspaceId": "k3J8sQ2mVx",
"data": {
"contactId": "919876543210",
"phone": "+919876543210",
"campaignId": "Vb7nR2kLq9TzX4mE",
"url": "https://shop.example/diwali-sale",
"number": null
}
}
| Field | Type | Description |
|---|---|---|
contactId, phone |
string | The contact who clicked. See above. |
campaignId |
string or null | The campaign the link was sent in, or null if it came from elsewhere (a sequence, the API, an incoming webhook). |
url |
string | The destination the contact was redirected to. |
number |
null | Always null: a click happens in the browser, not on a WhatsApp number. |
Sent for every click by a known contact, including repeat clicks. Clicks on links that aren't tied to a contact (for example a shared QR code link) don't send this event.
form.submitted
{
"id": "evt_c0ffee1234567890abcdef12",
"event": "form.submitted",
"at": "2026-12-02T12:02:44.120Z",
"workspaceId": "k3J8sQ2mVx",
"data": {
"contactId": "919876543210",
"phone": "+919876543210",
"messageId": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAEhgUQjc4RkEyM0YA",
"formId": "p9Xc2LmQ",
"form": "Book a demo",
"answers": { "name": "Asha Rao", "email": "asha@example.com", "city": "Pune" },
"number": { "id": "400818646453831", "phone": "+919820000000" }
}
}
| Field | Type | Description |
|---|---|---|
contactId, phone |
string | The contact who filled in the form. See above. |
messageId |
string | WhatsApp message ID of the submitted form. |
formId |
string or null | The form's ID in Wabee, or null if the form wasn't made in Wabee. |
form |
string or null | The form's name. |
answers |
object | Field name → answer. Dropdown answers are the option's text. Every value is a string. |
number |
object | The business number the form was sent from. |
Respond quickly
Return any 2xx status within 10 seconds. The response body is ignored. Anything else counts as a failure: a 3xx (redirects are not followed, so use the final URL), a 4xx or 5xx, a timeout, or a connection or TLS error.
If you need to do slow work, store the event and process it in the background after responding.
Retries
A failed delivery is retried with exponential backoff, starting about 30 seconds after the failure and roughly doubling each time. Each event gets 5 attempts in total (the first try plus 4 retries). After the last attempt the event is dropped.
Delivery is at least once: if your server processes an event but responds too slowly, you can get it again. Events can also arrive out of order. Use the envelope's id (also in the X-Wabee-Event-Id header) to ignore duplicates: retries of an event always keep the same id.
Pausing or deleting a webhook stops pending retries for it. A URL that is refused for safety reasons, for example because its host name resolves to a private address, isn't retried; the reason is shown as the webhook's last error.
Verify the signature
Every request is signed with the webhook's secret so you can check it came from Wabee, wasn't changed and isn't an old request sent again:
X-Wabee-Signature-V2: t=1796204467,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd
t is when this delivery attempt was sent, in Unix seconds. Each v1 is the lower-case hex HMAC-SHA256 of <t>.<raw body> (the timestamp, a full stop, then the body), keyed with the secret.
To verify:
- Read the raw request body as bytes, before any JSON parsing. Re-serialising parsed JSON changes the bytes and the signature won't match.
- Split the header on
,. Taketand everyv1value. - Reject the request if
tis more than 5 minutes away from your server's clock. This stops someone from sending a captured request again later. - Compute HMAC-SHA256 of
t + "." + raw bodywith your secret, as hex, and compare it with eachv1using a constant-time comparison. Accept the request if any one matches.
Each retry is signed again with a new t, so a retry that arrives hours later still passes step 3. To catch duplicates, keep the event ids you've handled for a day or so.
Rotate the secret
Click Secret next to a webhook, then Rotate secret. Wabee makes a new secret and, for 24 hours, signs every request with both: the header then has two v1 values. Update your server to the new secret within that time and nothing is rejected. After 24 hours only the new secret signs. Rotating again during those 24 hours ends the overlap for the oldest secret.
Node.js (Express)
import crypto from 'node:crypto'
import express from 'express'
const app = express()
const SECRET = process.env.WABEE_WEBHOOK_SECRET
function verify(header, raw) {
const parts = (header ?? '').split(',').map((p) => p.split('='))
const t = Number(parts.find(([k]) => k === 't')?.[1])
if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false
const expected = Buffer.from(crypto.createHmac('sha256', SECRET).update(`${t}.`).update(raw).digest('hex'))
return parts.some(([k, v]) => k === 'v1' && v.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(v), expected))
}
app.post('/whatsapp-events', express.raw({ type: 'application/json' }), (req, res) => {
if (!verify(req.get('X-Wabee-Signature-V2'), req.body)) return res.sendStatus(401)
const { id, event, data } = JSON.parse(req.body.toString('utf8'))
// Skip ids you've already handled, queue the work, then answer right away.
res.sendStatus(200)
})
Python (Flask)
import hashlib, hmac, os, time
from flask import Flask, request, abort
app = Flask(__name__)
SECRET = os.environ["WABEE_WEBHOOK_SECRET"].encode()
def verify(header, raw):
parts = [p.split("=", 1) for p in (header or "").split(",") if "=" in p]
t = next((v for k, v in parts if k == "t"), "")
if not t.isdigit() or abs(time.time() - int(t)) > 300:
return False
expected = hmac.new(SECRET, t.encode() + b"." + raw, hashlib.sha256).hexdigest()
return any(k == "v1" and hmac.compare_digest(expected, v) for k, v in parts)
@app.post("/whatsapp-events")
def whatsapp_events():
if not verify(request.headers.get("X-Wabee-Signature-V2"), request.get_data()):
abort(401)
event = request.get_json()
# Skip ids you've already handled, queue the work, then answer right away.
return "", 200
PHP
<?php
$raw = file_get_contents('php://input');
$t = 0; $sigs = [];
foreach (explode(',', $_SERVER['HTTP_X_WABEE_SIGNATURE_V2'] ?? '') as $part) {
[$k, $v] = array_pad(explode('=', $part, 2), 2, '');
if ($k === 't') $t = (int) $v;
if ($k === 'v1') $sigs[] = $v;
}
$expected = hash_hmac('sha256', $t . '.' . $raw, getenv('WABEE_WEBHOOK_SECRET'));
$ok = abs(time() - $t) <= 300 && count(array_filter($sigs, fn($s) => hash_equals($expected, $s))) > 0;
if (!$ok) {
http_response_code(401);
exit;
}
$event = json_decode($raw, true);
http_response_code(200);
The older signature
Requests also carry X-Wabee-Signature: sha256=<hex HMAC-SHA256 of the raw body>, made with the current secret only. It has no timestamp, so it doesn't protect against replays, and it stops matching as soon as you rotate the secret. It's kept so existing integrations keep working; please move to X-Wabee-Signature-V2.
Test your endpoint
To see real events, add your URL with the message.received event and send a WhatsApp message to your business number from your own phone. The webhook's status line in Settings → Integrations & API shows OK 200 or the error from the last attempt.
Plan requirements
Webhooks (incoming and outgoing) are part of the Growth and Pro plans and the 14-day free trial. On other plans, events aren't sent to your outgoing webhooks, including events that were queued but not yet delivered when the plan changed. See Limits & plans.