> Documentation index: https://docs.zernio.com/llms.txt. Every page is also Markdown: add .md to its URL.

# Approve or reject a post API Reference

Approves or rejects a post saved with `requiresApproval: true` (status `pending_approval`).
`approve` schedules the post for its `scheduledFor` and fires the `post.scheduled` webhook. When that time has already passed, the post publishes within a couple of minutes.
`reject` returns the post to `draft`.

Team members who can approve a post get one email every 15 minutes listing the posts sent for their approval.

The decision, the optional `comment`, the reviewer's user id and the time are kept on the post as `metadata.review`.
Returns 409 when the post is not `pending_approval`.

Any team member who can write in one of the post's profiles may review it, and so may an `approver` (a role that can only see and review posts in its profiles). A `viewer` cannot.


## POST /v1/posts/{postId}/review

**Approve or reject a post**

Approves or rejects a post saved with `requiresApproval: true` (status `pending_approval`).
`approve` schedules the post for its `scheduledFor` and fires the `post.scheduled` webhook. When that time has already passed, the post publishes within a couple of minutes.
`reject` returns the post to `draft`.

Team members who can approve a post get one email every 15 minutes listing the posts sent for their approval.

The decision, the optional `comment`, the reviewer's user id and the time are kept on the post as `metadata.review`.
Returns 409 when the post is not `pending_approval`.

Any team member who can write in one of the post's profiles may review it, and so may an `approver` (a role that can only see and review posts in its profiles). A `viewer` cannot.


### Parameters

- **postId** (required) in path: No description

### Request Body

- **decision** (required) `string`: approve schedules the post; reject returns it to draft. - one of: approve, reject
- **comment** `string`: Optional note for the post author, for example what to change. Stored as metadata.review.comment.

### Responses

#### 200: The reviewed post

**Response Body:**

- **post**: `Post` - See schema definition

#### 400: Invalid request

**Response Body:**

- **error** `string`: Human-readable error message.
- **type** `string`: Error class for programmatic handling. - one of: invalid_request_error, authentication_error, permission_error, not_found, rate_limit_error, platform_error, api_error
- **code** `string`: Stable machine-readable error code.
- **param** `string`: The request field that caused the error, when applicable.
- **docUrl** `string`: Documentation page for resolving the error, when one applies.
- **platform** `string`: Upstream platform (e.g. meta, google, tiktok), present when type is platform_error.
- **platformError** `object`: Raw error payload from the upstream platform, passed through verbatim so
integrators can read provider-specific codes. For Meta this includes
error_subcode, error_user_title, and error_user_msg.

- **provider** `string`: Email API: the mailbox provider the error came from (`google`, `microsoft`).
- **providerError** `object`: Email API: the provider's own error code and message, for support and logs. Branch on `code`, not on this.
  - **code** `string,null`: No description
  - **message** `string,null`: No description
- **retryable** `boolean`: Email API: whether the same request can succeed if retried (with the same `Idempotency-Key` for sends).
- **requestId** `string`: Email API: the request id, also in the `X-Request-Id` header. Quote it when you contact support.
- **docsUrl** `string`: Email API: where this `code` is documented.
- **details** `object`: Additional structured context for the error (for example field-level validation errors). What it carries depends on the endpoint and platform.

**Meta ads refusals.** The ones customers hit most come back with their own `code` instead of `platform_api_error`, the field to fix in `param`, and an English `details.hint` saying how to fix it. `details.fix` ({ label, url }) links the Meta page that resolves it, when there is one.

The code is picked from Meta's numeric `code` and `error_subcode` (and Meta's English developer `message` for the carousel case below), never from `error_user_msg`, so it is the same whatever language Meta wrote `error_user_msg` in. Branch on `code` and show `details.hint`.

The error `message` starts with that English hint. When the rest of it was only Meta's own wording, written in the ad account's language, it is dropped; a next step Zernio wrote stays after the hint. Meta's error stays whole in `platformError`.

Meta's wording is kept after the hint when the hint points to a detail only Meta gives: the minimum budget or spend cap, an image URL, a button, an object ID.

- `ad_account_payment_required`: the ad account has no usable payment method (subcode 1815010, 1359188).
- `ad_account_policy_not_accepted`: a business admin has to accept Meta's non-discrimination policy (subcode 2859002, 2859024).
- `lead_ads_terms_not_accepted`: the Facebook Page has not accepted the Lead Ads terms (subcode 1815089).
- `custom_audience_terms_not_accepted`: the ad account has not accepted Meta's Custom Audience terms, needed for customer list audiences; `details.fix` links its terms page (subcode 1870090).
- `verified_advertiser_required`: the market requires a verified beneficiary and payer; send `regionalRegulationIdentities` (subcode 3858634, 3858636, 3858442, 3858548, 3858495).
- `ad_account_unusable`: the ad account is not active, or the business is restricted from advertising (subcode 1885316, 2446325, and 2490592, 4841021 below).
- `meta_security_check_required`: the login behind the connection is held at a security check (code 31). When the connection records that login, `details.heldLogin` names it (`{ kind: "facebook_user", facebookUserId }` or `{ kind: "system_user", businessId }`) and `details.hint` says who clears it.
- `meta_action_blocked`: Meta temporarily blocked the Facebook user from this action (subcode 2859015).
- `meta_ad_consent_required`: the Page or Instagram owner chose Meta without ads or less personalized ads (subcode 3858231, 3858412).
- `instagram_account_restricted`: Meta restricted the Instagram account the ad runs as (subcode 2207070).
- `insufficient_permissions`: the ad account cannot use the Instagram account, or the Facebook user has no advertiser permission on the Page (subcode 1815199, 1815202, 1885499, 1341012, and the Advertise permission case below).
- `whatsapp_number_not_linked`: the WhatsApp number is no longer linked to the Page (subcode 2446880, 1487246), or the Page has no verified WhatsApp Business number (subcode 2446125, also returned when pausing an existing click-to-WhatsApp ad; pause its ad set instead).
- `invalid_targeting`: Meta refused the audience or a placement (subcode 1487079, 1870247, 2909035, 1870189, 1870188, 1487756, 1487843, 2490562).
- `post_not_boostable`: Meta does not allow the post to be promoted (subcode 2446187, 2875030, 1487472), or the boosted Instagram carousel has more than 10 items, which a Meta carousel ad cannot hold.
- `budget_too_low`: the budget or the campaign spend cap is below Meta's minimum, which `platformError.error_user_msg` states (subcode 1885272, and 2446307 on `platformSpecificData.spendCap`).
- `invalid_field_value` on `imageUrl`: Meta could not download an image of the ad, which `platformError.error_user_msg` names; send a public https URL that serves the image without a login or redirect (subcode 3858258).
- `invalid_field_value` on `startDate`: an ad set that already started cannot change its start time (subcode 1487057).
- `invalid_field_value` on `platformSpecificData`: a published ad set cannot change its pixel, conversion event or optimization; create a new ad set with `POST /v1/ads/ad-sets` (subcode 3260011).
- `invalid_field_value` on `callToAction`: the button is not allowed for the objective in a dynamic creative ad set (subcode 1885396).
- `invalid_field_value` on `promotedObject.customEventType`: Meta does not offer this conversion event for the campaign's objective (subcode 2446814).
- `meta_object_not_accessible`: Meta cannot load an object the request names (wrong ID, deleted, or no access); `platformError.message` names the ID (subcode 33, on ads routes only).

**TikTok unpaid balance.** A TikTok create or boost refused because the advertiser has an outstanding payment or no valid payment method answers 422 `ad_account_payment_required` on `adAccountId`, with `details.hint` (settle the balance or add a payment method in TikTok Ads Manager). TikTok's own message stays in the message and in `platformError`.

**Private replies.** The private-reply endpoint adds:

- `privateReplyConsumed` on a 400: the comment's single reply is already spent.
- `privateReplyOutcome: "unknown"` on a 502: Meta answered a server error and the reply may have been delivered.
- `privateReplyOutcome: "not_sent"` on a 429: Instagram's rate limit refused the reply, so retry later.

**Google quota 429.** On a Google Ads or YouTube Analytics 429, `quotaExhausted: true` marks the failure as Google's own quota, not a Zernio rate limit, so you can keep calling other platforms instead of backing off everywhere. When Google names the scope, `quotaScope` is also set:

- `DEVELOPER`: the shared budget (the developer token for Google Ads, the Google Cloud project for YouTube Analytics). Every account on Zernio is affected and there is nothing to change on your side.
- `ACCOUNT`: your own ad account (Google Ads only).

A Meta 429 carries neither field.

**Zernio Google Ads burst-limit 429.** Carries `budgetScope` instead, never `quotaExhausted`. These are Zernio's own limits, applied before the call reaches Google, and both clear within a minute. They are separate axes from `quotaScope`, not the same pool named twice.

- `account`: the limit of 15 requests per minute per connected Google Ads account.
- `user`: the ceiling of 120 requests per minute per Zernio user across all their Google Ads accounts.

**Failed Meta ad create** (`POST /v1/ads/create`, `POST /v1/ads/boost`, `POST /v1/ads/ctwa`). Carries `stage` (where it failed), `adAccountId` (on which ad account) and `createdObjects` (every object this request had already created, with what cleanup did to it).

- `left_behind` objects still exist on the ad account (Meta refused the delete, typically on a held account, or the delete hit a network error). Delete them yourself or reuse them.
- `unconfirmedWrite` is set when Meta answered a create with a 5xx or a non-JSON body, or dropped the connection, and Zernio could not confirm whether the object exists. Check that parent before creating it again.

**Ineligible ad account: 422 `ad_account_unusable`.** When Meta refuses a write because the ad account's status is ineligible to manage ads (Meta subcode 2490592 or 4841021, on the write itself or on a cleanup delete), any Meta ads write answers it.

That covers create, boost, CTWA, campaign / ad set / ad updates and status changes.

The message names the ad account when known, links Meta's fix (https://www.facebook.com/business/help/422289316306981), lists the objects left behind and ends with Meta's original error, which also stays verbatim in `platformError`.

Meta often reports the first failure under an unrelated code (e.g. 1487194 on the creative), so branch on `code`, not on `platformError`.

**Missing Advertise permission: 403 `insufficient_permissions`.** When the Facebook user behind the connection's token lacks the Advertise permission on the ad account, any Meta ads write answers it.

Triggers: Meta subcode 2490585, 2490591 or 4841020 on the write, or a code 200 refusal such as 1487194 whose cleanup deletes Meta refused with 2490591 or 4841020.

Meta may still accept the campaign and ad set and refuse only the ad. The message names the ad account, asks for the Advertise or Manage permission on it (or a token granted `ads_management`, by reconnecting) and lists the objects left behind.

It ends with Meta's `error_user_title`, `error_user_msg` and subcode; the raw error stays in `platformError`.

  - **stage** `string`: Meta ad create failures only. The step that failed:

- `media`: image/video download or upload.
- `campaign`
- `adset`
- `creative`
- `ad`: the ad POST itself, where Meta's code 31 / 3858385 hold and 100 / 1359188 payment rejections land.
- `activation`: switching the created objects on. No longer returned: a refused switch to ACTIVE now answers 201 with an `activation_failed:` warning and the objects kept PAUSED.
- `other`: a read or check before any write.
 - one of: media, campaign, adset, creative, ad, activation, other
  - **adAccountId** `string`: Meta ad create failures only. The ad account the request wrote to (`act_...`).
  - **createdObjects** `array[object]`: Meta ad create failures only. Every object this request created before failing, in creation order. Objects you referenced (an existing campaign, ad set, creative or video) are never listed and never deleted.
    - **type** `string`: No description - one of: campaign, adset, creative, ad, video, image
    - **id** `string`: Meta object id; for `image` the image hash.
    - **cleanup** `string`: - `deleted`: Zernio deleted it.
- `left_behind`: cleanup could not delete it (Meta refused the delete, or the delete hit a network error), so it still exists.
- `kept`: deliberately not deleted. Either an image (hashes are shared by every upload of the same file), or an object Zernio found by name after Meta lost its answer to the create, which may belong to another request with the same name.
 - one of: deleted, left_behind, kept
  - **unconfirmedWrite** `object`: Meta ad create failures only. Set when Meta answered a create with a 5xx or a non-JSON body, or dropped the connection after the request was sent, and reading the parent back by name did not settle it. Zernio did not retry it.

One of these left it open:

- The read-back found several objects of the same name.
- The parent could not be read, or the object is a creative, which has no reliable read-back.
- The read-back found no such object, after a dropped connection, a non-JSON body, a 5xx with `retryOnServerError: false`, or a 5xx on a create whose own body is `status: ACTIVE`.

    - **type** `string`: No description - one of: campaign, adset, creative, ad
    - **parentId** `string`: Where to look for it: the ad set for an ad, the campaign for an ad set, the ad account otherwise.
  - **quotaExhausted** `boolean`: Google Ads and YouTube Analytics 429 only. True when the upstream Google quota is spent rather than a Zernio limit.
  - **quotaScope** `string`: Google Ads and YouTube Analytics 429 only, when the scope is known. DEVELOPER is the shared budget (the developer token for Google Ads, the Google Cloud project for YouTube Analytics); ACCOUNT is your ad account (Google Ads only). - one of: DEVELOPER, ACCOUNT
  - **budgetScope** `string`: Zernio Google Ads burst-limit 429 only (never set alongside `quotaExhausted`). `account` is the limit of 15 requests per minute per connected Google Ads account; `user` is the ceiling of 120 requests per minute per Zernio user across all their Google Ads accounts. Both clear within a minute. - one of: account, user

#### 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.

**Response Body:**

- **error** `string`: Human-readable error message.
- **type** `string`: Error class for programmatic handling. - one of: invalid_request_error, authentication_error, permission_error, not_found, rate_limit_error, platform_error, api_error
- **code** `string`: Stable machine-readable error code.
- **param** `string`: The request field that caused the error, when applicable.
- **docUrl** `string`: Documentation page for resolving the error, when one applies.
- **platform** `string`: Upstream platform (e.g. meta, google, tiktok), present when type is platform_error.
- **platformError** `object`: Raw error payload from the upstream platform, passed through verbatim so
integrators can read provider-specific codes. For Meta this includes
error_subcode, error_user_title, and error_user_msg.

- **provider** `string`: Email API: the mailbox provider the error came from (`google`, `microsoft`).
- **providerError** `object`: Email API: the provider's own error code and message, for support and logs. Branch on `code`, not on this.
  - **code** `string,null`: No description
  - **message** `string,null`: No description
- **retryable** `boolean`: Email API: whether the same request can succeed if retried (with the same `Idempotency-Key` for sends).
- **requestId** `string`: Email API: the request id, also in the `X-Request-Id` header. Quote it when you contact support.
- **docsUrl** `string`: Email API: where this `code` is documented.
- **details** `object`: Additional structured context for the error (for example field-level validation errors). What it carries depends on the endpoint and platform.

**Meta ads refusals.** The ones customers hit most come back with their own `code` instead of `platform_api_error`, the field to fix in `param`, and an English `details.hint` saying how to fix it. `details.fix` ({ label, url }) links the Meta page that resolves it, when there is one.

The code is picked from Meta's numeric `code` and `error_subcode` (and Meta's English developer `message` for the carousel case below), never from `error_user_msg`, so it is the same whatever language Meta wrote `error_user_msg` in. Branch on `code` and show `details.hint`.

The error `message` starts with that English hint. When the rest of it was only Meta's own wording, written in the ad account's language, it is dropped; a next step Zernio wrote stays after the hint. Meta's error stays whole in `platformError`.

Meta's wording is kept after the hint when the hint points to a detail only Meta gives: the minimum budget or spend cap, an image URL, a button, an object ID.

- `ad_account_payment_required`: the ad account has no usable payment method (subcode 1815010, 1359188).
- `ad_account_policy_not_accepted`: a business admin has to accept Meta's non-discrimination policy (subcode 2859002, 2859024).
- `lead_ads_terms_not_accepted`: the Facebook Page has not accepted the Lead Ads terms (subcode 1815089).
- `custom_audience_terms_not_accepted`: the ad account has not accepted Meta's Custom Audience terms, needed for customer list audiences; `details.fix` links its terms page (subcode 1870090).
- `verified_advertiser_required`: the market requires a verified beneficiary and payer; send `regionalRegulationIdentities` (subcode 3858634, 3858636, 3858442, 3858548, 3858495).
- `ad_account_unusable`: the ad account is not active, or the business is restricted from advertising (subcode 1885316, 2446325, and 2490592, 4841021 below).
- `meta_security_check_required`: the login behind the connection is held at a security check (code 31). When the connection records that login, `details.heldLogin` names it (`{ kind: "facebook_user", facebookUserId }` or `{ kind: "system_user", businessId }`) and `details.hint` says who clears it.
- `meta_action_blocked`: Meta temporarily blocked the Facebook user from this action (subcode 2859015).
- `meta_ad_consent_required`: the Page or Instagram owner chose Meta without ads or less personalized ads (subcode 3858231, 3858412).
- `instagram_account_restricted`: Meta restricted the Instagram account the ad runs as (subcode 2207070).
- `insufficient_permissions`: the ad account cannot use the Instagram account, or the Facebook user has no advertiser permission on the Page (subcode 1815199, 1815202, 1885499, 1341012, and the Advertise permission case below).
- `whatsapp_number_not_linked`: the WhatsApp number is no longer linked to the Page (subcode 2446880, 1487246), or the Page has no verified WhatsApp Business number (subcode 2446125, also returned when pausing an existing click-to-WhatsApp ad; pause its ad set instead).
- `invalid_targeting`: Meta refused the audience or a placement (subcode 1487079, 1870247, 2909035, 1870189, 1870188, 1487756, 1487843, 2490562).
- `post_not_boostable`: Meta does not allow the post to be promoted (subcode 2446187, 2875030, 1487472), or the boosted Instagram carousel has more than 10 items, which a Meta carousel ad cannot hold.
- `budget_too_low`: the budget or the campaign spend cap is below Meta's minimum, which `platformError.error_user_msg` states (subcode 1885272, and 2446307 on `platformSpecificData.spendCap`).
- `invalid_field_value` on `imageUrl`: Meta could not download an image of the ad, which `platformError.error_user_msg` names; send a public https URL that serves the image without a login or redirect (subcode 3858258).
- `invalid_field_value` on `startDate`: an ad set that already started cannot change its start time (subcode 1487057).
- `invalid_field_value` on `platformSpecificData`: a published ad set cannot change its pixel, conversion event or optimization; create a new ad set with `POST /v1/ads/ad-sets` (subcode 3260011).
- `invalid_field_value` on `callToAction`: the button is not allowed for the objective in a dynamic creative ad set (subcode 1885396).
- `invalid_field_value` on `promotedObject.customEventType`: Meta does not offer this conversion event for the campaign's objective (subcode 2446814).
- `meta_object_not_accessible`: Meta cannot load an object the request names (wrong ID, deleted, or no access); `platformError.message` names the ID (subcode 33, on ads routes only).

**TikTok unpaid balance.** A TikTok create or boost refused because the advertiser has an outstanding payment or no valid payment method answers 422 `ad_account_payment_required` on `adAccountId`, with `details.hint` (settle the balance or add a payment method in TikTok Ads Manager). TikTok's own message stays in the message and in `platformError`.

**Private replies.** The private-reply endpoint adds:

- `privateReplyConsumed` on a 400: the comment's single reply is already spent.
- `privateReplyOutcome: "unknown"` on a 502: Meta answered a server error and the reply may have been delivered.
- `privateReplyOutcome: "not_sent"` on a 429: Instagram's rate limit refused the reply, so retry later.

**Google quota 429.** On a Google Ads or YouTube Analytics 429, `quotaExhausted: true` marks the failure as Google's own quota, not a Zernio rate limit, so you can keep calling other platforms instead of backing off everywhere. When Google names the scope, `quotaScope` is also set:

- `DEVELOPER`: the shared budget (the developer token for Google Ads, the Google Cloud project for YouTube Analytics). Every account on Zernio is affected and there is nothing to change on your side.
- `ACCOUNT`: your own ad account (Google Ads only).

A Meta 429 carries neither field.

**Zernio Google Ads burst-limit 429.** Carries `budgetScope` instead, never `quotaExhausted`. These are Zernio's own limits, applied before the call reaches Google, and both clear within a minute. They are separate axes from `quotaScope`, not the same pool named twice.

- `account`: the limit of 15 requests per minute per connected Google Ads account.
- `user`: the ceiling of 120 requests per minute per Zernio user across all their Google Ads accounts.

**Failed Meta ad create** (`POST /v1/ads/create`, `POST /v1/ads/boost`, `POST /v1/ads/ctwa`). Carries `stage` (where it failed), `adAccountId` (on which ad account) and `createdObjects` (every object this request had already created, with what cleanup did to it).

- `left_behind` objects still exist on the ad account (Meta refused the delete, typically on a held account, or the delete hit a network error). Delete them yourself or reuse them.
- `unconfirmedWrite` is set when Meta answered a create with a 5xx or a non-JSON body, or dropped the connection, and Zernio could not confirm whether the object exists. Check that parent before creating it again.

**Ineligible ad account: 422 `ad_account_unusable`.** When Meta refuses a write because the ad account's status is ineligible to manage ads (Meta subcode 2490592 or 4841021, on the write itself or on a cleanup delete), any Meta ads write answers it.

That covers create, boost, CTWA, campaign / ad set / ad updates and status changes.

The message names the ad account when known, links Meta's fix (https://www.facebook.com/business/help/422289316306981), lists the objects left behind and ends with Meta's original error, which also stays verbatim in `platformError`.

Meta often reports the first failure under an unrelated code (e.g. 1487194 on the creative), so branch on `code`, not on `platformError`.

**Missing Advertise permission: 403 `insufficient_permissions`.** When the Facebook user behind the connection's token lacks the Advertise permission on the ad account, any Meta ads write answers it.

Triggers: Meta subcode 2490585, 2490591 or 4841020 on the write, or a code 200 refusal such as 1487194 whose cleanup deletes Meta refused with 2490591 or 4841020.

Meta may still accept the campaign and ad set and refuse only the ad. The message names the ad account, asks for the Advertise or Manage permission on it (or a token granted `ads_management`, by reconnecting) and lists the objects left behind.

It ends with Meta's `error_user_title`, `error_user_msg` and subcode; the raw error stays in `platformError`.

  - **stage** `string`: Meta ad create failures only. The step that failed:

- `media`: image/video download or upload.
- `campaign`
- `adset`
- `creative`
- `ad`: the ad POST itself, where Meta's code 31 / 3858385 hold and 100 / 1359188 payment rejections land.
- `activation`: switching the created objects on. No longer returned: a refused switch to ACTIVE now answers 201 with an `activation_failed:` warning and the objects kept PAUSED.
- `other`: a read or check before any write.
 - one of: media, campaign, adset, creative, ad, activation, other
  - **adAccountId** `string`: Meta ad create failures only. The ad account the request wrote to (`act_...`).
  - **createdObjects** `array[object]`: Meta ad create failures only. Every object this request created before failing, in creation order. Objects you referenced (an existing campaign, ad set, creative or video) are never listed and never deleted.
    - **type** `string`: No description - one of: campaign, adset, creative, ad, video, image
    - **id** `string`: Meta object id; for `image` the image hash.
    - **cleanup** `string`: - `deleted`: Zernio deleted it.
- `left_behind`: cleanup could not delete it (Meta refused the delete, or the delete hit a network error), so it still exists.
- `kept`: deliberately not deleted. Either an image (hashes are shared by every upload of the same file), or an object Zernio found by name after Meta lost its answer to the create, which may belong to another request with the same name.
 - one of: deleted, left_behind, kept
  - **unconfirmedWrite** `object`: Meta ad create failures only. Set when Meta answered a create with a 5xx or a non-JSON body, or dropped the connection after the request was sent, and reading the parent back by name did not settle it. Zernio did not retry it.

One of these left it open:

- The read-back found several objects of the same name.
- The parent could not be read, or the object is a creative, which has no reliable read-back.
- The read-back found no such object, after a dropped connection, a non-JSON body, a 5xx with `retryOnServerError: false`, or a 5xx on a create whose own body is `status: ACTIVE`.

    - **type** `string`: No description - one of: campaign, adset, creative, ad
    - **parentId** `string`: Where to look for it: the ad set for an ad, the campaign for an ad set, the ad account otherwise.
  - **quotaExhausted** `boolean`: Google Ads and YouTube Analytics 429 only. True when the upstream Google quota is spent rather than a Zernio limit.
  - **quotaScope** `string`: Google Ads and YouTube Analytics 429 only, when the scope is known. DEVELOPER is the shared budget (the developer token for Google Ads, the Google Cloud project for YouTube Analytics); ACCOUNT is your ad account (Google Ads only). - one of: DEVELOPER, ACCOUNT
  - **budgetScope** `string`: Zernio Google Ads burst-limit 429 only (never set alongside `quotaExhausted`). `account` is the limit of 15 requests per minute per connected Google Ads account; `user` is the ceiling of 120 requests per minute per Zernio user across all their Google Ads accounts. Both clear within a minute. - one of: account, user

#### 403: Forbidden

**Response Body:**

- **error** `string`: Human-readable error message.
- **type** `string`: Error class for programmatic handling. - one of: invalid_request_error, authentication_error, permission_error, not_found, rate_limit_error, platform_error, api_error
- **code** `string`: Stable machine-readable error code.
- **param** `string`: The request field that caused the error, when applicable.
- **docUrl** `string`: Documentation page for resolving the error, when one applies.
- **platform** `string`: Upstream platform (e.g. meta, google, tiktok), present when type is platform_error.
- **platformError** `object`: Raw error payload from the upstream platform, passed through verbatim so
integrators can read provider-specific codes. For Meta this includes
error_subcode, error_user_title, and error_user_msg.

- **provider** `string`: Email API: the mailbox provider the error came from (`google`, `microsoft`).
- **providerError** `object`: Email API: the provider's own error code and message, for support and logs. Branch on `code`, not on this.
  - **code** `string,null`: No description
  - **message** `string,null`: No description
- **retryable** `boolean`: Email API: whether the same request can succeed if retried (with the same `Idempotency-Key` for sends).
- **requestId** `string`: Email API: the request id, also in the `X-Request-Id` header. Quote it when you contact support.
- **docsUrl** `string`: Email API: where this `code` is documented.
- **details** `object`: Additional structured context for the error (for example field-level validation errors). What it carries depends on the endpoint and platform.

**Meta ads refusals.** The ones customers hit most come back with their own `code` instead of `platform_api_error`, the field to fix in `param`, and an English `details.hint` saying how to fix it. `details.fix` ({ label, url }) links the Meta page that resolves it, when there is one.

The code is picked from Meta's numeric `code` and `error_subcode` (and Meta's English developer `message` for the carousel case below), never from `error_user_msg`, so it is the same whatever language Meta wrote `error_user_msg` in. Branch on `code` and show `details.hint`.

The error `message` starts with that English hint. When the rest of it was only Meta's own wording, written in the ad account's language, it is dropped; a next step Zernio wrote stays after the hint. Meta's error stays whole in `platformError`.

Meta's wording is kept after the hint when the hint points to a detail only Meta gives: the minimum budget or spend cap, an image URL, a button, an object ID.

- `ad_account_payment_required`: the ad account has no usable payment method (subcode 1815010, 1359188).
- `ad_account_policy_not_accepted`: a business admin has to accept Meta's non-discrimination policy (subcode 2859002, 2859024).
- `lead_ads_terms_not_accepted`: the Facebook Page has not accepted the Lead Ads terms (subcode 1815089).
- `custom_audience_terms_not_accepted`: the ad account has not accepted Meta's Custom Audience terms, needed for customer list audiences; `details.fix` links its terms page (subcode 1870090).
- `verified_advertiser_required`: the market requires a verified beneficiary and payer; send `regionalRegulationIdentities` (subcode 3858634, 3858636, 3858442, 3858548, 3858495).
- `ad_account_unusable`: the ad account is not active, or the business is restricted from advertising (subcode 1885316, 2446325, and 2490592, 4841021 below).
- `meta_security_check_required`: the login behind the connection is held at a security check (code 31). When the connection records that login, `details.heldLogin` names it (`{ kind: "facebook_user", facebookUserId }` or `{ kind: "system_user", businessId }`) and `details.hint` says who clears it.
- `meta_action_blocked`: Meta temporarily blocked the Facebook user from this action (subcode 2859015).
- `meta_ad_consent_required`: the Page or Instagram owner chose Meta without ads or less personalized ads (subcode 3858231, 3858412).
- `instagram_account_restricted`: Meta restricted the Instagram account the ad runs as (subcode 2207070).
- `insufficient_permissions`: the ad account cannot use the Instagram account, or the Facebook user has no advertiser permission on the Page (subcode 1815199, 1815202, 1885499, 1341012, and the Advertise permission case below).
- `whatsapp_number_not_linked`: the WhatsApp number is no longer linked to the Page (subcode 2446880, 1487246), or the Page has no verified WhatsApp Business number (subcode 2446125, also returned when pausing an existing click-to-WhatsApp ad; pause its ad set instead).
- `invalid_targeting`: Meta refused the audience or a placement (subcode 1487079, 1870247, 2909035, 1870189, 1870188, 1487756, 1487843, 2490562).
- `post_not_boostable`: Meta does not allow the post to be promoted (subcode 2446187, 2875030, 1487472), or the boosted Instagram carousel has more than 10 items, which a Meta carousel ad cannot hold.
- `budget_too_low`: the budget or the campaign spend cap is below Meta's minimum, which `platformError.error_user_msg` states (subcode 1885272, and 2446307 on `platformSpecificData.spendCap`).
- `invalid_field_value` on `imageUrl`: Meta could not download an image of the ad, which `platformError.error_user_msg` names; send a public https URL that serves the image without a login or redirect (subcode 3858258).
- `invalid_field_value` on `startDate`: an ad set that already started cannot change its start time (subcode 1487057).
- `invalid_field_value` on `platformSpecificData`: a published ad set cannot change its pixel, conversion event or optimization; create a new ad set with `POST /v1/ads/ad-sets` (subcode 3260011).
- `invalid_field_value` on `callToAction`: the button is not allowed for the objective in a dynamic creative ad set (subcode 1885396).
- `invalid_field_value` on `promotedObject.customEventType`: Meta does not offer this conversion event for the campaign's objective (subcode 2446814).
- `meta_object_not_accessible`: Meta cannot load an object the request names (wrong ID, deleted, or no access); `platformError.message` names the ID (subcode 33, on ads routes only).

**TikTok unpaid balance.** A TikTok create or boost refused because the advertiser has an outstanding payment or no valid payment method answers 422 `ad_account_payment_required` on `adAccountId`, with `details.hint` (settle the balance or add a payment method in TikTok Ads Manager). TikTok's own message stays in the message and in `platformError`.

**Private replies.** The private-reply endpoint adds:

- `privateReplyConsumed` on a 400: the comment's single reply is already spent.
- `privateReplyOutcome: "unknown"` on a 502: Meta answered a server error and the reply may have been delivered.
- `privateReplyOutcome: "not_sent"` on a 429: Instagram's rate limit refused the reply, so retry later.

**Google quota 429.** On a Google Ads or YouTube Analytics 429, `quotaExhausted: true` marks the failure as Google's own quota, not a Zernio rate limit, so you can keep calling other platforms instead of backing off everywhere. When Google names the scope, `quotaScope` is also set:

- `DEVELOPER`: the shared budget (the developer token for Google Ads, the Google Cloud project for YouTube Analytics). Every account on Zernio is affected and there is nothing to change on your side.
- `ACCOUNT`: your own ad account (Google Ads only).

A Meta 429 carries neither field.

**Zernio Google Ads burst-limit 429.** Carries `budgetScope` instead, never `quotaExhausted`. These are Zernio's own limits, applied before the call reaches Google, and both clear within a minute. They are separate axes from `quotaScope`, not the same pool named twice.

- `account`: the limit of 15 requests per minute per connected Google Ads account.
- `user`: the ceiling of 120 requests per minute per Zernio user across all their Google Ads accounts.

**Failed Meta ad create** (`POST /v1/ads/create`, `POST /v1/ads/boost`, `POST /v1/ads/ctwa`). Carries `stage` (where it failed), `adAccountId` (on which ad account) and `createdObjects` (every object this request had already created, with what cleanup did to it).

- `left_behind` objects still exist on the ad account (Meta refused the delete, typically on a held account, or the delete hit a network error). Delete them yourself or reuse them.
- `unconfirmedWrite` is set when Meta answered a create with a 5xx or a non-JSON body, or dropped the connection, and Zernio could not confirm whether the object exists. Check that parent before creating it again.

**Ineligible ad account: 422 `ad_account_unusable`.** When Meta refuses a write because the ad account's status is ineligible to manage ads (Meta subcode 2490592 or 4841021, on the write itself or on a cleanup delete), any Meta ads write answers it.

That covers create, boost, CTWA, campaign / ad set / ad updates and status changes.

The message names the ad account when known, links Meta's fix (https://www.facebook.com/business/help/422289316306981), lists the objects left behind and ends with Meta's original error, which also stays verbatim in `platformError`.

Meta often reports the first failure under an unrelated code (e.g. 1487194 on the creative), so branch on `code`, not on `platformError`.

**Missing Advertise permission: 403 `insufficient_permissions`.** When the Facebook user behind the connection's token lacks the Advertise permission on the ad account, any Meta ads write answers it.

Triggers: Meta subcode 2490585, 2490591 or 4841020 on the write, or a code 200 refusal such as 1487194 whose cleanup deletes Meta refused with 2490591 or 4841020.

Meta may still accept the campaign and ad set and refuse only the ad. The message names the ad account, asks for the Advertise or Manage permission on it (or a token granted `ads_management`, by reconnecting) and lists the objects left behind.

It ends with Meta's `error_user_title`, `error_user_msg` and subcode; the raw error stays in `platformError`.

  - **stage** `string`: Meta ad create failures only. The step that failed:

- `media`: image/video download or upload.
- `campaign`
- `adset`
- `creative`
- `ad`: the ad POST itself, where Meta's code 31 / 3858385 hold and 100 / 1359188 payment rejections land.
- `activation`: switching the created objects on. No longer returned: a refused switch to ACTIVE now answers 201 with an `activation_failed:` warning and the objects kept PAUSED.
- `other`: a read or check before any write.
 - one of: media, campaign, adset, creative, ad, activation, other
  - **adAccountId** `string`: Meta ad create failures only. The ad account the request wrote to (`act_...`).
  - **createdObjects** `array[object]`: Meta ad create failures only. Every object this request created before failing, in creation order. Objects you referenced (an existing campaign, ad set, creative or video) are never listed and never deleted.
    - **type** `string`: No description - one of: campaign, adset, creative, ad, video, image
    - **id** `string`: Meta object id; for `image` the image hash.
    - **cleanup** `string`: - `deleted`: Zernio deleted it.
- `left_behind`: cleanup could not delete it (Meta refused the delete, or the delete hit a network error), so it still exists.
- `kept`: deliberately not deleted. Either an image (hashes are shared by every upload of the same file), or an object Zernio found by name after Meta lost its answer to the create, which may belong to another request with the same name.
 - one of: deleted, left_behind, kept
  - **unconfirmedWrite** `object`: Meta ad create failures only. Set when Meta answered a create with a 5xx or a non-JSON body, or dropped the connection after the request was sent, and reading the parent back by name did not settle it. Zernio did not retry it.

One of these left it open:

- The read-back found several objects of the same name.
- The parent could not be read, or the object is a creative, which has no reliable read-back.
- The read-back found no such object, after a dropped connection, a non-JSON body, a 5xx with `retryOnServerError: false`, or a 5xx on a create whose own body is `status: ACTIVE`.

    - **type** `string`: No description - one of: campaign, adset, creative, ad
    - **parentId** `string`: Where to look for it: the ad set for an ad, the campaign for an ad set, the ad account otherwise.
  - **quotaExhausted** `boolean`: Google Ads and YouTube Analytics 429 only. True when the upstream Google quota is spent rather than a Zernio limit.
  - **quotaScope** `string`: Google Ads and YouTube Analytics 429 only, when the scope is known. DEVELOPER is the shared budget (the developer token for Google Ads, the Google Cloud project for YouTube Analytics); ACCOUNT is your ad account (Google Ads only). - one of: DEVELOPER, ACCOUNT
  - **budgetScope** `string`: Zernio Google Ads burst-limit 429 only (never set alongside `quotaExhausted`). `account` is the limit of 15 requests per minute per connected Google Ads account; `user` is the ceiling of 120 requests per minute per Zernio user across all their Google Ads accounts. Both clear within a minute. - one of: account, user

#### 404: Resource not found

**Response Body:**

- **error** `string`: No description (example: "Not found")

#### 409: The post is not pending_approval (code: invalid_resource_state), for example because it was already approved or rejected.

**Response Body:**

- **error** `string`: Human-readable error message.
- **type** `string`: Error class for programmatic handling. - one of: invalid_request_error, authentication_error, permission_error, not_found, rate_limit_error, platform_error, api_error
- **code** `string`: Stable machine-readable error code.
- **param** `string`: The request field that caused the error, when applicable.
- **docUrl** `string`: Documentation page for resolving the error, when one applies.
- **platform** `string`: Upstream platform (e.g. meta, google, tiktok), present when type is platform_error.
- **platformError** `object`: Raw error payload from the upstream platform, passed through verbatim so
integrators can read provider-specific codes. For Meta this includes
error_subcode, error_user_title, and error_user_msg.

- **provider** `string`: Email API: the mailbox provider the error came from (`google`, `microsoft`).
- **providerError** `object`: Email API: the provider's own error code and message, for support and logs. Branch on `code`, not on this.
  - **code** `string,null`: No description
  - **message** `string,null`: No description
- **retryable** `boolean`: Email API: whether the same request can succeed if retried (with the same `Idempotency-Key` for sends).
- **requestId** `string`: Email API: the request id, also in the `X-Request-Id` header. Quote it when you contact support.
- **docsUrl** `string`: Email API: where this `code` is documented.
- **details** `object`: Additional structured context for the error (for example field-level validation errors). What it carries depends on the endpoint and platform.

**Meta ads refusals.** The ones customers hit most come back with their own `code` instead of `platform_api_error`, the field to fix in `param`, and an English `details.hint` saying how to fix it. `details.fix` ({ label, url }) links the Meta page that resolves it, when there is one.

The code is picked from Meta's numeric `code` and `error_subcode` (and Meta's English developer `message` for the carousel case below), never from `error_user_msg`, so it is the same whatever language Meta wrote `error_user_msg` in. Branch on `code` and show `details.hint`.

The error `message` starts with that English hint. When the rest of it was only Meta's own wording, written in the ad account's language, it is dropped; a next step Zernio wrote stays after the hint. Meta's error stays whole in `platformError`.

Meta's wording is kept after the hint when the hint points to a detail only Meta gives: the minimum budget or spend cap, an image URL, a button, an object ID.

- `ad_account_payment_required`: the ad account has no usable payment method (subcode 1815010, 1359188).
- `ad_account_policy_not_accepted`: a business admin has to accept Meta's non-discrimination policy (subcode 2859002, 2859024).
- `lead_ads_terms_not_accepted`: the Facebook Page has not accepted the Lead Ads terms (subcode 1815089).
- `custom_audience_terms_not_accepted`: the ad account has not accepted Meta's Custom Audience terms, needed for customer list audiences; `details.fix` links its terms page (subcode 1870090).
- `verified_advertiser_required`: the market requires a verified beneficiary and payer; send `regionalRegulationIdentities` (subcode 3858634, 3858636, 3858442, 3858548, 3858495).
- `ad_account_unusable`: the ad account is not active, or the business is restricted from advertising (subcode 1885316, 2446325, and 2490592, 4841021 below).
- `meta_security_check_required`: the login behind the connection is held at a security check (code 31). When the connection records that login, `details.heldLogin` names it (`{ kind: "facebook_user", facebookUserId }` or `{ kind: "system_user", businessId }`) and `details.hint` says who clears it.
- `meta_action_blocked`: Meta temporarily blocked the Facebook user from this action (subcode 2859015).
- `meta_ad_consent_required`: the Page or Instagram owner chose Meta without ads or less personalized ads (subcode 3858231, 3858412).
- `instagram_account_restricted`: Meta restricted the Instagram account the ad runs as (subcode 2207070).
- `insufficient_permissions`: the ad account cannot use the Instagram account, or the Facebook user has no advertiser permission on the Page (subcode 1815199, 1815202, 1885499, 1341012, and the Advertise permission case below).
- `whatsapp_number_not_linked`: the WhatsApp number is no longer linked to the Page (subcode 2446880, 1487246), or the Page has no verified WhatsApp Business number (subcode 2446125, also returned when pausing an existing click-to-WhatsApp ad; pause its ad set instead).
- `invalid_targeting`: Meta refused the audience or a placement (subcode 1487079, 1870247, 2909035, 1870189, 1870188, 1487756, 1487843, 2490562).
- `post_not_boostable`: Meta does not allow the post to be promoted (subcode 2446187, 2875030, 1487472), or the boosted Instagram carousel has more than 10 items, which a Meta carousel ad cannot hold.
- `budget_too_low`: the budget or the campaign spend cap is below Meta's minimum, which `platformError.error_user_msg` states (subcode 1885272, and 2446307 on `platformSpecificData.spendCap`).
- `invalid_field_value` on `imageUrl`: Meta could not download an image of the ad, which `platformError.error_user_msg` names; send a public https URL that serves the image without a login or redirect (subcode 3858258).
- `invalid_field_value` on `startDate`: an ad set that already started cannot change its start time (subcode 1487057).
- `invalid_field_value` on `platformSpecificData`: a published ad set cannot change its pixel, conversion event or optimization; create a new ad set with `POST /v1/ads/ad-sets` (subcode 3260011).
- `invalid_field_value` on `callToAction`: the button is not allowed for the objective in a dynamic creative ad set (subcode 1885396).
- `invalid_field_value` on `promotedObject.customEventType`: Meta does not offer this conversion event for the campaign's objective (subcode 2446814).
- `meta_object_not_accessible`: Meta cannot load an object the request names (wrong ID, deleted, or no access); `platformError.message` names the ID (subcode 33, on ads routes only).

**TikTok unpaid balance.** A TikTok create or boost refused because the advertiser has an outstanding payment or no valid payment method answers 422 `ad_account_payment_required` on `adAccountId`, with `details.hint` (settle the balance or add a payment method in TikTok Ads Manager). TikTok's own message stays in the message and in `platformError`.

**Private replies.** The private-reply endpoint adds:

- `privateReplyConsumed` on a 400: the comment's single reply is already spent.
- `privateReplyOutcome: "unknown"` on a 502: Meta answered a server error and the reply may have been delivered.
- `privateReplyOutcome: "not_sent"` on a 429: Instagram's rate limit refused the reply, so retry later.

**Google quota 429.** On a Google Ads or YouTube Analytics 429, `quotaExhausted: true` marks the failure as Google's own quota, not a Zernio rate limit, so you can keep calling other platforms instead of backing off everywhere. When Google names the scope, `quotaScope` is also set:

- `DEVELOPER`: the shared budget (the developer token for Google Ads, the Google Cloud project for YouTube Analytics). Every account on Zernio is affected and there is nothing to change on your side.
- `ACCOUNT`: your own ad account (Google Ads only).

A Meta 429 carries neither field.

**Zernio Google Ads burst-limit 429.** Carries `budgetScope` instead, never `quotaExhausted`. These are Zernio's own limits, applied before the call reaches Google, and both clear within a minute. They are separate axes from `quotaScope`, not the same pool named twice.

- `account`: the limit of 15 requests per minute per connected Google Ads account.
- `user`: the ceiling of 120 requests per minute per Zernio user across all their Google Ads accounts.

**Failed Meta ad create** (`POST /v1/ads/create`, `POST /v1/ads/boost`, `POST /v1/ads/ctwa`). Carries `stage` (where it failed), `adAccountId` (on which ad account) and `createdObjects` (every object this request had already created, with what cleanup did to it).

- `left_behind` objects still exist on the ad account (Meta refused the delete, typically on a held account, or the delete hit a network error). Delete them yourself or reuse them.
- `unconfirmedWrite` is set when Meta answered a create with a 5xx or a non-JSON body, or dropped the connection, and Zernio could not confirm whether the object exists. Check that parent before creating it again.

**Ineligible ad account: 422 `ad_account_unusable`.** When Meta refuses a write because the ad account's status is ineligible to manage ads (Meta subcode 2490592 or 4841021, on the write itself or on a cleanup delete), any Meta ads write answers it.

That covers create, boost, CTWA, campaign / ad set / ad updates and status changes.

The message names the ad account when known, links Meta's fix (https://www.facebook.com/business/help/422289316306981), lists the objects left behind and ends with Meta's original error, which also stays verbatim in `platformError`.

Meta often reports the first failure under an unrelated code (e.g. 1487194 on the creative), so branch on `code`, not on `platformError`.

**Missing Advertise permission: 403 `insufficient_permissions`.** When the Facebook user behind the connection's token lacks the Advertise permission on the ad account, any Meta ads write answers it.

Triggers: Meta subcode 2490585, 2490591 or 4841020 on the write, or a code 200 refusal such as 1487194 whose cleanup deletes Meta refused with 2490591 or 4841020.

Meta may still accept the campaign and ad set and refuse only the ad. The message names the ad account, asks for the Advertise or Manage permission on it (or a token granted `ads_management`, by reconnecting) and lists the objects left behind.

It ends with Meta's `error_user_title`, `error_user_msg` and subcode; the raw error stays in `platformError`.

  - **stage** `string`: Meta ad create failures only. The step that failed:

- `media`: image/video download or upload.
- `campaign`
- `adset`
- `creative`
- `ad`: the ad POST itself, where Meta's code 31 / 3858385 hold and 100 / 1359188 payment rejections land.
- `activation`: switching the created objects on. No longer returned: a refused switch to ACTIVE now answers 201 with an `activation_failed:` warning and the objects kept PAUSED.
- `other`: a read or check before any write.
 - one of: media, campaign, adset, creative, ad, activation, other
  - **adAccountId** `string`: Meta ad create failures only. The ad account the request wrote to (`act_...`).
  - **createdObjects** `array[object]`: Meta ad create failures only. Every object this request created before failing, in creation order. Objects you referenced (an existing campaign, ad set, creative or video) are never listed and never deleted.
    - **type** `string`: No description - one of: campaign, adset, creative, ad, video, image
    - **id** `string`: Meta object id; for `image` the image hash.
    - **cleanup** `string`: - `deleted`: Zernio deleted it.
- `left_behind`: cleanup could not delete it (Meta refused the delete, or the delete hit a network error), so it still exists.
- `kept`: deliberately not deleted. Either an image (hashes are shared by every upload of the same file), or an object Zernio found by name after Meta lost its answer to the create, which may belong to another request with the same name.
 - one of: deleted, left_behind, kept
  - **unconfirmedWrite** `object`: Meta ad create failures only. Set when Meta answered a create with a 5xx or a non-JSON body, or dropped the connection after the request was sent, and reading the parent back by name did not settle it. Zernio did not retry it.

One of these left it open:

- The read-back found several objects of the same name.
- The parent could not be read, or the object is a creative, which has no reliable read-back.
- The read-back found no such object, after a dropped connection, a non-JSON body, a 5xx with `retryOnServerError: false`, or a 5xx on a create whose own body is `status: ACTIVE`.

    - **type** `string`: No description - one of: campaign, adset, creative, ad
    - **parentId** `string`: Where to look for it: the ad set for an ad, the campaign for an ad set, the ad account otherwise.
  - **quotaExhausted** `boolean`: Google Ads and YouTube Analytics 429 only. True when the upstream Google quota is spent rather than a Zernio limit.
  - **quotaScope** `string`: Google Ads and YouTube Analytics 429 only, when the scope is known. DEVELOPER is the shared budget (the developer token for Google Ads, the Google Cloud project for YouTube Analytics); ACCOUNT is your ad account (Google Ads only). - one of: DEVELOPER, ACCOUNT
  - **budgetScope** `string`: Zernio Google Ads burst-limit 429 only (never set alongside `quotaExhausted`). `account` is the limit of 15 requests per minute per connected Google Ads account; `user` is the ceiling of 120 requests per minute per Zernio user across all their Google Ads accounts. Both clear within a minute. - one of: account, user

#### 429: Every request authenticated with an API key or OAuth token counts against its per-minute limit (shared by the team, or by the workspace for a workspace key). Over it, the request is refused before anything runs and can be sent again unchanged.

A few analytics reads count per second instead.

`Retry-After` gives the seconds to wait. Responses that went through the limiter carry `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` (Unix seconds) when it reported its counters, so a client can slow down before reaching the limit.

Some routes have a tighter limit of their own (polling and analytics reads): `details.scope` and `details.window` then name it. A route with its own limit for callers without a key (or for one action) answers with the standard error body instead.


**Response Body:**

*One of the following:*
- `ApiKeyRateLimitError`
- `ErrorResponse`

---


# Related Schema Definitions

## PostGetResponse

### Properties

- **post**: No description

## ErrorResponse

Canonical error envelope. `error` is the human-readable message; `type`,
`code`, `param`, `platform`, and `platformError` are top-level siblings
for programmatic handling. For upstream platform failures (`type:
platform_error`), `platformError` carries the provider's raw payload
verbatim (for Meta: `error_subcode`, `error_user_title`, `error_user_msg`).


### Properties

- **error** `string`: Human-readable error message.
- **type** `string`: Error class for programmatic handling. - one of: invalid_request_error, authentication_error, permission_error, not_found, rate_limit_error, platform_error, api_error
- **code** `string`: Stable machine-readable error code.
- **param** `string`: The request field that caused the error, when applicable.
- **docUrl** `string`: Documentation page for resolving the error, when one applies.
- **platform** `string`: Upstream platform (e.g. meta, google, tiktok), present when type is platform_error.
- **platformError** `object`: Raw error payload from the upstream platform, passed through verbatim so
integrators can read provider-specific codes. For Meta this includes
error_subcode, error_user_title, and error_user_msg.

- **provider** `string`: Email API: the mailbox provider the error came from (`google`, `microsoft`).
- **providerError** `object`: Email API: the provider's own error code and message, for support and logs. Branch on `code`, not on this.
  - **code** `string,null`: 
  - **message** `string,null`: 
- **retryable** `boolean`: Email API: whether the same request can succeed if retried (with the same `Idempotency-Key` for sends).
- **requestId** `string`: Email API: the request id, also in the `X-Request-Id` header. Quote it when you contact support.
- **docsUrl** `string`: Email API: where this `code` is documented.
- **details** `object`: Additional structured context for the error (for example field-level validation errors). What it carries depends on the endpoint and platform.

**Meta ads refusals.** The ones customers hit most come back with their own `code` instead of `platform_api_error`, the field to fix in `param`, and an English `details.hint` saying how to fix it. `details.fix` ({ label, url }) links the Meta page that resolves it, when there is one.

The code is picked from Meta's numeric `code` and `error_subcode` (and Meta's English developer `message` for the carousel case below), never from `error_user_msg`, so it is the same whatever language Meta wrote `error_user_msg` in. Branch on `code` and show `details.hint`.

The error `message` starts with that English hint. When the rest of it was only Meta's own wording, written in the ad account's language, it is dropped; a next step Zernio wrote stays after the hint. Meta's error stays whole in `platformError`.

Meta's wording is kept after the hint when the hint points to a detail only Meta gives: the minimum budget or spend cap, an image URL, a button, an object ID.

- `ad_account_payment_required`: the ad account has no usable payment method (subcode 1815010, 1359188).
- `ad_account_policy_not_accepted`: a business admin has to accept Meta's non-discrimination policy (subcode 2859002, 2859024).
- `lead_ads_terms_not_accepted`: the Facebook Page has not accepted the Lead Ads terms (subcode 1815089).
- `custom_audience_terms_not_accepted`: the ad account has not accepted Meta's Custom Audience terms, needed for customer list audiences; `details.fix` links its terms page (subcode 1870090).
- `verified_advertiser_required`: the market requires a verified beneficiary and payer; send `regionalRegulationIdentities` (subcode 3858634, 3858636, 3858442, 3858548, 3858495).
- `ad_account_unusable`: the ad account is not active, or the business is restricted from advertising (subcode 1885316, 2446325, and 2490592, 4841021 below).
- `meta_security_check_required`: the login behind the connection is held at a security check (code 31). When the connection records that login, `details.heldLogin` names it (`{ kind: "facebook_user", facebookUserId }` or `{ kind: "system_user", businessId }`) and `details.hint` says who clears it.
- `meta_action_blocked`: Meta temporarily blocked the Facebook user from this action (subcode 2859015).
- `meta_ad_consent_required`: the Page or Instagram owner chose Meta without ads or less personalized ads (subcode 3858231, 3858412).
- `instagram_account_restricted`: Meta restricted the Instagram account the ad runs as (subcode 2207070).
- `insufficient_permissions`: the ad account cannot use the Instagram account, or the Facebook user has no advertiser permission on the Page (subcode 1815199, 1815202, 1885499, 1341012, and the Advertise permission case below).
- `whatsapp_number_not_linked`: the WhatsApp number is no longer linked to the Page (subcode 2446880, 1487246), or the Page has no verified WhatsApp Business number (subcode 2446125, also returned when pausing an existing click-to-WhatsApp ad; pause its ad set instead).
- `invalid_targeting`: Meta refused the audience or a placement (subcode 1487079, 1870247, 2909035, 1870189, 1870188, 1487756, 1487843, 2490562).
- `post_not_boostable`: Meta does not allow the post to be promoted (subcode 2446187, 2875030, 1487472), or the boosted Instagram carousel has more than 10 items, which a Meta carousel ad cannot hold.
- `budget_too_low`: the budget or the campaign spend cap is below Meta's minimum, which `platformError.error_user_msg` states (subcode 1885272, and 2446307 on `platformSpecificData.spendCap`).
- `invalid_field_value` on `imageUrl`: Meta could not download an image of the ad, which `platformError.error_user_msg` names; send a public https URL that serves the image without a login or redirect (subcode 3858258).
- `invalid_field_value` on `startDate`: an ad set that already started cannot change its start time (subcode 1487057).
- `invalid_field_value` on `platformSpecificData`: a published ad set cannot change its pixel, conversion event or optimization; create a new ad set with `POST /v1/ads/ad-sets` (subcode 3260011).
- `invalid_field_value` on `callToAction`: the button is not allowed for the objective in a dynamic creative ad set (subcode 1885396).
- `invalid_field_value` on `promotedObject.customEventType`: Meta does not offer this conversion event for the campaign's objective (subcode 2446814).
- `meta_object_not_accessible`: Meta cannot load an object the request names (wrong ID, deleted, or no access); `platformError.message` names the ID (subcode 33, on ads routes only).

**TikTok unpaid balance.** A TikTok create or boost refused because the advertiser has an outstanding payment or no valid payment method answers 422 `ad_account_payment_required` on `adAccountId`, with `details.hint` (settle the balance or add a payment method in TikTok Ads Manager). TikTok's own message stays in the message and in `platformError`.

**Private replies.** The private-reply endpoint adds:

- `privateReplyConsumed` on a 400: the comment's single reply is already spent.
- `privateReplyOutcome: "unknown"` on a 502: Meta answered a server error and the reply may have been delivered.
- `privateReplyOutcome: "not_sent"` on a 429: Instagram's rate limit refused the reply, so retry later.

**Google quota 429.** On a Google Ads or YouTube Analytics 429, `quotaExhausted: true` marks the failure as Google's own quota, not a Zernio rate limit, so you can keep calling other platforms instead of backing off everywhere. When Google names the scope, `quotaScope` is also set:

- `DEVELOPER`: the shared budget (the developer token for Google Ads, the Google Cloud project for YouTube Analytics). Every account on Zernio is affected and there is nothing to change on your side.
- `ACCOUNT`: your own ad account (Google Ads only).

A Meta 429 carries neither field.

**Zernio Google Ads burst-limit 429.** Carries `budgetScope` instead, never `quotaExhausted`. These are Zernio's own limits, applied before the call reaches Google, and both clear within a minute. They are separate axes from `quotaScope`, not the same pool named twice.

- `account`: the limit of 15 requests per minute per connected Google Ads account.
- `user`: the ceiling of 120 requests per minute per Zernio user across all their Google Ads accounts.

**Failed Meta ad create** (`POST /v1/ads/create`, `POST /v1/ads/boost`, `POST /v1/ads/ctwa`). Carries `stage` (where it failed), `adAccountId` (on which ad account) and `createdObjects` (every object this request had already created, with what cleanup did to it).

- `left_behind` objects still exist on the ad account (Meta refused the delete, typically on a held account, or the delete hit a network error). Delete them yourself or reuse them.
- `unconfirmedWrite` is set when Meta answered a create with a 5xx or a non-JSON body, or dropped the connection, and Zernio could not confirm whether the object exists. Check that parent before creating it again.

**Ineligible ad account: 422 `ad_account_unusable`.** When Meta refuses a write because the ad account's status is ineligible to manage ads (Meta subcode 2490592 or 4841021, on the write itself or on a cleanup delete), any Meta ads write answers it.

That covers create, boost, CTWA, campaign / ad set / ad updates and status changes.

The message names the ad account when known, links Meta's fix (https://www.facebook.com/business/help/422289316306981), lists the objects left behind and ends with Meta's original error, which also stays verbatim in `platformError`.

Meta often reports the first failure under an unrelated code (e.g. 1487194 on the creative), so branch on `code`, not on `platformError`.

**Missing Advertise permission: 403 `insufficient_permissions`.** When the Facebook user behind the connection's token lacks the Advertise permission on the ad account, any Meta ads write answers it.

Triggers: Meta subcode 2490585, 2490591 or 4841020 on the write, or a code 200 refusal such as 1487194 whose cleanup deletes Meta refused with 2490591 or 4841020.

Meta may still accept the campaign and ad set and refuse only the ad. The message names the ad account, asks for the Advertise or Manage permission on it (or a token granted `ads_management`, by reconnecting) and lists the objects left behind.

It ends with Meta's `error_user_title`, `error_user_msg` and subcode; the raw error stays in `platformError`.

  - **stage** `string`: Meta ad create failures only. The step that failed:

- `media`: image/video download or upload.
- `campaign`
- `adset`
- `creative`
- `ad`: the ad POST itself, where Meta's code 31 / 3858385 hold and 100 / 1359188 payment rejections land.
- `activation`: switching the created objects on. No longer returned: a refused switch to ACTIVE now answers 201 with an `activation_failed:` warning and the objects kept PAUSED.
- `other`: a read or check before any write.
 - one of: media, campaign, adset, creative, ad, activation, other
  - **adAccountId** `string`: Meta ad create failures only. The ad account the request wrote to (`act_...`).
  - **createdObjects** `array`: Meta ad create failures only. Every object this request created before failing, in creation order. Objects you referenced (an existing campaign, ad set, creative or video) are never listed and never deleted.
  - **unconfirmedWrite** `object`: Meta ad create failures only. Set when Meta answered a create with a 5xx or a non-JSON body, or dropped the connection after the request was sent, and reading the parent back by name did not settle it. Zernio did not retry it.

One of these left it open:

- The read-back found several objects of the same name.
- The parent could not be read, or the object is a creative, which has no reliable read-back.
- The read-back found no such object, after a dropped connection, a non-JSON body, a 5xx with `retryOnServerError: false`, or a 5xx on a create whose own body is `status: ACTIVE`.

  - **quotaExhausted** `boolean`: Google Ads and YouTube Analytics 429 only. True when the upstream Google quota is spent rather than a Zernio limit.
  - **quotaScope** `string`: Google Ads and YouTube Analytics 429 only, when the scope is known. DEVELOPER is the shared budget (the developer token for Google Ads, the Google Cloud project for YouTube Analytics); ACCOUNT is your ad account (Google Ads only). - one of: DEVELOPER, ACCOUNT
  - **budgetScope** `string`: Zernio Google Ads burst-limit 429 only (never set alongside `quotaExhausted`). `account` is the limit of 15 requests per minute per connected Google Ads account; `user` is the ceiling of 120 requests per minute per Zernio user across all their Google Ads accounts. Both clear within a minute. - one of: account, user

## Post

### Properties

- **_id** `string`: No description
- **userId**: No description
- **title** `string,null`: Stored on the post for reference/display only. This field is NOT used as the video title when publishing. To set a YouTube video title, use platformSpecificData.title on the youtube platform target (falls back to the first line of content when omitted).
- **content** `string,null`: Null once publishing finishes when the team does not retain content.
- **contentNotRetained** `boolean`: True when this team does not retain content, so `title`, `content` and every `customContent` are null after publishing. Identifiers and metadata stay.
- **mediaItems** `array`: No description
- **platforms** `array`: No description
- **scheduledFor** `string`: No description
- **timezone** `string`: No description
- **status** `string`: `cancelled` is set by POST /v1/posts/{postId}/unpublish once every platform entry has been removed from its platform (a post with published entries left becomes `partial`); cancelled posts can be edited and rescheduled like drafts. `pending_approval` (set by `requiresApproval: true`) never publishes until POST /v1/posts/{postId}/review approves it. - one of: draft, pending_approval, scheduled, publishing, published, partial, failed, cancelled
- **tags** `array`: YouTube constraints: each tag max 100 chars, combined max 500 chars, duplicates removed.
- **hashtags** `array`: Stored for reference only. Hashtags are NOT automatically appended to the caption when publishing. Include hashtags directly in the content field (platforms like Instagram only support hashtags as caption text). For YouTube keywords, use the tags field instead.
- **mentions** `array`: Stored for reference only. Publishing does not create mentions from this field.
- **visibility** `string`: No description - one of: public, private, unlisted
- **metadata** `object`: No description
- **externalId** `string`: Your own identifier for this post, as set on create or update. Absent when unset. Not unique: filter with `GET /v1/posts?externalId=`.
- **recycling**: No description
- **recycledFromPostId** `string`: ID of the original post if this post was created via recycling
- **queuedFromProfile** `string`: Profile ID if the post was scheduled via the queue
- **queueId** `string`: Queue ID if the post was scheduled via a specific queue
- **profileId** `string`: Profile the post is filed under. Set only on drafts that have no platforms.
- **createdAt** `string`: No description
- **updatedAt** `string`: Last change to the post or to any of its platforms (a publish, a failure, a resolved URL).

## ApiKeyRateLimitError

The body of a 429 from the per-key request limit.

### Properties

- **error** (required) `string`: No description
- **details** (required) `object`: 
  - **currentCount** `integer`: Requests counted in the current window.
  - **limit** `integer`: Requests allowed in the window.
  - **retryAfterSeconds** `integer`: The same value as `Retry-After`.
  - **scope** `string`: The route limit that was reached, when it is tighter than the key limit.
  - **window** `string`: That route limit's window, for example `1 m`.

## User

### Properties

- **_id** `string`: No description
- **email** `string`: No description
- **name** `string`: No description
- **role** `string`: No description
- **disabledResourceGroups** `array`: Resource groups turned off for this team member. Empty for owners and unrestricted members.
- **createdAt** `string`: No description

## MediaItem

Media referenced in posts. URLs must be publicly reachable over HTTPS. Use POST /v1/media/presign for uploads up to 5GB. Zernio auto-compresses images and videos that exceed platform limits (videos over 200 MB may not be compressed).

### Properties

- **type** `string`: Optional when the item names a connected file (`fileId`): inferred from the file's MIME type. - one of: image, video, gif, document
- **url** `string`: A media item with a null, missing or empty url is dropped, unless it names a connected file with `fileId` + `accountId`.

A Google Drive share link is accepted here and in `thumbnail`, `instagramThumbnail`, `customMedia` and cover fields such as TikTok's `video_cover_image_url` (`drive.google.com/file/d/{id}/view`, `open?id={id}`, `uc?id={id}`, `drive.usercontent.google.com/download?id={id}`).

Zernio copies the file into its media storage when the post is created or updated and stores that copy's url, so platforms never fetch from Drive. Large files behind Drive's virus-scan page work too.

The file must be shared as "Anyone with the link". A private, deleted or unknown file, or a folder link, fails the request with a 400 (`invalid_field_value`) before anything is saved. For a private file of a connected Google account, send `fileId` + `accountId` instead.

A Drive file over 5 GB fails with a 400 (`invalid_field_value`). If Google Drive does not answer within 15 seconds, or the copy stalls for 30 seconds or runs past 4 minutes, the request fails with a 503 (`temporarily_unavailable`, `Retry-After` set) and nothing is saved, so retry it.

- **fileId** `string`: A file of a connected Google Drive or OneDrive account (see the Files endpoints). Requires `accountId`.

The file is copied into Zernio media storage when the post is created, and the item is stored as a plain `url`. A folder, an undownloadable file or an unknown id fails the request with a 4xx naming `mediaItems[i].fileId`.

- **accountId** `string`: The connected Google or Microsoft account the `fileId` belongs to (must have the `files` area). Required with `fileId`.
- **title** `string`: Optional title for the media item. Used as the document title for LinkedIn PDF/carousel posts. If omitted, falls back to the post title, then the filename.
- **altText** `string`: Accessibility alternative text for an image. Set once per image; the same value is sent to each selected platform.

- Applied on: Instagram (feed images only, not Reels/Stories), Facebook, Threads, X (max 1000 chars), LinkedIn, Bluesky, Pinterest (max 500 chars).
- Ignored on platforms without alt-text support (TikTok, YouTube, Snapchat, Telegram, Reddit, Google Business Profile, WhatsApp) and on video items where the platform does not accept it.

- **filename** `string`: No description
- **size** `integer`: Optional file size in bytes
- **mimeType** `string`: Optional MIME type (e.g. image/jpeg, video/mp4)
- **thumbnail** `string`: Optional custom thumbnail/cover image URL for videos. Supported for Facebook video posts, Facebook Reels, YouTube videos and Shorts, and LinkedIn video posts. Max 50 MB on YouTube (JPEG, PNG or GIF) and 10 MB elsewhere, JPG/PNG recommended.
- **instagramThumbnail** `string`: Custom cover image URL for Instagram Reels. Can also be set via platformSpecificData.instagramThumbnail or platformSpecificData.reelCover. Resolution order: this field > platformSpecificData.instagramThumbnail > platformSpecificData.reelCover > platformSpecificData.thumbnailUrl (legacy).
- **subtitles** `array`: Subtitle (closed caption) files for a video item, in SRT or WebVTT. Each language may appear once per video. Zernio downloads each file when the post is created or updated and converts it to the format each platform requires.

Sent to YouTube, Facebook videos, LinkedIn, X and Bluesky; ignored with a warning elsewhere. Per platform:

- YouTube: every track.
- Facebook: every track, up to 200 KB each.
- Bluesky: every track, up to 20 KB each after conversion to WebVTT.
- X: the first track only (one subtitle per video).
- LinkedIn: the first English track only.

Tracks a platform cannot take are skipped and reported in the response warnings.

A file that is unreachable, redirects, exceeds 1 MB, is not valid SRT or WebVTT, or is over a platform limit is rejected with a 400 (code INVALID_SUBTITLES). If a platform rejects a file at publish time, the post still publishes, without subtitles.

- **tiktokProcessed** `boolean`: Internal flag indicating the image was resized for TikTok

## PlatformTarget

### Properties

- **platform** `string`: Supported values: twitter, threads, instagram, youtube, facebook, linkedin, pinterest, reddit, tiktok, bluesky, googlebusiness, telegram
- **accountId**: No description
- **customContent** `string,null`: Platform-specific text override. When set, this content is used instead of the top-level post content for this platform. Useful for tailoring captions per platform (e.g. keeping tweets under 280 characters).
- **customMedia** `array`: No description
- **scheduledFor** `string`: Optional per-platform scheduled time override (uses post.scheduledFor when omitted)
- **platformSpecificData** `object`: The platform-specific options stored on this target, echoed back as sent.

Typed per platform on the way in (see the *PlatformData schemas on the request body); free-form on the way out. A response is not guaranteed to match exactly one variant, and generated clients that pick a variant by structure reject the entire response when it doesn't.

Zernio's internal publishing state (snapshots, container ids, publish stage) is never returned here. The key is omitted rather than sent as an empty object.

- **status** `string`: Platform-specific status: pending, processing, uploading, published, failed, cancelled (removed from the platform via POST /v1/posts/{postId}/unpublish). On TikTok, uploading means TikTok is still processing the post. It can last up to 48 hours and then settles on its own.
- **platformPostId** `string`: The native post ID on the platform (populated after successful publish)
- **platformPostUrl** `string,null`: Public URL of the published post. Included in the response for immediate posts; for scheduled posts, fetch via GET /v1/posts/{postId} after publish time.

Empty when the platform confirmed the publish without returning an id a permalink can be built from (TikTok returns a publish id for some uploads). The TikTok reconcile cron backfills it later. If TikTok never returns one, /v1/analytics reports that entry as syncStatus unavailable.

- **publishedAt** `string`: Timestamp when the post was published to this platform. YouTube uploads a scheduled public video up to 15 minutes early as private with YouTube's own release time, so its entry is published with this set to scheduledFor, the moment the video goes public.
- **removedFromPlatformAt** `string,null`: Set when a successfully published post later disappears from the platform (deleted on-platform or taken down by the platform). Absent while the post is live, and cleared if it reappears.

status stays "published" (it reflects the publish outcome), so poll this field to detect post-publish removals. Detection runs with the analytics sync: expect up to a few hours of lag.

- **isTrialReel** `boolean`: Present and true only when this Instagram reel was launched as a Trial through Zernio (created with platformSpecificData.trialParams). Use it to segment trial reels in analytics.

Instagram's Graph API exposes no readable trial field, so this reflects creation-time intent only: the reel STARTED as a trial, not whether or when it graduated.

- **trialGraduationStrategy** `string`: Graduation strategy the trial reel was launched with. Present only when isTrialReel is true. - one of: MANUAL, SS_PERFORMANCE
- **publishAttempts** `integer`: Number of times the publishing pipeline claimed this target to publish it since it was created or last manually retried (a manual retry resets it, except on TikTok). Not the number of retries (see publishRetries).
- **publishRetries** `integer`: Instagram only. Automatic re-sends of media_publish on the same container that Zernio scheduled after Meta answered a transient error: 30 min, 2 h and 6 h after each failure, at most 3. Absent when none was scheduled.

While the target is still processing, the latest one may not have been sent yet. Not reset by a manual retry. Independent of publishAttempts, which counts publish-leg claims.

- **errorMessage** `string`: Human-readable reason this target has not published yet, or why it failed.

- Failed entries: why the publish failed, with the platform's error details.
- Pending entries: why the publish has not gone out yet, for example the last temporary error while Zernio retries the publish automatically, or a posting limit notice.

A posting limit holds the post with the notice "This post is queued and will publish automatically after <timestamp>".

The limits are the hourly posting velocity limit and, on a TikTok account connected through the TikTok for Business app, the daily cap of 15 videos and 15 photo posts.

A held post keeps status pending and its scheduledFor moves to that timestamp. It is not failed.

A failed payment that paused publishing also holds the post (pending, not failed), with a notice that it publishes once the payment method is updated:

- It publishes within minutes of the payment clearing.
- It fails with "Publishing blocked: payment failed" when still unpaid 24 hours after its scheduled time, or when paid later than that.

- **errorCategory** `string`: Error category for programmatic handling:

- `auth_expired`: token expired/revoked
- `user_content`: wrong format/too long
- `user_abuse`: rate limits/spam
- `account_issue`: config problems
- `platform_rejected`: policy violation
- `platform_error`: 5xx/maintenance
- `platform_rate_limit`: platform throttling. Retried for a few minutes before the entry fails, except Facebook's Page anti-spam block (code 368, subcode 1390008), which fails at once. Retry a failed entry later.
- `quota_exhausted`: a shared quota pool the integration draws on is empty, including our own capacity gate in front of one. Not caused by your content or account, and safe to retry once the pool frees up.
- `system_error`: Zernio infra
- `unknown`
 - one of: auth_expired, user_content, user_abuse, account_issue, platform_rejected, platform_error, platform_rate_limit, quota_exhausted, system_error, unknown
- **errorSource** `string`: Who caused the error: user (fix content/reconnect), platform (outage/API change), system (Zernio issue, rare) - one of: user, platform, system
- **platformError**: No description

## RecyclingState

Current recycling configuration and state on a post

### Properties

- **enabled** `boolean`: Whether recycling is currently active
- **gap** `integer`: Number of interval units between reposts
- **gapFreq** `string`: Interval unit (week or month) - one of: week, month
- **startDate** `string`: No description
- **expireCount** `integer`: No description
- **expireDate** `string`: No description
- **contentVariations** `array`: Content variations for recycled copies (if configured)
- **contentVariationIndex** `integer`: Current position in the content variations rotation (read-only)
- **recycleCount** `integer`: How many recycled copies have been created so far (read-only)
- **nextRecycleAt** `string`: When the next recycled copy will be created (read-only)
- **lastRecycledAt** `string`: When the last recycled copy was created (read-only)

## MediaSubtitle

### Properties

- **url** (required) `string`: Public http(s) URL of an SRT or WebVTT file: your own host, or an upload from POST /v1/media/presign (contentType application/x-subrip or text/vtt). It must serve the file directly, since redirects are refused.
- **language** (required) `string`: BCP-47 language code with a two-letter language, e.g. en, es or pt-BR. Viewers see the track labelled with the language name, e.g. English.

## SocialAccount

### Properties

- **_id** (required) `string`: No description
- **platform** (required) `string`: No description - one of: tiktok, instagram, facebook, youtube, linkedin, twitter, threads, pinterest, reddit, bluesky, googlebusiness, telegram, snapchat, discord, slack, whatsapp, shopify, wordpress, wix, linkedinads, metaads, pinterestads, tiktokads, xads, googleads, openaiads, redditads, sms, phone, rcs, whopads, applovinads, snapchatads, taboolaads, outbrainads, criteoads, spotifyads, quoraads, nextdoorads, adrollads, klaviyo, attentive, mailchimp, customendpoint, impact, awin, google, microsoft, imap, hubspot, salesforce, webflow, googleanalytics, imessage, tiktokshop, microsoftads, line, wechat, googletagmanager, stripe, paddle, chargebee, googlesearchconsole, campaignmanager360, tradedeskads, tradedeskdsp, amazonads, gohighlevel
- **profileId** (required): No description
- **username** `string`: No description
- **displayName** `string`: No description
- **capabilities**: No description
- **platformUserId** `string`: The account's id on its platform, as the platform reports it to Zernio. Stable across reconnects, so use it to match an account against your own records.

- **Instagram Login accounts:** the app-scoped user id (the professional account id is in `metadata.instagramScopedId`).
- **Instagram via Facebook Login:** the professional account id (`17841...`).
- **TikTok:** the open_id of Zernio's TikTok app, which differs from the open_id any other app sees for the same user.
- **Google Business Profile:** `<googleUserId>:location:<locationId>`, the Google user that connected it and the selected location. The location part is empty until a location is selected.

Either value can be passed back as `expectedPlatformUserId` on GET /v1/connect/{platform}.

- **scopeAreas** `array,null`: The permission areas the connect requested: the `scopes` of GET /v1/connect/{platform}, or your OAuth app's areas. Null when the connect requested every area.
- **oauthAppId** `string,null`: The id of your own OAuth app this account connected through (see /v1/connect/oauth-apps); null when it uses Zernio's app.
- **tiktokAccountType** `string`: TikTok accounts only. The account type TikTok reported when the account was connected.

- `personal`: TikTok reported a personal account. TikTok limits Business Messaging to Business Accounts, so sends usually fail with 400 `PLATFORM_LIMITATION`; the send still goes to TikTok, which decides. The fix is switching to a Business Account in the TikTok app, then reconnecting.
- `business`: the prerequisite, not a guarantee. Messaging also needs the messaging scopes granted and TikTok's regional availability.
- `unknown`: accounts connected before this was captured, or whose grant left out the account-type scope.
 - one of: business, personal, unknown
- **profilePicture** `string,null`: URL to the account's profile picture on the platform. May be null if the platform does not provide one.
- **profileUrl** `string`: Full profile URL for the connected account on its platform.
- **isActive** (required) `boolean`: No description
- **needsReconnection** `boolean`: The platform definitively reported the stored OAuth token as dead.
While true, GET /v1/connect/{platform}/ads returns a
fresh authUrl (implicit force=true) instead of alreadyConnected,
so re-running the connect flow recovers the account. Cleared
automatically when the account is re-authorized.

- **followersCount** `number`: Follower count (only included if user has analytics access)
- **followersLastUpdated** `string`: Last time follower count was updated (only included if user has analytics access)
- **parentAccountId** `string,null`: Reference to the parent posting SocialAccount. Set for ads accounts that share
or derive from a posting account's OAuth token. null for standalone ads (Google Ads)
and all posting accounts. Meta ads business-login accounts also have no parent.

- **enabled** `boolean`: Whether the user explicitly activated this account. false means the account was created as a side effect (e.g., a posting account auto-created when the user connected ads first).

- GET /v1/accounts still returns such accounts unless `excludeHidden=true` is passed.
- They cannot be posted to (`ACCOUNT_NOT_ENABLED_FOR_POSTING`) and are not billed as connected accounts.
- On an ads account (`metaads`, `googleads`, ...) the value does not hide the connection: ads accounts are listed whatever their `enabled` value and keep working for ads.

- **metaAdsSyncEnabled** `boolean`: Facebook accounts only (absent on every other platform). Whether this Facebook account syncs the Meta ads of the ad accounts it reaches, the way a `metaads` connection does.

Off by default; set it with `PUT /v1/accounts/{accountId}`. Synced active ads count on the managed ads meter like ads from a Meta Ads connection.

- **managedByZernio** `boolean`: Present (always `true`) only on a `metaads` or `googleads` account opened with `POST /v1/connect/{platform}/zernio-managed`: an ad account by Zernio, paid from your Zernio balance. It works with every `/v1/ads` endpoint, cannot be reconnected, and is not counted as a connected account on your plan. Absent on every other account.

- **rateLimitedUntil** `string,null`: End of the account's publishing cooldown. Compare it with the current time: a value in the past means the cooldown has ended (the field is cleared on the next successful publish); null means no cooldown since the last successful publish.

**When it starts.** A post to the account fails with `errorCategory` `user_abuse` (spam, abuse or rate-limit errors), or 10 or more posts to it fail within an hour with `user_content`, `platform_error`, `platform_rate_limit` or `unknown`.

**How long.** It doubles with each start inside a 24-hour window that opens at the first one (10, 20, 40, 80 minutes and so on, capped at 24 hours).

On a YouTube account with a recorded successful upload, it instead runs until 24 hours after that upload, or 1 hour when that upload is older than 24 hours.

**Effect.** While it is in the future, POST /v1/posts (drafts excepted) and POST /v1/posts/{postId}/retry return 429 for this account. When it starts, this account's pending targets on posts scheduled before the cooldown ends are failed.

- **metadata** `object`: Platform-specific metadata. Fields vary by platform.

**WhatsApp accounts:**

- qualityRating: phone number quality rating from Meta (GREEN, YELLOW, RED, or UNKNOWN).
- nameStatus: display name review status (APPROVED, PENDING_REVIEW, DECLINED, or NONE). A declined or pending name does not by itself block sending; sendability is reported separately via health_status (can_send_message).
- messagingLimitTier: maximum unique business-initiated conversations per 24h rolling window (TIER_250, TIER_1K, TIER_10K, TIER_100K, or TIER_UNLIMITED). Scales automatically as quality rating improves.
- verifiedName: Meta-verified business display name.
- displayPhoneNumber: formatted phone number (e.g., "+1 555-123-4567").
- wabaId: WhatsApp Business Account ID.
- phoneNumberId: Meta phone number ID.

**Meta ads business-login accounts:**

- tokenType: system-user.
- businessId: the owning Business Manager ID when there is one owner; null for multiple owners.
- businessIds: owning Business Manager IDs discovered from granted ad accounts.
- grantedAdAccountIds: ad-account IDs granted to the token.
- adAccountBusinesses: map from ad-account ID to its owning business ID or null.
- availablePages: granted Page IDs and names. No Page tokens are exposed.
- selectedPageId: the Page selected for creatives and lead forms, or null.
- scopedAdAccountIds: existing sync scope preserved on reconnect.

Non-expiring tokens have no tokenExpiresAt field. Parent posting reconnects do not replace this token.

**LinkedIn accounts:** profileData carries profile details refreshed on each daily snapshot.

- profileData.bio: the member's headline (personal accounts) or the organization description (organization accounts). null when not set.
- profileData.extraData.vanityName: the member's profile slug, the /in/{vanityName} segment of profileUrl. Personal accounts only; an organization's slug is in metadata.organizationInfo.vanityName.

**Instagram accounts:**

- loginMethod: "facebook_login" when connected through Facebook Login; absent for Instagram Login. On facebook_login accounts, comment reads leave hidden comments out entirely instead of returning them with isHidden true.
- instagramScopedId: the Instagram professional account id (`17841...`). On Instagram Login accounts it is the same whichever app connected the account, while platformUserId is app-scoped. Facebook Login accounts hold this id as platformUserId.

**LINE accounts:** channelId, basicId (also in username) and webhookUrl.

**WeChat accounts:** appId (also in username and platformUserId).

**X (Twitter) accounts:**

- profileData.extraData.isPremium: whether X reports a paid subscription (Basic, Premium, Premium+, or a blue verified badge), which raises the post length limit from 280 to 25,000 characters. Read live at connect and reconnect, refreshed by the daily follower snapshot.
- Because X intermittently reports no subscription for subscribed accounts, a cancellation is stored on the fourth consecutive daily snapshot reporting it (about four days). Accounts connected before the extraData layout carry the flag at profileData.isPremium.


## PostPlatformError

The platform's own error for this target, so you can see what the platform said (access tokens are redacted). errorMessage stays the human-readable summary; this block is for diagnostics and support tickets.

**Lifecycle**: set when the last attempt failed with an error the platform described (currently Instagram and Facebook). Kept while an automatic retry of that failure is pending or running; cleared when the target publishes or is retried manually.

**Instagram**:

- Media processing failures carry no code or subcode, only Meta's status text in message.
- On a publish whose outcome is uncertain (for example errorMessage starting "Instagram did not confirm"), carries the last media_publish error Meta returned, when it returned one. errorMessage stays the verdict, so do not read this block as a confirmed failure.


### Properties

- **code** `integer`: Meta error code, when Meta sent one.
- **subcode** `integer`: Meta error_subcode, when Meta sent one.
- **message** (required) `string`: The platform's raw error message or media processing status text.

## Profile

### Properties

- **_id** `string`: No description
- **userId** `string`: No description
- **name** `string`: No description
- **description** `string`: No description
- **color** `string`: No description
- **timezone** `string,null`: IANA timezone new posts on this profile use when the request names no `timezone`. Null means UTC.
- **externalId** `string,null`: Your own identifier for this profile, set on create or update. Null when none is set.
- **contentRetention** `string`: This profile's own zero content retention setting. `none` stores identifiers and metadata only for this profile. Change it with `contentRetention` on update; only the team owner can. - one of: standard, none
- **effectiveContentRetention** `string`: The mode that applies to this profile: `none` when the profile or the whole team uses zero content retention. - one of: standard, none
- **maxOutboundCallsPerHour** `integer,null`: Most outbound calls placed from this profile's numbers in any rolling hour. Null means only the team limits apply.
- **maxDailyCallSpendUsd** `number,null`: Most billed spend, in USD, on outbound calls and calls forwarded to a phone from this profile's numbers in any rolling 24 hours. Null means only the team limits apply.
- **maxForwardedMinutesPerDay** `integer,null`: Most minutes of inbound calls forwarded to a phone from this profile's numbers in any rolling 24 hours. Null means only the team limits apply.
- **isDefault** `boolean`: No description
- **isOverLimit** `boolean`: Only present when includeOverLimit=true. Indicates if this profile exceeds the plan limit.
- **accountCount** `integer`: In the profile list. Connected accounts on the profile, including ones that need reconnecting; phone and SMS number internals and posting accounts hidden by an ads connect are not counted.
- **createdAt** `string`: No description

## EmailCapabilities

On Google, Microsoft and IMAP accounts with email access: what this mailbox provider can do, so you can branch before calling.

### Properties

- **sync** `object`: 
  - **mode** `string`:  - one of: push, poll
  - **typicalDelaySeconds** `integer`: 
- **sentItems** `object`: Outlook only: how mail sent from the user's own mail client reaches you (`message.sent`). `poll` while Microsoft will not give Zernio a Sent Items subscription for this mailbox; it switches back to `push` by itself.
  - **mode** `string`:  - one of: push, poll
  - **typicalDelaySeconds** `integer`: 
- **drafts** `object`: 
  - **supported** `boolean`: 
  - **clientEditsVisible** `boolean`: Edits the user makes in their mail client show up in the draft you read back.
  - **versioned** `boolean`: Drafts carry a `version` for `If-Match`.
- **forward** `object`: 
  - **native** `boolean`: The provider forwards itself (Outlook's createForward); otherwise Zernio builds the forward.
  - **asAttachment** `boolean`: 
- **sendAs** `object`: 
  - **list** `string`: `provider`: `GET /v1/email/send-as` lists every address the provider accepts. `partial`: shared mailboxes are not listed; declare them with `POST /v1/email/send-as`. - one of: provider, partial, declared
  - **sharedMailboxes** `boolean`: 
- **signatures** `object`: 
  - **provider** `string`: `read`: `appendSignature` falls back to the provider signature when no Zernio default exists. - one of: read, none
  - **zernio** `boolean`: Zernio-stored signatures (`/v1/email/signatures`) work on this mailbox.
- **labels** `object`: 
  - **model** `string`:  - one of: labels, categories, folders
- **bounces** `object`: 
  - **detection** `boolean`: 
- **scheduledSend** `object`: 
  - **holdAsDraft** `boolean`: 
- **tracking** `boolean`: No description