We are sunsetting On-Premises API. Refer to our On-Premises API Sunset document for details, and to learn how to migrate to our next-generation Cloud API.
Subscribe to Webhooks to get notifications about messages your business receives and customer profile updates. See Overview, Webhooks for more information on WhatsApp Business Platform webhooks.
Webhooks set up will not affect the phone number on your WhatsApp Business App. Only after you migrate your number over to the WhatsApp Business Platform can you no longer use that number on your WhatsApp Business App.
You will need:
HTTPS 200 OK
response when a notification is receivedIf a notification isn't delivered for any reason or if the webhook request returns a HTTP status code other than 200
, we retry delivery. We continue retrying delivery with increasing delays up to a certain timeout (typically 24 hours, though this may vary), or until the delivery succeeds.
Send a PATCH
request to the the /v1/settings/application
endpoint with the webhooks
parameter set to your callback URL endpoint. Other commonly configured parameters are sent_status
and callback_persist
.
PATCH /v1/settings/application { "callback_persist": true, "sent_status": true, // Either use this or webhooks.message.sent, but webhooks.message.sent property is preferred as sent_status will be deprecated soon "webhooks": { "url": "webhook.your-domain", "message": { // Available on v2.41.2 and above "sent": false, "delivered": true, "read": false }, } }
On success, the response contains 200 OK
with a null
or a JSON object.
Visit the Application Settings Reference for more information about configuring your app, and additional webhooks parameters.
Whenever a trigger event occurs, the WhatsApp Business Platform sees the event and sends a notification to a Webhook URL you have previously specified. You can get two types of notifications:
See Components for information on each field.
{ "errors": [ { "code": <error-code>, "title": "<error-title>", "details": "<error-description>", "href": "location for error detail" }, { ... } ] }
To test your Webhoooks, you can create a sample app with an endpoint for receiving notifications.