How to Subscribe to Account Update Webhooks for WhatsApp Business

Integrating with webhooks allows businesses to receive real-time notifications about changes to their WhatsApp Business Account (WABA). These updates can include policy violations or account restrictions, enabling businesses to take timely corrective actions.

Before You Begin

To set up webhooks, you’ll need:

  1. Meta Developer account.
  2. Business Manager account.
  3. Meta for Developers App linked to your Business Manager.

When creating your app:

Steps to Add WhatsApp as a Product:

  1. Go to Meta Developers and log in.
  2. Select your app to open the dashboard.
  3. In the left panel, click “Add Product”.
  4. Locate WhatsApp and click “Set Up”.

Make sure your app:

  • Completes the App Review process.
  • Requests the (whatsapp_business_management) permission.

Steps to Set Up Webhooks

Step 1: Create Endpoint and Configure Webhooks

Follow the Meta Webhooks Getting Started Guide to create an endpoint and configure your webhook.

Step 2: Subscribe Your App to WABA Notifications

You can subscribe your app to WABA notifications using one of the following methods:

  • API Calls: Use the Graph API to set up your webhook subscriptions programmatically.
  • Graph API Explorer: Manually subscribe to webhook notifications through the Graph API Explorer.

Step 3: Sign Up for Account Updates

Once your app is subscribed, refine the types of updates you want to receive by selecting specific webhook fields.

  • Go to your app’s dashboard and navigate to Settings > Webhooks.
  • Click Manage under Webhook Fields.
  • Select account_update and click Subscribe.

This ensures you’ll receive notifications whenever your WABA violates policies.

Example Notification for Policy Violations:

json

Copy code

{

  “object”: “whatsapp_business_account”,

  “entry”: [

    {

      “id”: “whatsapp-business-account-id”,

      “time”: 1604703058,

      “changes”: [

        {

          “field”: “account_update”,

          “value”: {

            “phone_number”: “16505551111”,

            “event”: “ACCOUNT_VIOLATION”,

            “violation_info”: {

              “violation_type”: “ALCOHOL”

            }

          }

        }

      ]

    }

  ]

}

Step 4: Track WABA Restrictions

Monitor your webhook for restrictions due to policy violations. Notifications will include the restriction_info field detailing the restriction type and expiration.

Example Notifications for Restrictions:

  • Restriction on Adding New Phone Numbers:

json

Copy code

{

  “field”: “account_update”,

  “value”: {

    “phone_number”: “PHONE_NUMBER”,

    “event”: “ACCOUNT_RESTRICTION”,

    “restriction_info”: [

      {

        “restriction_type”: “RESTRICTION_ON_ADD_PHONE_NUMBER_ACTION”,

        “expiration”: TIMESTAMP

      }

    ]

  }

}

json

Copy code

{

  “field”: “account_update”,

  “value”: {

    “phone_number”: “PHONE_NUMBER”,

    “event”: “ACCOUNT_RESTRICTION”,

    “restriction_info”: [

      {

        “restriction_type”: “RESTRICTED_BIZ_INITIATED_MESSAGING”,

        “expiration”: TIMESTAMP

      }

    ]

  }

}

json

Copy code

{

  “field”: “account_update”,

  “value”: {

    “phone_number”: “PHONE_NUMBER”,

    “event”: “ACCOUNT_RESTRICTION”,

    “restriction_info”: [

      {

        “restriction_type”: “RESTRICTED_CUSTOMER_INITIATED_MESSAGING”,

        “expiration”: TIMESTAMP

      }

    ]

  }

}

Why Webhooks Matter

By subscribing to webhooks, you can:

  • Stay informed about policy violations.
  • Take immediate action to resolve issues.
  • Minimize potential disruptions to your account.

For more guidance, contact WePOS Support at support@wepos.ai. Let us know how we can assist you!