Webhooks for Ad Accounts

You can get real-time notifications when your ads change. To do this, subscribe at the ad account level and get notifications for all the ads in the account.

To set up Webhooks for Ad Accounts:

  1. Set up your endpoint and configure the Webhooks. These are the same steps that you use to set up Webhooks for Facebook Pages.
  2. Subscribe your app under your ad account.

Set up Endpoint and Webhooks

Follow our Webhooks Getting Started guide to create your endpoint and configure your Webhooks. When you configure your webhooks, make sure to choose Ad Account and subscribe to one or more ad account fields below:

Field Description

with_issues_ad_objects

Notifies you when a campaign, ad set or ad under the ad account receives the WITH_ISSUES status.

in_process_ad_objects

Notifies you when a campaign, ad set, or ad exits the IN_PROCESS status.

Subscribe your App

At this point you need to subscribe your app to webhook notifications for the ad account. We only send notifications when your webhooks configured-app is subscribed under the ad account, and when the app has permission to edit the ad account. To subscribe your app, have your app send a POST request subscribed_apps for the ad account:

curl -i -X POST \
  -d "access_token=<ACCESS_TOKEN>" \
  "https://graph.facebook.com/<VERSION>/act_<AD_ACCOUNT_ID>/subscribed_apps?app_id=<APP_ID>"

On success, you see this response:

{"success": "true"}

To see which app's are subscribed for your ad account has subscribed, send a GET:

curl -i -X GET \
  -d "access_token=<ACCESS_TOKEN>" \
  "https://graph.facebook.com/<VERSION>/act_<AD_ACCOUNT_ID>/subscribed_apps"

On success you see information on the subscribed app:

{
 "data": [
 { 
"name": "<APP_NAME>", 
"id": "<APP_ID>" } ]
}

To delete a subscription for an app, send a DELETE request:

On success, you see this response:

{"success": "true"}

Subscribe with Graph API Explorer

If you don't want to subscribe your app with the API, you can easily do it with Graph API Explorer.

Replace the me?fields=id,name query with act_AD_ACCOUNT_ID/subscribed_apps. It will subscribe the app you use to send the POST request in Graph Explorer. Or you can subscribe another app by adding subscribed_apps as an input parameter and the app id. Your app must have permission to edit the ad account in order to successfully subscribe.

[
  {
    "object": "ad_account",
    "entry": [
      {
        "id": "0",
        "time": 1568132516,
        "changes": [
          {
            "field": "with_issues_ad_objects",
            "value": {
              "id": "111111111111",
              "level": "AD",
              "error_code": "567",
              "error_summary": "error summary",
              "error_message": "error message"
            }
          }
        ]
      }
    ]
  }
]