Guides
Webhooks

Delivery statuses

The sent, delivered, read and failed webhooks, pricing, delivery errors and retries when your callback fails.

The response of POST /messages only says the message was accepted. What happens next arrives in the messages field, in value.statuses[].

Lifecycle

StatusWhen
sentThe message left the platform
deliveredIt reached the customer's device
readThe customer opened the conversation (only with read receipts turned on)
failedIt could not be delivered; carries errors[]

played exists for voice messages and only goes out when forced through the control API.

json
{
  "messaging_product": "whatsapp",
  "metadata": { "display_phone_number": "555532704202", "phone_number_id": "424361664134261" },
  "statuses": [{
    "id": "wamid.HBgNNTUxMTk4NzY1NDMyMRUCABEYEkEzRERCRDI2Q0RBNTA0NUZGRgA=",
    "status": "delivered",
    "timestamp": "1793914188",
    "recipient_id": "5511987654321",
    "pricing": { "billable": false, "pricing_model": "PMP", "category": "service", "type": "free_customer_service" }
  }]
}

pricing.category is the template category (marketing, utility, authentication) with billable: true and type: "regular", or service (free) for free-form messages. If you sent biz_opaque_callback_data, it comes back in every status.

Failures

json
{
  "id": "wamid.HBgNNTUxMTk4NzY1NDMyMRUCABEYEkZENEQ4MzIwNUMzOEI1MThFMAA=",
  "status": "failed",
  "timestamp": "1794004198",
  "recipient_id": "5511987654321",
  "errors": [{
    "code": 131047,
    "title": "Re-engagement message",
    "message": "Re-engagement message",
    "error_data": { "details": "Message failed to send because more than 24 hours have passed since the customer last replied to this number." },
    "href": "https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes/"
  }]
}
CodeMeaningHow to trigger it in Mimicr
131026Message undeliverable (no WhatsApp, for example)no_whatsapp persona, no_whatsapp OTP scenario
131047Outside the 24-hour windowFree-form message with no customer reply, or clock moved forward
131049Meta chose not to deliver (ecosystem)marketing_saturated persona with marketing
131050The customer stopped marketingopt_out persona or preferences stop
131056Business–customer pair rate limitAudience rules
any—POST /v1/whatsapp/{slug}/messages/{wamid}/status with {"status": "failed", "error_code": 131000}

After failed, no other status goes out for the message.

Order and duplicates

Statuses can arrive out of order and repeated, with Meta too. Use the id and a priority order (failed > read > delivered > sent) instead of arrival order. In Mimicr, a status never goes backwards and each one goes out once; turn on out_of_order_statuses and duplicate_webhooks in the chaos settings to test your handling (see Sandbox testing).

Retries

A delivery succeeds when your callback answers 2xx within 10 seconds. With retry_with_backoff on (the default), a failed delivery is retried, as with Meta, for up to 7 days:

AttemptAfter
2nd30 s
3rd5 min
4th15 min
5th1 h
6th3 h
7th6 h
8th12 h
9th24 h
10th48 h
11th72 h

In Mimicr, these intervals are divided by clock_speed (default 60: 30 s becomes 1 s, 1 h becomes 1 min). With retry_with_backoff off, there is a single attempt. Resend whenever you want:

  • POST /v1/whatsapp/{slug}/webhooks/{id}/resend: tries again now, without scheduling more.
  • POST /v1/whatsapp/{slug}/webhooks/resend-failed: the ones that failed in the last 24 hours (up to 25), or with {"template": "promo_outubro"} the ones of that template's campaign (up to 200).

Wait for a status in a test

bash
npx mimicr wait whatsapp:docs webhook field=messages wamid=<wamid> status=success

The status filter here is the delivery's (pending, success, failed, skipped), not the message's. To wait for the message status: npx mimicr wait whatsapp:docs message wa_id=5511987654321 direction=outbound status=read.