---
title: "Preview an ad rule"
method: POST
path: "/v1/ads/rules/{ruleId}/preview"
tags: ["Ad Rules"]
---

# Preview an ad rule

`POST /v1/ads/rules/{ruleId}/preview`

## Request

- Base URL: `https://zernio.com/api`
- URL: `https://zernio.com/api/v1/ads/rules/{ruleId}/preview`
- Auth: HTTP bearer

Evaluates a rule against current metrics and returns what it would match right now, without
acting on anything, sending a webhook or starting a cooldown. Works on disabled rules.

## Path parameters

- `ruleId` string, required

## Response `200`

Evaluation

- AdRuleEvaluation
  - `evaluatedAt` string, date-time, required
  - `today` string, date, required: The ad account's calendar date the windows were resolved against.
  - `timezone` string, required: IANA timezone of the ad account.
  - `timezoneAssumed` boolean, required: True when the ad account has no known timezone and UTC was assumed.
  - `currency` string, nullable, required
  - `matched` integer, required: How many objects meet every condition.
  - `objects` AdRuleObjectEvaluation[], required: Every delivering campaign or ad set in scope (for an `activate` rule, the rule-paused ones it may reactivate).
    - `id` string, required: Platform ID of the campaign or ad set.
    - `name` string, required
    - `campaignId` string, nullable, required
    - `matched` boolean, required: True when every condition holds.
    - `conditions` object[], required
      - `metric` union, required: `ctr` is a percentage. `spend`, `cpc`, `cpm` and `cpa` are in the ad account currency. `reach` and `frequency` use the platform's de-duplicated reach, so they are accepted on Meta and TikTok only. `result:<key>` reads one of your own results (see [Campaign results](/guides/campaign-results)), on campaign rules only: the values you sent for the window, or a formula over them and the platform's numbers. A campaign with no value for it never matches.
        - 'spend' | 'impressions' | 'clicks' | 'conversions' | 'ctr' | 'cpc' | 'cpm' | 'cpa' | 'roas' | 'reach' | 'frequency'
        - string
      - `window` 'today' | 'yesterday' | 'last_3d' | 'last_7d' | 'last_14d' | 'last_30d', required: Days in the ad account's own timezone. `last_7d` is the 7 full days before today; only `today` reads the day in progress.
      - `op` '>' | '>=' | '<' | '<=', required
      - `value` number, required
      - `actual` number, nullable, required: The object's value over the window. Null when it cannot be computed.
      - `met` boolean, required

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key. `code` is `missing_credentials` when no Authorization header was sent and `invalid_credentials` when the key is unknown, revoked or expired.
- `403`: Ads access required (code `ads_addon_required`). Legacy plans need the Ads add-on; included by default on usage-based plans.
- `404`: Resource not found

## Changes

- **2026-10-30** `c319eb5d95b6`: 12 info
  - added `subschema #1, subschema #2` to the `objects/items/conditions/items/allOf[#/components/schemas/AdRuleCondition]/metric` response property `anyOf` list for the response status `200`
  - removed the `clicks` enum value from the `objects/items/conditions/items/allOf[#/components/schemas/AdRuleCondition]/metric` response property for the response status `200`
  - removed the `conversions` enum value from the `objects/items/conditions/items/allOf[#/components/schemas/AdRuleCondition]/metric` response property for the response status `200`
  - removed the `cpa` enum value from the `objects/items/conditions/items/allOf[#/components/schemas/AdRuleCondition]/metric` response property for the response status `200`
  - …8 more
- **2026-10-30** `f239e5073e14`: 2 warning
  - added the new `frequency` enum value to the `objects/items/conditions/items/allOf[#/components/schemas/AdRuleCondition]/metric` response property for the response status `200`
  - added the new `reach` enum value to the `objects/items/conditions/items/allOf[#/components/schemas/AdRuleCondition]/metric` response property for the response status `200`
- **2026-10-25** `4d3c3acfbcea`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/zernio/apis/zernio-api/changes/v1/ads/rules/:ruleId/preview/post.md)

---

[API](https://skmtc.dev/zernio/apis/zernio-api.md) - [All operations](https://skmtc.dev/zernio/apis/zernio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zernio/apis/zernio-api/revisions/c319eb5d95b6?raw)
