Add new ad rule

Below is a list of Insights filters and whether they are supported by Trigger Based Rules:

POST https://us-central1-appgregator.cloudfunctions.net/facebook/adrules/

Query Parameters

Headers

{
    "id": "23852206730700549"
}
Body JSON
{
  "name": "Rules-7",
  "status": "DISABLED",
  "evaluation_spec": {
    "evaluation_type": "SCHEDULE",
    "filters": [
      {
        "field": "lifetime_impressions",
        "value": "8000",
        "operator": "GREATER_THAN"
      },
      {
        "field": "cost_per",
        "value": "10",
        "operator": "GREATER_THAN"
      },
      {
        "field": "entity_type",
        "value": "CAMPAIGN",
        "operator": "EQUAL"
      },
      {
        "field": "time_preset",
        "value": "MAXIMUM",
        "operator": "EQUAL"
      }
    ]
  },
  "execution_spec": {
    "execution_type": "PAUSE",
    "execution_options": [
      {
        "field": "user_ids",
        "value": [
          "3305578009767732"
        ],
        "operator": "EQUAL"
      }
    ]
  },
  "schedule_spec": {
    "schedule_type": "DAILY"
  }
}
curl --location --request POST 'https://us-central1-appgregator.cloudfunctions.net/facebook/adrules?name=ft-4&connection_name=fbads-01&adaccount_id=act_1514519918873559' \
--header 'x-api-key: U2Fsd...' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "Rules-7",
  "status": "DISABLED",
  "evaluation_spec": {
    "evaluation_type": "SCHEDULE",
    "filters": [
      {
        "field": "lifetime_impressions",
        "value": "8000",
        "operator": "GREATER_THAN"
      },
      {
        "field": "cost_per",
        "value": "10",
        "operator": "GREATER_THAN"
      },
      {
        "field": "entity_type",
        "value": "CAMPAIGN",
        "operator": "EQUAL"
      },
      {
        "field": "time_preset",
        "value": "MAXIMUM",
        "operator": "EQUAL"
      }
    ]
  },
  "execution_spec": {
    "execution_type": "PAUSE",
    "execution_options": [
      {
        "field": "user_ids",
        "value": [
          "3305578009767732"
        ],
        "operator": "EQUAL"
      }
    ]
  },
  "schedule_spec": {
    "schedule_type": "DAILY"
  }
}'

Last updated