Callback URL WhatsApp Business
Configure a callback URL to receive real-time status updates for your outbound WhatsApp messages.
- Create an endpoint that accepts
POSTrequests with a JSON body. - Provide the endpoint URL using the following structure.
POST RequestSend WhatsApp Message API will make a POST request to your URL.
After you send a message, the callback URL receives the following event parameters:
| Parameter | Description |
|---|---|
| callback | Webhook URL to notify about the events of the whatsApp message. Date when the API receives the WhatsApp message status. The date is represented with date in UTC Zulu format: (yyyy-mm-dd-Thh:mm:ss.ssZ). |
| date | Date when the API receives the WhatsApp message status. The date is represented with date in UTC Zulu format: (yyyy-mm-dd-Thh:mm:ss.ssZ). |
| externalId | Alphanumeric identifier used to identify your whatsApp messages uniquely for reporting purposes. |
| campaignId | Broadcast identifier that can be used for reporting purposes. This is an identifier you can use to uniquely identify the destination address in your systems. This is similar to the externalId and will be sent back to you if you are requesting callbacks that contain status changes of the messages you send. |
| from | Shortcode (from 1 to 6 digits), Longcode (from 7 digits on), an alphanumeric shortcode (ex. COMPANY) or a virtual number used to originate and send the whatsApp message |
| id | Unique identifier of the WhatsApp message. |
| providerId | Unique message identifier assigned by Meta. |
| to | Destination address of the message. |
| message | Content of the whatsApp message that was sent to the end user. |
| username | Owner or creator of the WhatsApp message. |
| status | When a whatsApp Message is sent, the system assigns one of the following possible statuses to an message:
|
| detail | Only applies if the Provides more context about why a message failed. This enhancement helps users understand the specific reason behind a failed delivery. For example: |
| webhook | Origin of the event.
|
The following callback payloads show how the status and detail fields vary by delivery outcome:
-
A successfully sent message has a
"SENT"status and does not include the"detail"field. -
A failed message has a
"FAILED"status and includes a"detail"field that explains the failure. -
Successful Send
{ "callback": "https://webhook.site/45654", "date": "2023-01-02T19:35:19.300Z", "externalId": "external-id-001", "campaignId": null, "from": "130523", "id": "id.HBgIxNTU2", "providerId": "wamid.45675", "to": "+105500000000", "message": "message text body", "username": "development", "status": "SENT", "webhook": true } -
Failed Send
{ "callback": "https://webhook.site/45654", "date": "2023-01-02T19:35:19.300Z", "externalId": "external-id-001", "campaignId": null, "from": "130523", "id": "id.HBgIxNTU2", "providerId": "wamid.45675", "to": "+105500000000", "message": "message text body", "username": "development", "status": "FAILED", "detail": "Re-engagement message. Message failed to send because more than 24 hours have passed since the customer last replied to this number.", "webhook": true }
Updated 10 days ago
