Skip to main content
When you send a template through 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 POST requests with a JSON body and answers with a 2xx status within 10 seconds. Plain http:// 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 the User-Agent Popcorn-Webhook-Test/1.0 and placeholder values so you can tell it apart from real traffic:
A successful test shows Test successful with the response time. A failed test shows Test failed with the reason, for example when the URL points to a private address.

Webhook payload

Each status update is a POST to your URL with these headers:
The 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 produces whatsapp_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

For whatsapp_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 any 2xx 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.
Return 2xx as soon as you have stored the payload, and process it afterwards. A handler that takes longer than 10 seconds is treated as failed and retried, so you may receive the same event again.

Verifying requests

Configure an Authentication Token and reject any request whose Authorization header does not carry it. Popcorn does not sign payloads; the bearer token is the only way to confirm a request came from Popcorn.
  • Send a template: the /api/v2 request that creates the tracking record, including messageId and metadata.
  • Delivery and reachability: what sent, delivered, read, and failed mean for WhatsApp messages in general.