WhatsApp Business Accounts (WABAs) and their assets are objects in the Facebook Social Graph. When a trigger event occurs to one of those objects, Facebook sees it and sends a notification to the webhook URL specified in your Facebook App's dashboard.
In the context of embedded signup, you can use webhooks to get notifications of changes to your WABAs, phone numbers, message templates, and messages sent to your phone numbers.
You need to individually subscribe to every WABA for which you wish to receive Webhooks. After fetching the client's WABA ID, subscribe your app to the ID in order to start receiving Webhooks.
See Webhooks for WhatsApp Business Accounts for more information about subscribing to Webhooks.
First, set up the Webhooks product for your app:
For more information about subscribing to Webhooks in the App Dashboard, see Configuring the Webhooks Product.
Once you have set up webhooks in the Webooks product panel, send a POST request to the subscribed_apps
endpoint on the WhatsApp Business Account you want to receive webhooks for.
Include your system uses access token in the request header, preceded by Authorization: Bearer
. For help generating a system user access token, see System Users, Install Apps and Generate Tokens.
POST https://graph.facebook.com/<API_VERSION>/<WABA_ID>/subscribed_apps
curl -X POST \
'https://graph.facebook.com/v21.0
/102289599326934/subscribed_apps' \
-H 'Authorization: Bearer EAAJi...'
{ "success" : true }
Your app (identified by the system user access token) should now receive webhooks notifications describing changes to the WhatsApp Business Account.
Repeat this process for any other WABA for which you wish you receive webhooks notifications. Note that if you subscribe your app to webhooks for multiple WABAs, all webhooks notifications will be sent to the app's callback URL specified in the Webhooks product panel of the App Dashboard.
If you wish to use different callback URLs for each WABA, you must create separate apps, each with their own callback URL, for each WABA and perform the query above on each WABA using each app's system user access token. Alternatively, if you want to use a single app, you can override the callback URL when subscribing to webhooks for each WABA. See Overriding the Callback URL.
To get a list of apps subscribed to webhooks for a WABA, send a GET request to the subscribed_apps
endpoint on the WABA:
GET https://graph.facebook.com/<API_VERSION>/<WABA_ID>/subscribed_apps
A successful response includes an array of apps that have subscribed to the WABA, with link, name, and id properties for each app.
curl \
'https://graph.facebook.com/v21.0
/102289599326934/subscribed_apps' \
-H 'Authorization: Bearer EAAJi...'
{ "data" : [ { "whatsapp_business_api_data" : { "id" : "67084...", "link" : "https://www.facebook.com/games/?app_id=67084...", "name" : "Jaspers Market" } }, { "whatsapp_business_api_data" : { "id" : "52565...", "link" : "https://www.facebook.com/games/?app_id=52565...", "name" : "Jaspers Fresh Finds" } } ] }
To unsubscribe your app from webhooks for a WhatsApp Business Account, send a DELETE request to the subscribed_apps
endpoint on the WABA.
DELETE https://graph.facebook.com/<API_VERSION>/<WABA_ID>/subscribed_apps
curl -X DELETE \
'https://graph.facebook.com/v21.0
/102289599326934/subscribed_apps' \
-H 'Authorization: Bearer EAAJi...'
{ "success" : true }
See Webhooks Overrides.
You can set up webhooks to send you notifications of changes to your subscribed WhatsApp Business Accounts. The types of notifications you can subscribe to are:
Field Name | Description |
---|---|
| Notifies you of decisions related to Official Business Account status or a denial of messaging limit increases. Note that these are independent of developer notifications. |
| A notification is sent to you when a WhatsApp Business Account has been reviewed. |
| A notification is sent to you when a change to your WhatsApp Business Account has occurred. This change can include phone number update, a policy violation, a WhatsApp Business Account has been banned and more. |
| Notifies you of changes to a business's capabilities. This can include changes to the maximum number of business phone numbers your WhatsApp Business Account can have, or a change to the messaging limit for all of your WhatsApp Business Account's business phone numbers. |
| Notifies you of changes to a template's components, like a change in title or body, or an addition of a button. |
| A notification is sent to you when a message template's quality rating changes. |
| A notification is sent to you when the message template has been approved or rejected, or if it has been disabled. |
| A notification is sent to you when your business has received a message from a customer, when you send a message to a customer, when a message is delivered to a customer, and when your message is read by a customer. |
| A notification is sent to you when the name associated with a phone number has been approved or rejected. |
| A notification is sent to you when the business phone number quality status changes. See Monitor Quality Signals for additional information. |
| A notification is sent to you when: |
| A notification is sent to you when a template's category changes, indicating the template's previous and new category. |
Visit the
WhatsApp Business Account Webhooks Reference
for more information about each payload field and the
WhatsApp Cloud API Webhooks Reference
for more information on the different types of messages
notifications you can receive.
See the Webhooks for WhatsApp Business Accounts documentation for more information.
You get notifications in the following general format:
{ "object": "whatsapp_business_account", "entry": [ { // entry object, containing changes "changes": [ { // changes object, containing value "value": { // value object } } ] } ] }
See more details about each field:
An account_update webhook is triggered with event
set to PARTNER_ADDED
when a business customer successfully completes the Embedded Signup flow.
{ "entry": [ { "id": "<BUSINESS_PORTFOLIO_ID>", "time": <WEBHOOK_SENT_TIMESTAMP>, "changes": [ { "value": { "event": "<EVENT>", "waba_info": { "waba_id": "<CUSTOMER_WABA_ID>", "owner_business_id": "<CUSTOMER_BUSINESS_PORTFOLIO_ID>" } }, "field": "account_update" } ] } ], "object": "whatsapp_business_account" }
{ "entry": [ { "id": "35602282435505", "time": 1731617831, "changes": [ { "value": { "event": "PARTNER_ADDED", "waba_info": { "waba_id": "495709166956424", "owner_business_id": "942647313864044" } }, "field": "account_update" } ] } ], "object": "whatsapp_business_account" }
{ "object": "whatsapp_business_account", "entry": [ { "id": "waba-id", "time": 1608243053, "changes": [ { "field": "phone_number_name_update", "value": { "display_phone_number": "16505551111", "decision": "APPROVED", "requested_verified_name": "WhatsApp", "rejection_reason": null } } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "waba-id", "time": 1608243062, "changes": [ { "field": "phone_number_quality_update", "value": { "display_phone_number": "16505551111", "event": "FLAGGED", "current_limit": "TIER_10K" } } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "whatsapp-business-account-id", "time": 1604703058, "changes": [ { "field": "account_update", "value": { "phone_number": "16505551111", "event": "VERIFIED_ACCOUNT" } } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "whatsapp-business-account-id", "time": 1604703058, "changes": [ { "field": "account_update", "value": { "event": "DISABLED_UPDATE" "ban_info": { "waba_ban_state": ["SCHEDULE_FOR_DISABLE", "DISABLE", "REINSTATE"], "waba_ban_date": "January 31, 2021" } } } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "whatsapp-business-account-id", "time": 1604703141, "changes": [ { "field": "account_review_update", "value": { "decision": "APPROVED" } } ] } ] }
{ "entry": [ { "id": "<WHATSAPP_BUSINESS_ACCOUNT_ID>", "time": <TIMESTAMP>, "changes": [ { "value": { "event": "APPROVED", "message_template_id": <TEMPLATE_ID>, "message_template_name": "<TEMPLATE_NAME>", "message_template_language": "<LANGUAGE_AND_LOCALE_CODE>", "reason": "NONE" }, "field": "message_template_status_update" } ] } ], "object": "whatsapp_business_account" }