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.
Configure the webhook
1
Open the webhook settings
Go to Settings → API Keys & Webhooks and scroll to Message Status Webhook.
2
Enter your endpoint
Turn on Enable webhooks, enter your Webhook URL, and optionally an Authentication Token. The token is sent as
Authorization: Bearer <token> on every request. After saving, the field shows (configured) and the token 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. Unticked statuses are dropped silently.
4
Save, then test
Click Save changes in the bar at the bottom; the page confirms “Webhook configuration saved.” Then click Test webhook. The test goes to the saved URL, so save before testing; a test sent before saving reports “Webhook configuration changed before the test delivery” or “No webhook URL configured”.
Status indicators
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 Error.
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.