POST /api/v2/template/send, Popcorn tracks that message and calls your webhook URL each time WhatsApp reports a new status: sent, delivered, read, or failed. You get delivery status in real time without polling.
Webhooks are sent only for messages sent through the /api/v2 endpoint. Messages sent through the standard /template/send endpoint, from campaigns, or from the Inbox do not trigger them.
Before you start
- An HTTPS endpoint that accepts
POSTrequests with a JSON body and answers with a2xxstatus within 10 seconds. Plainhttp://URLs,localhost, and private network addresses are rejected. - A role that can edit settings. By default only the Owner and Admin roles can change webhook configuration or run a test. Managers see the panel read-only, with “Only people who can edit workspace settings can change these.”
Configure the webhook
1
Open the webhook settings
Go to Settings → API keys and webhooks and find the Message status webhook panel (“Get a request on your server whenever a message changes status.”).
2
Enter your endpoint
Turn on Send status updates, enter your Webhook URL (“We send each status change to this URL.”), and optionally an Authentication token. The token is sent as
Authorization: Bearer <token> on every request. Once one is saved, the field reads “A token is saved.” and is never displayed again; enter a new value to replace it.3
Choose the events
Under Events to send, tick the statuses you want: Sent, Delivered, Read, Failed. All four are on by default, and you need at least one (“Pick at least one event.”). Unticked statuses are dropped silently.
4
Save, then test
Click Save changes in the Unsaved changes bar; you see Webhook saved. Then click Test webhook at the foot of the panel. It is unavailable until your changes are saved (“Save your changes to test the new URL.”) and until a URL is saved (“Save a URL to send a test.”). The test goes to the saved URL.
Status indicators
The panel also shows an Example payload, a short sample of what your server receives.
Test payload
Test webhook sends one request, with no retries, and waits up to 10 seconds. It uses theUser-Agent Popcorn-Webhook-Test/1.0 and placeholder values so you can tell it apart from real traffic:
Webhook payload
Each status update is aPOST to your URL with these headers:
Authorization header is present only when you configured a token.
Status events
You receive one request per status update WhatsApp reports. A delivered message typically produceswhatsapp_sent, then whatsapp_delivered, then whatsapp_read; a message that fails produces whatsapp_failed. Popcorn relays statuses as WhatsApp reports them, so a message does not always receive every status, and a failure may arrive without a prior whatsapp_sent.
Error codes
Forwhatsapp_failed, Popcorn derives statusCode from keywords in WhatsApp’s error text. When no keyword matches, the code is 9988.
Example failure:
Retries and timeouts
Popcorn treats any2xx response as success. Anything else, including a timeout after 10 seconds, is a failed attempt.
Popcorn does not retry when your endpoint answers with a
4xx status, except 408 and 429, which are retried like network errors.
After the final failure the event is dropped: it is not queued or resent later. The failure is recorded on the message, counts against Success rate, and switches the indicator to Test failed.
Verifying requests
Configure an Authentication token and reject any request whoseAuthorization header does not carry it. Popcorn does not sign payloads; the bearer token is the only way to confirm a request came from Popcorn.
Related
- Send a template: the
/api/v2request that creates the tracking record, includingmessageIdandmetadata. - Delivery and reachability: what sent, delivered, read, and failed mean for WhatsApp messages in general.