Ads · Ad Rules

Get an ad rule

Fetches an ad rule.

GEThttps://api.pozy.ai/v1/ads/rules/{ruleId}
Facebook and Instagram, Google Workspace, TikTok, LinkedIn, Pinterest and X and 1 moregetAdRule

Guide: Automated ad rules

Request

Send your API key as Authorization: Bearer pz_live_.... Read-only keys can call it. Keys with the ads resource group disabled get 403 resource_group_disabled. Authentication

Path parameters

NameTypeNotes
ruleIdrequiredstring

Example

curl -X GET "https://api.pozy.ai/v1/ads/rules/6cd4059483de62b474d02fe7" \
  -H "Authorization: Bearer $POZY_API_KEY"

Response

200 on success

  • ruleobjectrequired
    16 child fields
    • idstringrequired
    • namestringrequired
    • accountIdstringrequired
    • platformstringrequired
    • adAccountIdstringrequired
    • levelstringrequired

      One of campaign, adset, ad.

    • campaignIdsarray of stringrequired

      Can be null.

    • conditionsobjectrequired
      1 child field
      • allarray of objectrequired

        At least 1 item. Up to 10 items.

        4 child fields
        • metricstringrequired

          One of spend, impressions, clicks, conversions, ctr, cpc, cpm, cpa, roas, reach, frequency.

        • windowstringrequired

          One of today, yesterday, last_3d, last_7d, last_14d, last_30d.

        • opstringrequired

          One of >, >=, <, <=.

        • valuenumberrequired

          At least 0.

    • actionsarray of objectrequired

      At least 1 item.

      One of:

      Option 1 (1 fields)
      • typestringrequired

        One of notify.

      Option 2 (2 fields)
      • typestringrequired

        One of pause.

      • maxChangesPerDayinteger

        1 to 100.

      Option 3 (2 fields)
      • typestringrequired

        One of activate.

      • maxChangesPerDayinteger

        1 to 100.

      Option 4 (5 fields)
      • typestringrequired

        One of adjust_budget.

      • directionstringrequired

        One of increase, decrease.

      • percentintegerrequired

        1 to 100.

      • limitnumberrequired
      • maxChangesPerDayinteger

        1 to 100.

    • scheduleobjectrequired
      1 child field
      • everyMinutesintegerrequired

        One of 60, 180, 360, 720, 1440.

    • cooldownMinutesintegerrequired
    • enabledbooleanrequired
    • lastRunAtstring (date-time)required

      Can be null.

    • nextRunAtstring (date-time)required

      Can be null.

    • createdAtstring (date-time)required
    • updatedAtstring (date-time)required
200 response
{
  "rule": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "name": "Acme",
    "accountId": "696e0b682d0a31188e7a2ba9",
    "platform": "instagram",
    "adAccountId": "666219aad7bab67ace411e4f",
    "level": "campaign",
    "campaignIds": [
      "string"
    ],
    "conditions": {
      "all": [
        {
          "metric": "spend",
          "window": "today",
          "op": ">",
          "value": 12.5
        }
      ]
    },
    "actions": [
      {
        "type": "notify"
      }
    ],
    "schedule": {
      "everyMinutes": 60
    },
    "cooldownMinutes": 1,
    "enabled": true,
    "lastRunAt": "2026-10-02T09:00:00.000Z",
    "nextRunAt": "2026-10-02T09:00:00.000Z",
    "createdAt": "2026-10-02T09:00:00.000Z",
    "updatedAt": "2026-10-02T09:00:00.000Z"
  }
}

Errors

Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:

400invalid_request_errorA parameter or body field is missing or invalid. param names it.
401authentication_errorThe API key is missing, revoked or expired.
403permission_errorThe key is scoped to other profiles or has this resource group disabled.
404not_foundNothing with that id exists in your workspace.
429rate_limit_errorToo many requests this minute. Wait for Retry-After seconds.

Every code is listed in Errors.

More in Ad Rules