# ad.status_changed

A campaign, ad set or ad on a connected Meta ad account (`metaads`) changed status.

### Sources

Two Meta `ad_account` fields feed it: `in_process_ad_objects` (finished processing, `status.raw` is Meta's `status_name`) and `with_issues_ad_objects` (`status.raw` is `WITH_ISSUES`, `error` filled from Meta).

### Payload notes

`adObject.level` is `CAMPAIGN`, `AD_SET` or `AD`; creative-level events are not forwarded. Branch on `status.raw`. Use `error.code` as the stable discriminator, since `error.summary` and `error.message` are localized to the owner's Meta locale.

### The error block

`error` is present on most `WITH_ISSUES` events but can be absent, and never appears on any other status. Null-check it before reading `error.code`.

### Fan-out

Matching is keyed on `adObject.platformAdAccountId`. When several connected `metaads` accounts point at the same Meta ad account, each receives its own delivery.




**Payload for `ad.status_changed`:**

- **id** (required) `string`: Stable webhook event ID: the dedupe key, also sent as the X-Zernio-Event-Id header and identical on every retry and redelivery. It identifies the event only, never an account or other resource.
- **profiles**: `WebhookProfiles` - See schema definition
- **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** (required) `string`: No description - one of: ad.status_changed
- **account** (required) `object`: The connected ad-platform account that owns the ad object.
  - **accountId** (required) `string`: Internal Zernio account ID (same as used in /v1/accounts/{accountId}).
  - **profileId** (required) `string`: Internal Zernio profile ID this account belongs to.
  - **platform** (required) `string`: Ad platform identifier. Currently always `metaads`. (example: "metaads")
  - **username** (required) `string`: Display username of the connected ad-platform account.
  - **displayName** `string`: Human-readable display name of the account, when available.
- **adObject** (required) `object`: The ad-platform object the status change applies to.
  - **level** (required) `string`: Hierarchy level the status applies to. Mirrors Meta's `level`. Creative-level events are not forwarded. - one of: CAMPAIGN, AD_SET, AD
  - **platformId** (required) `string`: Platform-native ID of the campaign / ad set / ad. For Meta this is
the bare numeric ID (e.g. `120244894077860689`).
 (example: "120244894077860689")
  - **platformAdAccountId** (required) `string`: Platform-native ad-account ID. For Meta this uses the `act_<id>`
shape.
 (example: "act_2129800524463520")
- **status** (required) `object`: Status info. Branch on `status.raw` to handle each transition.
  - **raw** (required) `string`: Platform-native status string, forwarded verbatim. For Meta
this is `status_name` from `in_process_ad_objects` (e.g.
`ACTIVE`, `PAUSED`, `PENDING_REVIEW`, `ARCHIVED`, `DELETED`,
`DISAPPROVED`), or `WITH_ISSUES` when sourced from
`with_issues_ad_objects`. Not constrained by an `enum`, because Meta
may add new values.
 (example: "ACTIVE")
- **error** `object`: Optional. Present on most `WITH_ISSUES` events, carrying the
platform's error diagnostics. May be absent on some `WITH_ISSUES`
events (Meta does not always include diagnostics). Always absent
for any other `status.raw` value. Always null-check before reading.

  - **code** (required) `string`: Platform-native error code, forwarded verbatim. For Meta this
is `error_code` as a string. Use as the stable discriminator, since
`summary` and `message` are localized.
 (example: "2643001")
  - **summary** `string`: Short human-readable summary (Meta `error_summary`). Localized
to the ad-account owner's Meta locale. Display only, do not
match on it.
 (example: "Ad Processing Error")
  - **message** `string`: Full human-readable error message (Meta `error_message`).
Localized, display only.

- **timestamp** (required) `string` (date-time): UTC time at which Zernio generated this event (set once when the event payload is built, before delivery is queued). Retries and redeliveries keep the original value, so it reflects the event, not the delivery attempt.