Ads · Ad Rules

Preview an ad rule

Previews an ad rule without changing anything.

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

Guide: Automated ad rules

Request

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

Path parameters

NameTypeNotes
ruleIdrequiredstring

Example

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

Response

200 on success

  • evaluatedAtstring (date-time)required
  • todaystring (date)required
  • timezonestringrequired
  • timezoneAssumedbooleanrequired
  • currencystringrequired

    Can be null.

  • matchedintegerrequired
  • objectsarray of objectrequired
    • idstringrequired
    • namestringrequired
    • campaignIdstringrequired

      Can be null.

    • matchedbooleanrequired
    • conditionsarray of objectrequired
      6 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.

      • actualnumberrequired

        Can be null.

      • metbooleanrequired
200 response
{
  "evaluatedAt": "2026-10-02T09:00:00.000Z",
  "today": "2026-10-01",
  "timezone": "America/New_York",
  "timezoneAssumed": true,
  "currency": "USD",
  "matched": 1,
  "objects": [
    {
      "id": "6bfebd43ddc270f6d2c56fc5",
      "name": "Acme",
      "campaignId": "65a3737dd8b11ea61f199e6e",
      "matched": true,
      "conditions": [
        {
          "metric": "spend",
          "window": "today",
          "op": ">",
          "value": 12.5,
          "actual": 12.5,
          "met": true
        }
      ]
    }
  ]
}

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 read-only, 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