---
title: "Ad rule triggered event"
method: POST
path: "ad_rule.triggered"
tags: ["Webhook Events"]
---

# Ad rule triggered event

`POST ad_rule.triggered` (webhook)

Fired when a scheduled ad rule run finds campaigns or ad sets meeting every condition,
once per object per cooldown.
See `WebhookPayloadAdRuleTriggered` for when it fires and when it does not.

## Payload

- WebhookPayloadAdRuleTriggered: Webhook payload for the `ad_rule.triggered` event. Fires when a scheduled run of a rule with a `notify` action finds campaigns or ad sets that meet every condition of the rule. Each object is announced at most once per rule cooldown, so `objects` lists only the objects the run acted on, never the ones still in cooldown. A run where every matching object is still in cooldown sends nothing. An object whose action failed gets no cooldown: the next run retries it and reports it again.
  - `id` string, required: Stable webhook event ID: the dedupe key, also sent as the X-Zernio-Event-Id header and identical on every retry and redelivery.
  - `profiles` object[]: The profiles this event belongs to, each with the externalId you set on it (null when none is set). Present on every event tied to a profile and absent on events that belong to none. Events spanning several profiles (a post published to accounts of different profiles) list each once. Use it to route the event to your tenant without storing Zernio profile ids.
    - `id` string, required
    - `externalId` string, nullable, required
  - `test` boolean: Always true when present: only a sample sent by POST /v1/webhooks/test with an event carries it. Real deliveries never do.
  - `event` 'ad_rule.triggered', required
  - `account` WebhookAdsAccount, required: The connected ads account the event belongs to.
    - `accountId` string, required: Internal Zernio account ID (same as used in /v1/accounts/{accountId}).
    - `profileId` string, required: Internal Zernio profile ID this account belongs to.
    - `platform` string, required: Ads connection platform (`metaads`, `googleads`, `tiktokads`, `linkedinads`, `pinterestads`, `xads`, ...).
    - `username` string, required
    - `displayName` string, nullable
  - `rule` object, required
    - `id` string, required: Zernio ad rule ID.
    - `name` string, required
    - `level` 'campaign' | 'adset', required: Whether the rule evaluates campaigns or ad sets.
    - `platformAdAccountId` string, required: Platform-native ad account ID the rule watches.
  - `run` object, required
    - `id` string, required: ID of the rule run that triggered.
    - `ranAt` string, date-time, required: Scheduled time of the run (UTC).
    - `today` string, date, required: The ad account's calendar date (YYYY-MM-DD) the condition windows were resolved against, so `today` and `last_7d` mean the account's days, not UTC days.
    - `timezone` string, required: IANA timezone used for `today`, for example `Europe/Madrid`.
    - `timezoneAssumed` boolean, required: True when the ad account has no known timezone and UTC was assumed.
    - `currency` string, nullable, required: ISO 4217 currency of the ad account, which money metrics (`spend`, `cpc`, `cpm`, `cpa`) and condition values are in. Null when unknown.
  - `objects` object[], required: The campaigns or ad sets this run acted on, at the rule's `level`, including those whose action failed. Objects still in cooldown are left out.
    - `platformId` string, required: Platform-native ID of the campaign or ad set.
    - `name` string, required: Name on the platform. Falls back to `platformId` when the platform reports none.
    - `platformCampaignId` string, nullable, required: Platform-native ID of the campaign the object belongs to (on a campaign-level rule, the campaign's own ID). Null when unknown.
    - `conditions` object[], required: Every condition of the rule, with the value the object reached.
      - `metric` string, required: `spend`, `impressions`, `clicks`, `conversions`, `ctr`, `cpc`, `cpm`, `cpa` or `roas`. New values may be added.
      - `window` string, required: `today`, `yesterday`, `last_3d`, `last_7d`, `last_14d` or `last_30d`, in the account's calendar (see `run.today`). New values may be added.
      - `op` '>' | '>=' | '<' | '<=', required
      - `value` number, required: The threshold set on the rule.
      - `actual` number, nullable, required: The object's value for the metric over the window. Null when it cannot be computed, for example a cost per action with no actions.
    - `actions` object[], required: What the rule did to the object. Empty on a rule that only notifies.
      - `type` 'pause' | 'activate' | 'adjust_budget', required
      - `status` 'done' | 'skipped' | 'failed', required: `skipped` when the action could not or need not apply (already paused or active, budget at its limit, a budget that is unknown, not daily or set at another level, no live ads, or a permanent refusal from the platform), `failed` when it errored and will be retried on the next run.
      - `reason` string, nullable, required: Why the action was skipped or failed: `already_paused`, `already_active`, `at_limit`, `budget_unknown`, `budget_not_daily`, `budget_level_mismatch`, `no_live_ads`, `ads_allowance_exceeded` (a reactivation or budget increase for a team past its free live-ads allowance), or the platform's message. Null when done.
      - `previousDailyBudget` number, nullable, required: On `adjust_budget`, the daily budget before the change, in the ad account currency. Null otherwise.
      - `newDailyBudget` number, nullable, required: On `adjust_budget`, the daily budget after the change. Null when nothing changed.
  - `timestamp` string, date-time, required: UTC time at which Zernio generated this event.

## Acknowledgement `200`

Webhook received successfully

---

[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/dadaad5046d4?raw)
