WhatsApp webhook endpoint: verification and 200 reply

What Meta expects from your webhook endpoint: the GET verification with hub.challenge, the signed POST, and the 200 reply that prevents retries.

Anyone integrating the WhatsApp Cloud API learns early that sending a message is the easy half: one HTTP call, one response. Receiving is different, because the event arrives when the customer decides to write, and your server has to be up, accept the connection and answer the way Meta expects. This article describes the minimum contract of a receiving endpoint: the initial verification, the POST that carries events, and the reply that keeps Meta satisfied.

How Meta verifies your webhook URL

Meta verifies the URL with a GET request. When you register the endpoint in the app dashboard, it calls your URL with three query parameters: hub.mode set to subscribe, hub.verify_token and hub.challenge. If the received token equals the string you stored on your server, you reply HTTP 200 with exactly the value of hub.challenge; in any other case, reply with a non-200 status such as 403.

The verify token is a string you make up and register on both sides. It is not the app secret and it signs nothing: it only proves that whoever registers the URL controls the server answering on it. Treat it as environment configuration, not a constant in code, and use a long random value. The verification runs when you save the configuration; after that, the normal flow is POST.

A frequent mistake at this step is returning the challenge wrapped in JSON. The response must be the bare value, as text. Another is checking the verify token and forgetting hub.mode: without that check, any GET carrying the right token is treated as a verification.

What arrives in the events POST

The POST carries the event JSON with an X-Hub-Signature-256 header in the format sha256=<hash>. Meta documents that the hash is an HMAC-SHA256 of the payload computed with the app secret, and that you should recompute and compare it before trusting the content. Signature details have their own article in this cluster; here the point is the order: verify first, interpret later.

The body follows the whatsapp_business_account format. At the top are object and entry; inside each entry there are changes, and each change has a value with messaging_product, metadata (with display_phone_number and phone_number_id) and, depending on the event, either a messages list or a statuses list. A customer message and a status update for one of your messages use the same endpoint and the same field, messages; what changes is which list appears inside value.

Meta also warns that POSTs may arrive batched, with up to 1,000 updates, although batching is not guaranteed. In practice your handler must never assume one event per request: iterate over entry, then over changes, and handle each item on its own.

Why you reply 200 and what happens if you do not

You reply 200 because Meta treats any other status, or a connection failure, as an undelivered notification and tries again. According to the documentation, retries happen with decreasing frequency for up to 7 days, and Meta itself warns that they can produce duplicate notifications. An endpoint that returns 500 because of a processing bug receives the same message several times.

The documentation consulted does not set a response time limit. Even so, nothing good comes from holding the connection open while you query a database, call another API or compose a reply to the customer. The pattern that works splits the two halves: the endpoint only validates, stores the raw body and returns 200; processing happens later in a worker. The article about queues in this cluster shows that split in detail.

Replying 200 means "received and stored", not "processed successfully". If your processing fails afterwards, Meta already counts the delivery as complete: recovery becomes the job of your queue, not of its retries.

A concrete example of a minimal endpoint

A minimal endpoint has two routes on the same URL: GET for verification and POST for events. The snippet below, in Express, shows the essentials. The detail that breaks most integrations is in the POST: the body is read as raw bytes, without a JSON parser in front, because the signature is computed over what was sent.

// Express, minimal receiving endpoint app.get('/webhooks/whatsapp', (req, res) => { const ok = req.query['hub.mode'] === 'subscribe' && req.query['hub.verify_token'] === process.env.VERIFY_TOKEN if (!ok) return res.sendStatus(403) res.status(200).send(req.query['hub.challenge']) }) app.post('/webhooks/whatsapp', express.raw({ type: '*/*' }), async (req, res) => { // 1. verify the signature over req.body (raw Buffer) // 2. write the body to a durable queue await fila.publicar(req.body) res.sendStatus(200) // 3. reply })

Notice that the POST does no business work. It validates, enqueues and replies. If the queue is unavailable, return an error status on purpose: it is better for Meta to retry than for you to acknowledge an event you did not store.

Transport requirements and what to test before going live

The endpoint must be reachable from the public internet over HTTPS. Meta also documents mutual TLS (mTLS) support as an extra security layer, and recommends it over maintaining an IP allowlist, since source addresses change periodically. The article on mTLS and IPs covers that.

Before going live, the documentation suggests three simple checks. Confirm the endpoint accepts requests from outside. Send a test payload from the configuration page of the app in the Meta dashboard. And check that the app is in Live mode, because some webhooks are not sent in development mode. The last one is the classic cause of "it works with my test number but not with the customer's".

If you use CRPRO Hub, this receiving layer already exists: Meta delivers to the Hub, and the Hub delivers to your signed endpoint with retries. The Hub-side contract is in CRPRO Hub webhooks, and the quickstart is in the Hub quickstart. The concepts here still apply, except your server talks to the Hub, not to Meta.

Common receiving mistakes

There are four common mistakes and all have cheap fixes. Returning the challenge as JSON instead of plain text fails verification. Parsing the JSON before computing the signature breaks validation, because the bytes change. Doing all the work inside the request slows the reply and causes duplicates. And assuming one event per POST ignores batching.

  • Challenge returned as JSON: return the bare value with status 200.
  • Verify token compared without checking hub.mode: check both.
  • Body read by a parser before the signature: use the raw body.
  • Heavy work inside the POST: store it in a queue and reply.
  • App in development mode: switch it to Live to receive every webhook.

To diagnose a webhook that simply does not show up, the useful order is to first check whether the endpoint answers Meta's test, then whether your logs show a signature error, and only then look at the number's connection. The debugging article in this cluster follows that order.

Frequently asked questions

Is the verify token the same as the app secret?

No. The verify token is a string you choose, used only in the GET verification. The app secret is a different value, used to compute the HMAC signature of POSTs.

Do I need to reply to the POST with a specific body?

The documentation consulted asks only for status 200 on a valid POST. The response body is not used, so an empty 200 is enough.

How long does Meta keep retrying?

According to the documentation, it resends with decreasing frequency for up to 7 days. After that, the unacknowledged notification is dropped.

Can I receive more than one event in the same POST?

Yes. Meta says POSTs may be batched with up to 1,000 updates, without guaranteeing batching. Walk through every entry of each request.

Fontes

Documentação oficial da Meta, conferida em 31 de outubro de 2026.