Incoming webhooks
Give Shopify, a form, Google Sheets, Zapier or Make a URL that sends a WhatsApp template or starts a sequence when it receives data.
An incoming webhook is a private URL that other tools can POST JSON to. Each time it receives data, Wabee finds the phone number in it, saves the contact, and then sends a template, adds the contact to a sequence, or just saves the contact.
Use incoming webhooks when the other tool can call a URL but you don't want to write code. They need no API key: the secret is part of the URL. If you're writing your own integration, the REST API gives you more control.
URL format
POST https://api.wabee.chat/hooks/{workspaceId}/{triggerId}/{token}
| Part | Description |
|---|---|
workspaceId |
Your workspace. |
triggerId |
This webhook. |
token |
A random 24-character secret generated when the webhook is created. |
You don't need to build the URL yourself: copy it from the app. Some URLs created before workspaces were introduced have no workspaceId part (/hooks/{triggerId}/{token}). They keep working.
Set one up
- Sign in as an owner or admin and go to Settings → Integrations & API.
- In Incoming webhooks, click New webhook. It's created switched off.
- Copy the URL and paste it into the other tool as a webhook that sends
POSTrequests with a JSON body. In Shopify, for example: Settings → Notifications → Webhooks → "Order creation". - Send a test from the other tool (Shopify has "Send test notification"). The webhook stores the data it receives even while it's off.
- Reopen the webhook in Wabee. Latest data received lists every field in that data; click a field to copy its path.
- Fill in the settings below, tick On and click Save.
Settings
| Setting | Description |
|---|---|
| Name | For you; also shown as the sender label in the inbox ("Trigger · Name"). |
| Phone number field | Path to the phone number in the data, for example customer.phone. You can list several, separated by commas (customer.phone, billing_address.phone); the first one with a value is used. |
| Name field (optional) | Path to the customer's name, for example customer.first_name. Saved on the contact. |
| Add tag to the contact (optional) | A tag added to every contact this webhook saves, for example shopify-customer. |
| Then | Send a template, Add to a sequence, or Only save the contact. |
| Template | For "Send a template": an approved template. You then choose where each variable's value comes from. |
| Sequence | For "Add to a sequence": the sequence to start. |
Field paths
Paths use dots to go into nested objects and numbers to pick array items. For this data:
{
"order_number": 1042,
"customer": { "first_name": "Asha", "phone": "+919876543210" },
"line_items": [{ "title": "Blue kurta", "quantity": 1 }]
}
| Path | Value |
|---|---|
order_number |
1042 |
customer.first_name |
Asha |
customer.phone |
+919876543210 |
line_items.0.title |
Blue kurta |
Phone numbers follow the same rules as the API: any common format, with the country code. A number without a country code is read as an Indian number.
Template variables
For each template variable, pick where the value comes from:
| Source | Value |
|---|---|
| From webhook data | A field from the received data, by path (for example order_number). Must be text, a number or true/false; an object or list counts as empty. |
| First name, Full name, Phone number, Email | From the contact. |
| Custom field | A contact attribute. |
| Same text for everyone | Fixed text you type. |
| Tracked link (counts clicks) | A short link that redirects to your URL and counts clicks. |
Each variable can also have a fallback used when its value is empty. Values have line breaks and extra spaces collapsed and are cut to 1,000 characters, as with the API. If a variable is still empty, nothing is sent and the request fails with 422.
Templates with an image, video or document header need the file uploaded in the webhook's settings; the same file is sent every time. Messages go out from your main WhatsApp number.
Marketing templates are subject to the workspace's marketing frequency cap, and contacts who opted out are never messaged.
Example request
curl -X POST "https://api.wabee.chat/hooks/YOUR_WORKSPACE_ID/YOUR_TRIGGER_ID/YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"order_number": 1042,
"customer": { "first_name": "Asha", "phone": "+919876543210" }
}'
Responses
All successful calls return 200. The body depends on what the webhook does:
| Situation | Response |
|---|---|
| Template sent | {"ok": true, "id": "wamid.HBgM..."} (id is the WhatsApp message ID) |
| Added to a sequence | {"ok": true, "enrolled": true} |
| Not added to the sequence (already active in it, opted out, or the sequence has no steps) | {"ok": true, "enrolled": false} |
| Only save the contact | {"ok": true} |
| Webhook is switched off | {"ok": true, "skipped": "disabled"} (the data is still stored for Latest data received) |
Errors
Errors use the same format as the API, {"error": "..."}. Most of them are also shown as Last error under the webhook in the app.
| Status | error |
Why |
|---|---|---|
405 |
Use POST. |
The request wasn't a POST. |
404 |
Unknown webhook. |
Wrong workspace, webhook ID or token, or the webhook was deleted. |
403 |
Webhooks need the Growth plan or higher. See Settings → Plan. |
The workspace's plan doesn't include webhooks (for example after the trial ends). |
403 |
Drip sequences need the Pro plan or higher. See Settings → Plan. |
The webhook adds contacts to a sequence and the plan doesn't include sequences. |
422 |
No valid phone number at "customer.phone". |
None of the phone fields had a valid number. |
422 |
No value for {{1}}. (or header variable, button link value, coupon code) |
A template variable was empty and had no fallback. |
409 |
Template order_shipped is not approved. |
The chosen template is no longer approved. |
409 |
This contact opted out of messages. |
The contact opted out. |
409 |
This number asked not to be contacted. |
The number is suppressed. |
404 |
The sequence for this webhook was deleted. |
Pick another sequence. |
429 |
Frequency cap: this contact already got the maximum marketing messages for now. |
Marketing frequency cap reached. |
503 |
WhatsApp is not connected in Settings. |
No WhatsApp number is connected. |
502 |
Meta: ... |
Meta rejected the message. |
The webhook's counters show how many requests it received and how many templates it sent.
Things to know
- Keep the URL private. Anyone who has it can make Wabee send your template to any number. Wabee doesn't check signatures from the sending tool. If a URL leaks, delete the webhook (the URL stops working at once) and create a new one.
- No duplicate protection. Every request is processed. Many tools retry when they get an error or a slow response, so the same event can arrive more than once; an error such as
422may make the other tool retry the same data. - Respond time. A request that sends a template waits for Meta to accept the message, usually under a few seconds, and times out after 60 seconds.
- Stored data. Only the latest request body is kept (up to 20,000 characters of JSON), for the field picker.
- Send JSON. Use
Content-Type: application/json. Field paths only work on a JSON object.
Plan requirements
Webhooks (incoming and outgoing) are part of the Growth and Pro plans and the 14-day free trial. Adding contacts to sequences also needs a plan with sequences (Pro). On other plans the request is refused with 403, the contact isn't created or changed, and the reason shows as Last error under the webhook. See Limits & plans.