Webhooks for Ad Accounts

Webhooks for Ad Accounts allow you to get real-time notifications for certain ads changes.

To set up Webhooks for Ad Accounts, the following steps are required:

  1. Set up your endpoint and configure the Webhooks.
  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.

Currently, you can get real-time notifications for ad object status changes for WITH_ISSUES and IN_PROCESS. Subscribe to one or more 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. See post processing for more information.

Subscribe Your App

You need to subscribe your app to webhook notifications for your ad account. You app should have edit permission to the ad account to complete this step. The app should also have ads_management permission.

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 request:

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

On success you see this response:

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

To remove an app from subscription, send a DELETE request:

On success, you see this response:

{"success": "true"}

Subscribe with Graph API Explorer

You can also subscribe app 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 a different app by specifying subscribed_apps as an input parameter with the app id.

The app must have permission to edit the ad account in order to 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"
            }
          }
        ]
      }
    ]
  }
]