{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zernio-com/json-schema/zernio-com-ad-schema.json",
  "title": "Ad",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zernio-com-openapi.json#/components/schemas/Ad",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "platform": {
      "type": "string",
      "enum": [
        "facebook",
        "instagram",
        "tiktok",
        "linkedin",
        "pinterest",
        "google",
        "twitter",
        "openai",
        "reddit",
        "microsoft",
        "amazon"
      ]
    },
    "profileId": {
      "type": "string",
      "description": "Profile the row belongs to: the profile of its owning connection (`accountId`); when that connection no longer exists, the requested profile (`profileId` filter) that reaches the row ad account, else the profile of the oldest connection of the row owner that reaches it."
    },
    "status": {
      "allOf": [
        {
          "$ref": "#/$defs/AdStatus"
        }
      ],
      "description": "Delivery status. Derived from the platform `effective_status`, so it inherits ancestor pauses (an ACTIVE ad under a PAUSED campaign reads `paused`). For the ad's own on/off toggle use `configuredStatus`; for the review state use `reviewStatus`."
    },
    "configuredStatus": {
      "type": [
        "string",
        "null"
      ],
      "description": "The ad's own on/off switch as configured on the platform, independent of its parents. An ACTIVE ad under a paused ad set or campaign still reads ACTIVE here while `status` reads `paused`.\n\n**Sources:**\n\n- Meta: `configured_status`.\n- TikTok: ad `operation_status` (ENABLE -> ACTIVE, DISABLE -> PAUSED).\n- ChatGPT (OpenAI): ad `status` (ACTIVE / PAUSED, plus ARCHIVED on OpenAI).\n- Reddit: `configured_status` (ACTIVE / PAUSED / ARCHIVED).\n\nOn create it is read back from the platform, not copied from the request. A `PAUSED` create pauses only the top-most object it creates, so an ad under a new paused campaign or ad set reads ACTIVE with `status: paused`; only an ad attached to an existing ad set reads PAUSED.\n\nDistinct from `status`, the ancestor-cascaded delivery status. Present only for Meta, TikTok, OpenAI and Reddit ads created or synced after the field was added for that platform; null otherwise.\n"
    },
    "reviewStatus": {
      "allOf": [
        {
          "$ref": "#/$defs/AdReviewStatus"
        }
      ],
      "description": "Platform review state of this ad, independent of delivery `status` / `configuredStatus`. Absent when the platform reports no review signal. Google: from `ad_group_ad.policy_summary.approval_status`, and for a Performance Max asset group from its primary status (DISAPPROVED -> `rejected`, under review -> `in_review`, ELIGIBLE or LIMITED -> `approved`)."
    },
    "adType": {
      "type": "string",
      "enum": [
        "boost",
        "standalone"
      ]
    },
    "creativeType": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "carousel",
        "video",
        "document",
        "image",
        "text",
        null
      ],
      "description": "Creative format. Returned by `GET /v1/ads`, `GET /v1/ads/{adId}` and the ad nodes of `GET /v1/ads/tree`. `text` was added in 1.522.0, so treat unknown values as unclassified.\n\n- Google: from the ad type. Search ads (`RESPONSIVE_SEARCH_AD`, `EXPANDED_TEXT_AD`, `TEXT_AD`, `EXPANDED_DYNAMIC_SEARCH_AD`, `CALL_AD`) are `text`, video ads or any ad with a YouTube video are `video`, `DEMAND_GEN_CAROUSEL_AD` is `carousel`, other ads with images are `image`.\n- Pinterest: from `creative_type`. `VIDEO` and `MAX_VIDEO` are `video`, `CAROUSEL` is `carousel`, `REGULAR` and `SHOPPING` are `image`, others are `image` when the pin has an image.\n- X: from the tweet media. `photo` is `image`, `video` and `animated_gif` are `video`. Card and text-only tweets are `null`.\n- Other platforms: from the media the creative carries. Two or more images or cards are `carousel`.\n\n`null` when nothing classifies it: no media and no known format, or a Performance Max asset group. A Google ad not re-synced since 1.522.0 is still classified by its media until the next sync (about 3 hours).\n"
    },
    "platformCreativeType": {
      "type": "string",
      "description": "The platform's own creative or ad type, as stored by the last sync. Omitted when the platform reports none.\n\n- Google: `ad_group_ad.ad.type` (e.g. `RESPONSIVE_SEARCH_AD`, `RESPONSIVE_DISPLAY_AD`, `VIDEO_RESPONSIVE_AD`).\n- Pinterest: the ad `creative_type` (e.g. `REGULAR`, `VIDEO`, `CAROUSEL`).\n- X: the promoted tweet's media type (`photo`, `video`, `animated_gif`).\n- TikTok: `ad_format`. LinkedIn: the campaign `format`. Meta: the creative `object_type`.\n"
    },
    "goal": {
      "type": "string",
      "enum": [
        "engagement",
        "traffic",
        "awareness",
        "video_views",
        "lead_generation",
        "lead_conversion",
        "conversions",
        "app_promotion",
        "catalog_sales",
        "page_likes",
        "page_visits",
        "job_applicants"
      ],
      "description": "Available goals vary by platform:\n\n- **Meta (Facebook/Instagram):** all 11, including `lead_conversion` (website pixel lead optimization), `catalog_sales` (Advantage+ catalog ads), `page_likes` (Page Likes conversion location under Engagement) and `page_visits` (Page visits and followers under Traffic).\n- **TikTok:** engagement, traffic, awareness, video_views, lead_generation, conversions, app_promotion.\n- **LinkedIn:** all Meta goals except app_promotion / lead_conversion / catalog_sales / page_likes / page_visits.\n- **X:** engagement, traffic, awareness, video_views, app_promotion.\n- **Pinterest:** only engagement, traffic, awareness, video_views.\n- **Google Ads:** only engagement, traffic, awareness (video_views is rejected at create with 422 FEATURE_NOT_AVAILABLE)."
    },
    "isExternal": {
      "type": "boolean",
      "description": "True for ads synced from platform ad managers"
    },
    "synced": {
      "type": "boolean",
      "description": "Only on GET /v1/ads/{adId}. True when the ad comes from Zernio's synced store; false when it was read live from Meta because it is not synced yet (request made with `accountId`). An unsynced ad has no `id`."
    },
    "budget": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "amount": {
          "type": "number"
        },
        "type": {
          "type": "string",
          "enum": [
            "daily",
            "lifetime"
          ]
        },
        "daily": {
          "type": "number",
          "description": "LinkedIn and X only. The daily budget (LinkedIn: the parent campaign's `dailyBudget`; X: the line item's, or the campaign's when the line item has none). Both allow a daily AND a lifetime budget together, which `amount`/`type` cannot express (daily wins there); read `daily` and `lifetime` to see both."
        },
        "lifetime": {
          "type": "number",
          "description": "LinkedIn and X only. The lifetime total (LinkedIn: the parent campaign's `totalBudget`; X: `total_budget_amount_local_micro`, for example the `lifetimeBudgetCap` of a boost), readable even when a daily budget is also set."
        },
        "pacing": {
          "type": "string",
          "description": "LinkedIn only. The campaign's `pacingStrategy`: how fast LinkedIn may spend the budget. Typically LINEAR or ACCELERATED; the list is open."
        }
      }
    },
    "metrics": {
      "anyOf": [
        {
          "$ref": "#/$defs/AdMetrics"
        },
        {
          "type": "null"
        }
      ]
    },
    "platformAdId": {
      "type": "string"
    },
    "platformAdAccountId": {
      "type": "string"
    },
    "platformCampaignId": {
      "type": "string"
    },
    "platformAdSetId": {
      "type": "string"
    },
    "campaignName": {
      "type": "string"
    },
    "adSetName": {
      "type": "string"
    },
    "platformObjective": {
      "type": [
        "string",
        "null"
      ],
      "description": "The platform's own campaign objective, verbatim, alongside the normalized `goal` it maps to.\nThe mapping is many-to-one, so `goal` alone cannot be mapped back to it.\n\n- Meta: campaign `objective` (e.g. OUTCOME_SALES, OUTCOME_LEADS, OUTCOME_TRAFFIC).\n- LinkedIn: campaign `objectiveType` (e.g. WEBSITE_VISIT, LEAD_GENERATION, BRAND_AWARENESS,\n  VIDEO_VIEW, ENGAGEMENT, JOB_APPLICANT, WEBSITE_CONVERSION). The list is open, so treat an\n  unrecognized value as valid rather than an error.\n- TikTok and Pinterest: their raw objective_type.\n\nNull on platforms that report none, and on LinkedIn ads not yet re-synced.\n"
    },
    "optimizationGoal": {
      "type": [
        "string",
        "null"
      ],
      "description": "What the delivery system optimizes for, at ad-set level. The value space depends on `platform`:\n\n- Meta: ad set `optimization_goal` (e.g. OFFSITE_CONVERSIONS, VALUE, LEAD_GENERATION, LINK_CLICKS).\n- LinkedIn: the campaign's EFFECTIVE `optimizationTargetType`, refreshed from LinkedIn on every sync rather than echoing the create input. `NONE` means manual bidding: a real value, not missing data.\n- LinkedIn auto-bid values: MAX_IMPRESSION / MAX_CLICK / MAX_CONVERSION / MAX_VIDEO_VIEW / MAX_LEAD / MAX_REACH.\n- LinkedIn target-cost values: TARGET_COST_PER_CLICK / TARGET_COST_PER_IMPRESSION / TARGET_COST_PER_VIDEO_VIEW. Cost-cap values: the CAP_COST_AND_MAXIMIZE_* family.\n"
    },
    "costType": {
      "type": [
        "string",
        "null"
      ],
      "description": "LinkedIn only. The campaign's EFFECTIVE cost model (billing event) as applied by LinkedIn, refreshed on every sync rather than echoing what was passed on create. `null` for non-LinkedIn ads.\n\n- `CPM`: cost per thousand impressions. For campaign type SPONSORED_INMAILS, `CPM` bills as cost-per-send x 1000.\n- `CPC`: cost per click.\n- `CPV`: cost per video view.\n\nOn LinkedIn this is the axis that pairs with `bidAmount`; there is no `bidStrategy`.\n"
    },
    "servingStatuses": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "LinkedIn only. Why the parent campaign is (or is not) delivering, verbatim from LinkedIn. A campaign can report `status: ACTIVE` and still serve nothing; this array says so.\n\n- `[]`: no serving data (a non-LinkedIn ad, or a LinkedIn ad not yet re-synced).\n- `[\"RUNNABLE\"]`: the campaign is eligible to serve.\n- Anything else is a hold. Known values: ACCOUNT_SERVING_HOLD, ACCOUNT_TOTAL_BUDGET_HOLD, ACCOUNT_END_DATE_HOLD, CAMPAIGN_START_DATE_HOLD, CAMPAIGN_END_DATE_HOLD, CAMPAIGN_TOTAL_BUDGET_HOLD, CAMPAIGN_AUDIENCE_COUNT_HOLD, CAMPAIGN_GROUP_START_DATE_HOLD, CAMPAIGN_GROUP_END_DATE_HOLD, CAMPAIGN_GROUP_TOTAL_BUDGET_HOLD, CAMPAIGN_GROUP_STATUS_HOLD, STOPPED.\n\nThe list is open on purpose: treat unrecognized values as holds, not errors. End-date and total-budget holds are terminal and surface as `status: completed`; the rest surface as `status: paused`.\n\nA hold is not the only cause of zero delivery: with manual, target-cost or cost-cap bidding, a `bidAmount` of 0 stops delivery while `servingStatuses` still reads `[\"RUNNABLE\"]`. Check `costType` / `bidAmount` / `optimizationGoal` as well.\n"
    },
    "platformAdAccountName": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human-readable advertiser/account name (Meta `AdAccount.name`, TikTok\n`advertiser_name`, LinkedIn / X / Pinterest equivalents). Refreshed every\nsync so platform-side renames propagate within one cycle. `null` when the\nplatform doesn't return a name or the sync hasn't run yet.\n"
    },
    "platformCreatedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Platform-reported creation timestamp (Meta `created_time`, TikTok `create_time`). Read this field to sort or filter by when the ad was actually created on the platform.\n\nDistinct from `createdAt`, which is when Zernio first synced the doc.\n\n`null` for legacy ads synced before this field was added; aggregations then fall back to `createdAt`.\n"
    },
    "bidStrategy": {
      "anyOf": [
        {
          "$ref": "#/$defs/BidStrategy"
        },
        {
          "type": "null"
        }
      ],
      "description": "Ad-set bid strategy (overrides campaign level on Meta). Populated for Meta and\nTikTok. TikTok's native `bid_type` is normalized to the cross-platform Meta enum:\n`BID_TYPE_NO_BID` -> `LOWEST_COST_WITHOUT_CAP`, `BID_TYPE_CUSTOM` ->\n`LOWEST_COST_WITH_BID_CAP`, deep_bid_type=MIN_ROAS or roas_bid>0 ->\n`LOWEST_COST_WITH_MIN_ROAS`, `BID_TYPE_MAX_CONVERSION` -> `LOWEST_COST_WITHOUT_CAP`.\n"
    },
    "bidAmount": {
      "type": [
        "number",
        "null"
      ],
      "description": "Bid amount in WHOLE currency units of the ad account (USD: 5 = $5.00; JPY: 100 = ¥100).\n\n- Meta: `bid_amount` on the ad set (smallest-denomination int, decoded here). Populated when bidStrategy is `LOWEST_COST_WITH_BID_CAP` or `COST_CAP`; `null` for auto-bid (`LOWEST_COST_WITHOUT_CAP`).\n- TikTok: priority order `bid_price` -> `conversion_bid_price` -> `deep_cpa_bid` (whichever is set on the ad group). TikTok stores all three in whole currency units.\n- LinkedIn: the campaign's EFFECTIVE `unitCost`, refreshed on every sync rather than echoing what was passed on create. Its meaning depends on the bidding mode implied by `optimizationGoal`: bid amount (manual), target cost, or cost cap.\n- LinkedIn pairing: it pairs with `costType`, NOT with `bidStrategy`, which LinkedIn does not have. A value of `0` is a real, delivery-stopping configuration, not \"unset\", so do not gate this field on `bidStrategy` for LinkedIn ads.\n\nSource: facebook-business-sdk-codegen api_specs/specs/AdSet.json (`bid_amount`).\n"
    },
    "roasAverageFloor": {
      "type": [
        "number",
        "null"
      ],
      "description": "Minimum ROAS as a decimal multiplier (2.0 = 2.0x ROAS). Populated when bidStrategy\nis `LOWEST_COST_WITH_MIN_ROAS`.\n\n- Meta source: decoded from `bid_constraints.roas_average_floor` (Meta stores as\n  fixed-point int × 10000; we return the decimal).\n- TikTok source: `roas_bid` on the ad group (already a decimal).\n\nSource: facebook-business-sdk-codegen api_specs/specs/AdCampaignBidConstraint.json.\n"
    },
    "specialAdCategories": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Special ad categories declared when Zernio created this ad (`specialAdCategories` on POST /v1/ads/create or /v1/ads/boost), e.g. [\"HOUSING\"]. Empty or absent when none was declared or the ad was created outside Zernio."
    },
    "promotedObject": {
      "type": [
        "object",
        "null"
      ],
      "description": "Meta promoted object containing conversion event details. Structure varies by objective. Only present for Meta ads.",
      "properties": {
        "custom_event_type": {
          "type": "string",
          "description": "Conversion event type (e.g. PURCHASE, LEAD, COMPLETE_REGISTRATION, ADD_TO_CART)"
        },
        "pixel_id": {
          "type": "string",
          "description": "Meta pixel ID"
        },
        "page_id": {
          "type": "string",
          "description": "Facebook page ID"
        },
        "application_id": {
          "type": "string",
          "description": "Facebook app ID"
        },
        "product_set_id": {
          "type": "string",
          "description": "Product catalog set ID"
        }
      }
    },
    "creative": {
      "type": [
        "object",
        "null"
      ],
      "description": "Platform-specific creative data. Fields vary by platform.",
      "properties": {
        "assetGroup": {
          "$ref": "#/$defs/GooglePmaxAssetGroupInput",
          "description": "Initial Performance Max asset group input. Use the asset-groups endpoint for current Google assets."
        },
        "assetGroupResourceName": {
          "type": "string",
          "description": "Google resource name of the created Performance Max asset group."
        },
        "headlines": {
          "type": "array",
          "maxItems": 15,
          "items": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/GoogleRsaHeadline"
              }
            ]
          },
          "description": "Google RSA: the headline assets as objects (3 to 15). Meta: every title variation of the creative (`asset_feed_spec.titles`) as strings, the same shape as the `headlines` create input. Present only with 2 or more titles; a single title is `headline`."
        },
        "descriptions": {
          "type": "array",
          "maxItems": 4,
          "items": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/GoogleRsaDescription"
              }
            ]
          },
          "description": "Google RSA: the description assets as objects (2 to 4). Meta: every description variation of the creative (`asset_feed_spec.descriptions`) as strings, the same shape as the `descriptions` create input. Present only with 2 or more descriptions; a single one is `description`."
        },
        "headline": {
          "type": "string",
          "description": "Meta: the creative's title (`link_data.name`, `video_data.title`, or the first `asset_feed_spec.titles` entry). Absent when the creative has none."
        },
        "bodies": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Meta: every primary text variation of the creative (`asset_feed_spec.bodies`), the same shape as the `bodies` create input. Present only with 2 or more texts; a single text is `body`."
        },
        "description": {
          "type": "string",
          "description": "Meta: the creative's description under the title (`link_data.description`, `video_data.link_description`, or the first `asset_feed_spec.descriptions` entry)."
        },
        "callToAction": {
          "type": "string",
          "description": "Meta: the call to action type (`call_to_action.type`, or the first `asset_feed_spec.call_to_action_types` entry), e.g. LEARN_MORE or SIGN_UP. TikTok: the ad's `call_to_action`."
        },
        "identityId": {
          "type": "string",
          "description": "TikTok only, with `live=true` on GET /v1/ads/{adId}: the identity the ad runs as (`identity_id`), the same id GET /v1/ads/tiktok-identities lists."
        },
        "identityType": {
          "type": "string",
          "description": "TikTok only, with `live=true`: the identity type (`identity_type`), e.g. TT_USER, BC_AUTH_TT, CUSTOMIZED_USER or AUTH_CODE."
        },
        "identityAuthorizedBcId": {
          "type": "string",
          "description": "TikTok only, with `live=true`: the Business Center that authorized a BC_AUTH_TT identity (`identity_authorized_bc_id`)."
        },
        "tiktokItemId": {
          "type": "string",
          "description": "TikTok only, with `live=true`: the TikTok post a Spark ad runs (`tiktok_item_id`)."
        },
        "leadGenFormId": {
          "type": "string",
          "description": "Meta: the instant form the call to action opens (`call_to_action.value.lead_gen_form_id`, or the asset feed's `call_to_actions` on a dynamic creative), the same value as the `leadGenFormId` create input. Absent on ads without a lead form."
        },
        "caption": {
          "type": "string",
          "description": "Meta: the display link of a link (image) ad (`link_data.caption`). Absent when the creative has none."
        },
        "callToActionLink": {
          "type": [
            "string",
            "null"
          ],
          "description": "Meta: the `GET_DIRECTIONS` map location sent as `callToActionLink` on POST /v1/ads/create, the same value as that input. Absent on ads created without it; null once PUT /v1/ads/{adId} changed the call to action, which points the button back at `linkUrl`."
        },
        "imageHash": {
          "type": "string",
          "description": "Meta: the ad image hash (`image_hash`), reusable as `imageHash` on POST /v1/ads/create within the same ad account. `thumbnailUrl` and `mediaUrls` carry its stable full resolution permalink when Meta resolves it."
        },
        "urlTags": {
          "type": [
            "string",
            "null"
          ],
          "description": "Meta: the creative's `url_tags` query string appended to the destination URL."
        },
        "finalUrls": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "format": "uri"
          },
          "description": "Google RSA only. Replaces final URLs. Omitted lists stay unchanged."
        },
        "thumbnailUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "Primary thumbnail/image URL"
        },
        "imageUrl": {
          "type": "string",
          "description": "Alternative image URL"
        },
        "assetResourceName": {
          "type": "string",
          "description": "Google Display only. Resource name of the landscape marketing image asset (`creative.imageUrl`), for example customers/1234567890/assets/123. Set at creation and updated when PUT /v1/ads/{adId} replaces `creative.imageUrl`; replacing only `creative.squareImageUrl` leaves it unchanged."
        },
        "assets": {
          "type": "object",
          "description": "Google Display only. Native Google asset resource name of each image on the responsive display ad, keyed by Google's image role. Set at creation for ads created through Zernio. PUT /v1/ads/{adId} overwrites only the role it replaces: `creative.imageUrl` updates `marketingImages`, `creative.squareImageUrl` updates `squareMarketingImages`. Absent on ads synced from Google.",
          "properties": {
            "marketingImages": {
              "type": "array",
              "description": "Landscape (1.91:1) marketing images. The first item matches `assetResourceName`.",
              "items": {
                "type": "object",
                "properties": {
                  "resourceName": {
                    "type": "string",
                    "description": "Google asset resource name, for example customers/1234567890/assets/123."
                  }
                }
              }
            },
            "squareMarketingImages": {
              "type": "array",
              "description": "Square (1:1) marketing images.",
              "items": {
                "type": "object",
                "properties": {
                  "resourceName": {
                    "type": "string",
                    "description": "Google asset resource name, for example customers/1234567890/assets/124."
                  }
                }
              }
            }
          }
        },
        "videoId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Meta video ID for VIDEO-type ads (TikTok: the ad library `video_id`). Null for non-video ads. Callers that need an embeddable MP4 can call GET /{videoId}?fields=source with the page access token."
        },
        "videoUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "Public Facebook watch URL for VIDEO-type ads (https://www.facebook.com/watch/?v={videoId}). Null for non-video ads."
        },
        "creativeId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Meta ad creative id backing this ad, refreshed from Meta on every sync. Reusable via existingCreativeId on POST /v1/ads/create, and readable raw through GET /v1/ads/creatives/{creativeId}. Ads synced from Meta also carry it as the legacy `id` key."
        },
        "creativeFeatures": {
          "$ref": "#/$defs/MetaCreativeFeatures",
          "description": "Meta only. The creativeFeatures map sent at creation (degrees_of_freedom_spec.creative_features_spec). Absent on ads synced from Meta."
        },
        "catalog": {
          "type": "object",
          "description": "Meta catalog template ads created through Zernio only (absent on ads synced from Meta).",
          "properties": {
            "productSetId": {
              "type": "string",
              "description": "The creative's product_set_id."
            },
            "format": {
              "type": "string",
              "enum": [
                "single_image",
                "carousel_images_multi_items",
                "carousel_images_single_item",
                "carousel_slideshows"
              ],
              "description": "object_story_spec.template_data.format_option, from catalogFormat."
            },
            "formatTransformationSpec": {
              "type": "array",
              "description": "The format_transformation_spec sent on the creative, as Meta's raw objects. Present for single_image.",
              "items": {
                "type": "object",
                "properties": {
                  "format": {
                    "type": "string"
                  },
                  "data_source": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "objectType": {
          "type": "string",
          "description": "Meta creative object_type (e.g. SHARE, VIDEO, PRIVACY_CHECK_FAIL, POST_DELETED). Use this to render state-aware previews: when Meta moderation strips image/video fields, only thumbnailUrl at 64x64 is available."
        },
        "objectStoryId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Meta creative `object_story_id` (the SHARE reference). Frequently absent, because Meta omits it for SHARE creatives. Use effectiveObjectStoryId instead."
        },
        "effectiveObjectStoryId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Meta `effective_object_story_id`, the `{pageId}_{postId}` of the Facebook post the ad's engagement (comments) lives on. Pass to GET /v1/ads?effectiveObjectStoryId= to map a Business-Manager-visible post back to this ad; GET /v1/ads/{adId}/comments resolves comments against it."
        },
        "pageId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Facebook Page backing the creative (Meta only). What the `pageId` filter on /v1/ads, /v1/ads/campaigns and /v1/ads/tree matches against. Absent for non-Meta ads and rare Meta creatives with no page signal."
        },
        "effectiveInstagramMediaId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Meta `effective_instagram_media_id`, the Instagram media the ad's engagement lives on. For a boosted reel it can differ from the reel you boosted: Meta's promoted rendition, not a duplicate. Pass to GET /v1/ads?effectiveInstagramMediaId= to map a Business-Manager-visible IG post back to this ad."
        },
        "instagramUserId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Meta `instagram_user_id`, the Instagram-scoped business ID that owns the boosted media."
        },
        "instagramPermalinkUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "Meta `instagram_permalink_url`, the public Instagram post URL of the boosted media."
        },
        "mediaUrls": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "All media URLs for this ad (carousel images, multiple assets). Populated for Meta (carousel child_attachments), Google Ads (responsive display marketing_images), and LinkedIn (multi-image posts)."
        },
        "carouselCards": {
          "type": "array",
          "description": "Meta only today. The carousel's cards in display order, one per Meta `link_data.child_attachments` entry, using the same field names as the `carouselCards` create input. Absent on non-carousel ads and other platforms.\n\n- Synced from Meta: `imageUrl` is resolved exactly like `mediaUrls` (the stable `/adimages` permalink first), so cards with an image line up with `mediaUrls` in order. A card whose image Meta does not resolve keeps its place without `imageUrl`.\n- Created through Zernio: starts as the cards you sent.\n- Synced carousels stored before this field existed fill it in on their next sync.\n",
          "items": {
            "type": "object",
            "properties": {
              "imageUrl": {
                "type": "string",
                "description": "Card image, resolved like the matching `mediaUrls` entry. Absent when Meta returns no resolvable image for the card."
              },
              "imageHash": {
                "type": "string",
                "description": "Meta ad image hash of the card image (`image_hash`)."
              },
              "headline": {
                "type": "string",
                "description": "Card title (Meta `name`)."
              },
              "description": {
                "type": "string",
                "description": "Card description, under the title (Meta `description`)."
              },
              "linkUrl": {
                "type": "string",
                "description": "Card destination URL (Meta `link`)."
              },
              "callToAction": {
                "type": "string",
                "description": "Card call to action type (Meta `call_to_action.type`), e.g. SHOP_NOW or WATCH_MORE."
              },
              "videoId": {
                "type": "string",
                "description": "Meta video id when the card is a video (`video_id`)."
              }
            }
          }
        },
        "assetFeed": {
          "type": "object",
          "description": "Meta only. The media of an asset feed creative (placement or language customization, dynamic creative). Absent on other creatives.\n\nSynced ads stored before this field existed fill it in when they next change on Meta.\n",
          "properties": {
            "optimizationType": {
              "type": [
                "string",
                "null"
              ],
              "description": "Meta `optimization_type`, e.g. PLACEMENT, LANGUAGE or REGULAR (dynamic creative)."
            },
            "images": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "hash": {
                    "type": "string",
                    "description": "Meta ad image hash."
                  },
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Image URL, the stable permalink when Meta returns one."
                  }
                }
              }
            },
            "videos": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "videoId": {
                    "type": "string",
                    "description": "Meta video id."
                  },
                  "thumbnailUrl": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Video poster URL."
                  }
                }
              }
            }
          }
        },
        "isServing": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "LinkedIn only. Whether LinkedIn is currently serving this specific creative. Complements the ad-level `servingStatuses`, which describes the parent campaign."
        },
        "adFormat": {
          "type": [
            "string",
            "null"
          ],
          "description": "LinkedIn (and TikTok with `live=true`). The LinkedIn ad format, in LinkedIn's own vocabulary: STANDARD_UPDATE, SINGLE_VIDEO, CAROUSEL, NATIVE_DOCUMENT, EVENT, TEXT_AD, SPOTLIGHT, FOLLOW_COMPANY, JOBS, SPONSORED_INMAILS and others. The list is open, so treat an unrecognized value as valid.\n\n- On an ad Zernio created: the format it was created as.\n- On an ad synced from Campaign Manager: the parent campaign's raw `format`, which is what LinkedIn actually enforces on its creatives.\n\nAbsent on LinkedIn ads not yet re-synced. On TikTok with `live=true`: the ad's `ad_format` (e.g. SINGLE_VIDEO). Absent on every other platform."
        },
        "servingHoldReasons": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "LinkedIn only. Why this specific creative is not being served. Empty when it is serving.\n\nA superset of the ad-level `servingStatuses`: it repeats the inherited campaign, campaign group and account holds AND adds creative-only causes, such as:\n\n- UNDER_REVIEW, REJECTED, PROCESSING, PROCESSING_FAILED;\n- FORM_HOLD (lead-gen-form creatives);\n- REFERRED_CONTENT_QUALITY_HOLD;\n- JOB_POSTING_ON_HOLD and JOB_POSTING_INVALID (job ads).\n\nSome values are format-specific and will never appear on other ad formats. The list is open, so treat unrecognized values as holds rather than errors.\n"
        },
        "body": {
          "type": "string",
          "description": "Ad copy/text"
        },
        "googleHeadline": {
          "type": "string",
          "description": "Google Ads headline"
        },
        "googleDescription": {
          "type": "string",
          "description": "Google Ads description"
        },
        "youtubeVideoIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Google only. YouTube video ids behind a Video campaign ad (video and responsive video ads) or a Demand Gen video ad, same id as `youtubeVideoId` on Performance Max asset groups. When the ad has no image, `thumbnailUrl` is the first video's YouTube thumbnail. Absent on ads without a video."
        },
        "linkUrl": {
          "type": "string",
          "description": "Destination URL"
        },
        "whatsappPhoneNumber": {
          "type": "string",
          "description": "Explicit E.164 WhatsApp number supplied when creating a Meta boost or messaging ad. Absent when omitted by the caller or on older records."
        },
        "instagramVideoFallback": {
          "$ref": "#/$defs/InstagramVideoFallback"
        },
        "pinterestImageUrl": {
          "type": "string"
        },
        "pinterestTitle": {
          "type": "string"
        },
        "pinterestDescription": {
          "type": "string"
        }
      }
    },
    "targeting": {
      "type": "object",
      "description": "The ad set's targeting (age, gender, geo, interests, placements, audience inclusions/exclusions). May be absent if the ad set exposes no targeting or the lookup fails.\n\n- Ads created through Zernio: the spec you supplied.\n- External ads (synced from Meta Ads Manager, `isExternal: true`): targeting lives at the ad set and isn't stored at ingest. On the first `GET /v1/ads/{adId}` Zernio resolves it live from Meta and caches it on the ad.\n- External ads, value shape: Meta's raw `targeting` shape (snake_case, e.g. `geo_locations`, `age_min`), the same object Ads Manager shows.\n"
    },
    "schedule": {
      "type": [
        "object",
        "null"
      ],
      "description": "Delivery window as UTC instants. For ads created through Zernio this is the start and end the platform stored (on TikTok, read back from the ad group, whose schedule times TikTok keeps in UTC); `startDate` is the creation time only when no start was requested.",
      "properties": {
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "rejectionReason": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "AdEngagementCounts": {
      "type": "object",
      "description": "The single `engagement` total, split into the interactions behind it.\n\n`engagement` is not the sum of these: Meta's own `post_engagement` and `page_engagement` totals already contain the individual interactions, and all of them are counted into `engagement`. Use these fields for a specific interaction, and `engagement` only as the coarse total it has always been.\n\n**Platforms**: populated for Meta and, since 2026-08, TikTok (`reactions` = paid likes, `comments`, `shares`; TikTok's `follow` count lives in `actions.follow`, not here). Other platforms leave these at 0.\n\n**TikTok history**: these splits were added in 2026-08, and only the last 7 days are re-fetched on each sync (a stopped ad keeps syncing until its last delivery day is 7 days old). Days stored before the rollout keep 0s here. Spend, impressions, clicks and conversions are not affected.\n",
      "properties": {
        "postEngagement": {
          "type": "integer",
          "description": "Meta's own post-engagement total (`post_engagement`). Meta-only."
        },
        "pageEngagement": {
          "type": "integer",
          "description": "Meta's own page-engagement total (`page_engagement`). Meta-only."
        },
        "reactions": {
          "type": "integer",
          "description": "Reactions on the ad's post (`post_reaction`). For TikTok these are its paid likes."
        },
        "comments": {
          "type": "integer",
          "description": "Comments on the ad's post."
        },
        "shares": {
          "type": "integer",
          "description": "Shares of the ad's post. Meta reports these under the action type literally named `post`; TikTok under `share`."
        },
        "saves": {
          "type": "integer",
          "description": "Saves of the ad's post (`onsite_conversion.post_save`)."
        },
        "pageLikes": {
          "type": "integer",
          "description": "New Page likes attributed to the ad (`like`)."
        },
        "videoViews": {
          "type": "integer",
          "description": "Video views, from the `video_view` action. Meta counts a 3-second view; LinkedIn's own `videoViews` threshold (2 continuous seconds, or 25% of the video) lands under the same key, so compare across platforms with care. For completion-based counts use `videoThruplayWatchedActions`."
        },
        "linkClicks": {
          "type": "integer",
          "description": "Attributed link clicks (`link_click`). This is the attribution-window count, which differs from the in-session count in the sibling `inlineLinkClicks` field."
        }
      }
    },
    "AdFunnelCounts": {
      "type": "object",
      "description": "Named conversion-funnel steps, resolved from the same data as `actions` so you never have to parse action-type strings yourself.\n\nMeta reports one event under several action types at once (`offsite_conversion.fb_pixel_purchase`, `omni_purchase`, `purchase`, …). Each field takes the FIRST family member present rather than summing them, which makes these counts safe to add up. Summing the raw `actions` keys yourself double or triple counts.\n\nThe same priority order backs `conversions`, so a purchase-optimised campaign reports the identical number in `conversions` and `funnel.purchases`.\n\nEvery field is 0 when that step never fired. At ad-set and campaign level each step is summed from its per-ad values.\n\n- Meta ads: populated.\n- TikTok, from 2026-10-08: contentViews, cartAdds, checkoutsInitiated, purchases (app purchases, else website complete payments, else Place an Order) and leads. The other steps stay 0.\n- Other platforms report a different action taxonomy and generally leave these at 0 (read `actions` for those).\n",
      "properties": {
        "landingPageViews": {
          "type": "integer",
          "description": "Landing page views: the visitor actually loaded the destination, unlike a link click. Meta `landing_page_view`."
        },
        "contentViews": {
          "type": "integer",
          "description": "Content views (Meta `ViewContent` pixel event)."
        },
        "searches": {
          "type": "integer",
          "description": "On-site searches (Meta `Search` pixel event)."
        },
        "wishlistAdds": {
          "type": "integer",
          "description": "Adds to wishlist (Meta `AddToWishlist` pixel event)."
        },
        "cartAdds": {
          "type": "integer",
          "description": "Adds to cart (Meta `AddToCart` pixel event)."
        },
        "checkoutsInitiated": {
          "type": "integer",
          "description": "Checkouts started (Meta `InitiateCheckout` pixel event)."
        },
        "paymentInfoAdds": {
          "type": "integer",
          "description": "Payment details added at checkout (Meta `AddPaymentInfo` pixel event)."
        },
        "purchases": {
          "type": "integer",
          "description": "Purchases. Pair with `purchaseValue` for revenue.\n\n**Meta** reports one purchase under several action types, so this takes the FIRST present, in this order, never a sum: `offsite_conversion.fb_pixel_purchase`, `omni_purchase`, `app_custom_event.fb_mobile_purchase`, `onsite_conversion.purchase`, `purchase`.\n\nIt always counts purchases, whatever the ad set optimizes for. `conversions` instead follows the ad set's optimization event (PURCHASE when none is named), so the two can differ on any other goal.\n\n**TikTok:** app purchases (`purchase`), else website complete payments (`complete_payment`), else Place an Order (`place_order`).\n"
        },
        "leads": {
          "type": "integer",
          "description": "Leads, from either the website pixel or an instant form, whichever the ad uses."
        },
        "registrationsCompleted": {
          "type": "integer",
          "description": "Completed registrations (Meta `CompleteRegistration` pixel event)."
        },
        "appInstalls": {
          "type": "integer",
          "description": "Mobile app installs attributed to the ad."
        },
        "messagingConversationsStarted": {
          "type": "integer",
          "description": "Messaging conversations started within 7 days, the headline metric for click-to-WhatsApp and click-to-Messenger ads."
        },
        "messagingFirstReplies": {
          "type": "integer",
          "description": "Messaging threads where the person sent a first reply."
        },
        "schedules": {
          "type": "integer",
          "description": "Booked appointments (Meta `Schedule` pixel event). Pair with `spend` for cost per booked meeting.\n\n**Meta** reports Schedule in its `conversions` insight field, never in `actions`. This takes the FIRST present of `offsite_conversion.fb_pixel_schedule`, `omni_schedule`, `app_custom_event.fb_mobile_schedule`, `onsite_conversion.schedule`, `schedule`, `schedule_total`, `schedule_mobile_app`, `schedule_website`, `schedule_offline`. With none of those, a single `offsite_schedule_add_<dataset>` key counts. Two such keys (two datasets) leave it at 0, since one booking can reach both.\n\nAdded 2026-11-03. Days synced before then read 0 until re-fetched: each sync restates the last 30 days.\n"
        }
      }
    },
    "AdMetrics": {
      "type": "object",
      "properties": {
        "spend": {
          "type": "number"
        },
        "impressions": {
          "type": "integer"
        },
        "reach": {
          "type": "integer",
          "description": "Unique people reached in the requested date range.\n\n- **Meta (facebook/instagram) and TikTok:** the platform's own de-duplicated reach for the exact range, fetched live and cached up to ~1 hour (may lag recent delivery).\n- **Meta and TikTok fallback:** on a transient platform error the value temporarily falls back to a sum of per-day reach, which overcounts people reached on multiple days or by multiple child ads.\n- **Not additive (Meta and TikTok):** because reach is de-duplicated, neither daily values nor child nodes sum to the range total.\n- **LinkedIn:** the campaign's `approximateMemberReach`, de-duplicated by LinkedIn per day and summed over the range here, so it overcounts members reached on more than one day. LinkedIn withholds it below its audience privacy threshold, where it reads 0.\n- **Google, X, Pinterest and OpenAI:** 0 (reach not synced).\n\nFrequency (impressions / reach) is only meaningful for Meta and TikTok.\n"
        },
        "clicks": {
          "type": "integer"
        },
        "ctr": {
          "type": "number",
          "description": "Click-through rate (%)"
        },
        "cpc": {
          "type": "number",
          "description": "Cost per click"
        },
        "cpm": {
          "type": "number",
          "description": "Cost per 1000 impressions"
        },
        "engagement": {
          "type": "integer"
        },
        "conversions": {
          "type": "number",
          "description": "Count of conversion events over the requested date range. FRACTIONAL: attribution splits one conversion across touchpoints and Google also reports modeled conversions, so values like 0.347 are normal. 0 for non-conversion campaigns or when no events have fired.\n\n- Meta: the ad set's Ads Manager Results, derived per ad set (see below).\n- Google: the account's tracked conversions.\n- X and LinkedIn: their reported website/lead conversions (added 2026-07).\n- Reddit: key conversions (`key_conversion_total_count`, added 2026-10-23; older days read 0).\n- OpenAI: goal conversions (`conversions`, 30-day click and 1-day view attribution, added 2026-11-22; older days read 0 until re-synced).\n\nMeta uses the optimization goal's result: LEAD_GENERATION and QUALITY_LEAD = leads, CONVERSATIONS = messaging conversations started, APP_INSTALLS = installs, LANDING_PAGE_VIEWS = landing page views, LINK_CLICKS = link clicks, THRUPLAY = ThruPlays. REACH, IMPRESSIONS, POST_ENGAGEMENT and PAGE_LIKES report 0.\n\nOtherwise Meta uses the promoted_object event: custom_conversion_id when set, else custom_event_type, else PURCHASE.\n"
        },
        "allConversions": {
          "type": "number",
          "description": "All conversions, including actions excluded from the Conversions column (Google metrics.all_conversions). 0 on platforms without the concept."
        },
        "costPerConversion": {
          "type": "number",
          "description": "Derived spend / conversions in the same currency as spend. 0 when conversions is 0."
        },
        "actions": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          },
          "description": "Per-action-type counts summed over the date range, keyed by the platform's action-type names. Keys differ by platform, so branch on the ad's platform when interpreting them. Empty object when no actions are reported.\n\n- Meta: raw Insights action_type keys (link_click, offsite_conversion.fb_pixel_purchase, onsite_conversion.lead_grouped, ...), covering both engagement and conversion events.\n- Meta newer standard events (Schedule, SubmitApplication, Contact, StartTrial, Subscribe and the like) come only from Meta's `conversions` insight field, under keys such as schedule_total, schedule_website or offsite_schedule_add_<dataset>.\n- Since 2026-11-03 every `conversions` key that `actions` lacks is added here, rounded per key, and its `conversion_values` value to `actionValues`. A key both fields report keeps its `actions` value.\n- Days synced before 2026-11-03 lack those keys until re-fetched. Each sync restates the last 30 days.\n- TikTok: conversion events plus the paid-engagement family (follow, post_reaction for paid likes, comment, share). Follow is how FOLLOWERS-goal campaigns report their result.\n- TikTok website (pixel) events: complete_payment (website purchase, counted in `conversions` by SHOPPING-optimised campaigns), place_order, initiate_checkout, add_to_cart, view_content, lead (website form submissions plus TikTok instant-form leads).\n- TikTok place_order is Place an Order, the website purchase of pixels set up with the legacy ON_WEB_ORDER event. It is absent from days synced before this metric was added until the ad is re-synced.\n- TikTok app events: purchase, view_content (added to the website count).\n- TikTok history: website add_to_cart, initiate_checkout, complete_payment and lead were missing before 2026-10-08 (TikTok rejected the metric names we requested). Each sync re-fetches only the last 7 days, so older days lack them until the ad is re-synced from scratch.\n- X: conversion types (purchase, sign_up, site_visit, download, custom).\n- LinkedIn: conversion types (post_click, post_view, lead_gen) plus `video_view`. It carries LinkedIn's `videoViews` under the key every other platform uses, so it feeds `engagementBreakdown.videoViews` too. It is an engagement, NOT a conversion, and is excluded from `conversions`.\n- Google: returns {} (its per-action names aren't synced per ad).\n"
        },
        "actionValues": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          },
          "description": "Monetary mirror of `actions`, from Meta's Insights `action_values[]` array. Meta and TikTok; other platforms return {}. Same history note as `actions`.\n\nSame keying as `actions`: values are the revenue attributed to each action_type, in ad-account native currency (same unit as `spend`; see the campaign node's `currency` field). Use it to compute revenue-per-event (e.g. avg purchase value).\n\nTikTok: the value TikTok attributes to each key of `actions`, present only when the advertiser sends a value with the event. Keys: purchase and view_content from app events; complete_payment, initiate_checkout, add_to_cart, view_content and lead from the website pixel.\n\ninitiate_checkout and add_to_cart values are basket values, not revenue. Revenue is complete_payment or place_order (website) and purchase (app).\n"
        },
        "purchaseValue": {
          "type": "number",
          "description": "Convenience sum of purchase-type action values, in ad-account native currency. 0 when the campaign has no purchase event configured.\n\nMeta: picked from `actionValues` for the ad set promoted_object event (custom conversion, custom_event_type, else PURCHASE). It matches `conversions` for conversion-optimized ad sets. When the optimization goal reports a different result (LINK_CLICKS, LANDING_PAGE_VIEWS, ...) it stays on the promoted event, so ROAS keeps its purchase basis.\n\n- TikTok: app purchase value plus website complete-payment value (from 2026-10-08), or the Place an Order value when that is larger. They are never summed, since a pixel can fire both for one sale. Days synced before each was added carry the app value only until the ad is re-synced.\n- Google: `conversions_value` of every primary conversion action.\n- Pinterest: checkout value.\n- LinkedIn: `conversionValueInLocalCurrency`, the advertiser-defined value of every conversion (days synced before 2026-10-23 report 0).\n- Reddit: `conversion_purchase_total_value` (same history note).\n- OpenAI: `order_created_attributed_sales`, the value of attributed `order_created` events (days synced before 2026-11-22 report 0).\n- Other platforms report 0.\n"
        },
        "roas": {
          "type": "number",
          "description": "Return on ad spend, derived as `purchaseValue / spend`. 0 when `spend` is 0. Equivalent to Meta's `purchase_roas` under default attribution. At ad-set and campaign levels this is recomputed from summed purchaseValue + spend (NOT averaged across children) so it's mathematically correct at every rollup level."
        },
        "costPerAction": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          },
          "description": "Derived `spend / actions[type]` for every action type with a non-zero count, in ad-account native currency. Same keys as `actions`.\n\n- Rounded to 4 decimals, because cheap actions cost well under a cent.\n- Recomputed from summed spend + counts at every rollup level.\n- Empty object when spend is 0 or no actions are reported.\n"
        },
        "outboundClicks": {
          "type": "integer",
          "description": "Clicks leading off Meta's surfaces to the advertiser's destination. Meta-only; other platforms report 0."
        },
        "outboundClicksCtr": {
          "type": "number",
          "description": "Derived `outboundClicks / impressions * 100`, recomputed from sums at every rollup level."
        },
        "inlineLinkClicks": {
          "type": "integer",
          "description": "In-session link clicks. Differs from the attributed `link_click` count in `actions`/`engagementBreakdown.linkClicks`, which uses the attribution window. Meta-only."
        },
        "inlineLinkClickCtr": {
          "type": "number",
          "description": "Derived `inlineLinkClicks / impressions * 100`, recomputed from sums at every rollup level."
        },
        "uniqueClicks": {
          "type": "integer",
          "description": "People who clicked at least once. NOT additive: summed across days/children it overcounts people who clicked on multiple days or ads, so treat rollups as an upper bound (same caveat as `reach`). Meta-only."
        },
        "uniqueCtr": {
          "type": "number",
          "description": "Derived `uniqueClicks / impressions * 100` (NOT Meta's reach-based unique_ctr). Inherits the non-additivity caveat of `uniqueClicks`."
        },
        "videoPlayActions": {
          "type": "integer",
          "description": "Number of times the video started playing, summed over the date range and across children at ad-set/campaign level. 0 for non-video ads.\n\nSources: Meta `video_play_actions`, TikTok `video_play_actions`, X `video_content_starts`, Reddit `video_started`, Pinterest `TOTAL_VIDEO_P0_COMBINED`.\n\n**X, Reddit and Pinterest history**: added 2026-10-23, and their syncs only re-fetch recent days, so older days read 0 on every X, Reddit and Pinterest video field.\n"
        },
        "video30SecWatchedActions": {
          "type": "integer",
          "description": "Views of at least 30 seconds (or to the end, for shorter videos). Sources: Meta `video_30_sec_watched_actions`, Google `video_trueview_views` (a TrueView view: 30 seconds, the whole video if shorter, or an interaction; Google history note: added 2026-10-23, older days read 0)."
        },
        "videoThruplayWatchedActions": {
          "type": "integer",
          "description": "ThruPlays (watched to completion, or at least 15 seconds). Sources: Meta `video_thruplay_watched_actions` (Meta only)."
        },
        "videoP25WatchedActions": {
          "type": "integer",
          "description": "Views reaching 25% of the video's length. With the other percentile fields, powers hook/hold/drop-off analysis (e.g. hook rate = videoP25WatchedActions / videoPlayActions). Sources: Meta `video_p25_watched_actions`, TikTok `video_views_p25`, X `video_views_25`, Reddit `video_watched_25_percent`, Google `video_quartile_p25_rate` x impressions, Pinterest `TOTAL_VIDEO_P25_COMBINED`."
        },
        "videoP50WatchedActions": {
          "type": "integer",
          "description": "Views reaching 50% of the video's length. Sources: Meta `video_p50_watched_actions`, TikTok `video_views_p50`, X `video_views_50`, Reddit `video_watched_50_percent`, Google `video_quartile_p50_rate` x impressions, Pinterest `TOTAL_VIDEO_P50_COMBINED`."
        },
        "videoP75WatchedActions": {
          "type": "integer",
          "description": "Views reaching 75% of the video's length. Sources: Meta `video_p75_watched_actions`, TikTok `video_views_p75`, X `video_views_75`, Reddit `video_watched_75_percent`, Google `video_quartile_p75_rate` x impressions, Pinterest `TOTAL_VIDEO_P75_COMBINED`."
        },
        "videoP95WatchedActions": {
          "type": "integer",
          "description": "Views reaching 95% of the video's length. Sources: Meta `video_p95_watched_actions`, Pinterest `TOTAL_VIDEO_P95_COMBINED`."
        },
        "videoP100WatchedActions": {
          "type": "integer",
          "description": "Views reaching 100% of the video's length. Sources: Meta `video_p100_watched_actions`, TikTok `video_views_p100`, X `video_views_100`, Reddit `video_watched_100_percent`, Google `video_quartile_p100_rate` x impressions, Pinterest `TOTAL_VIDEO_P100_COMPLETE`."
        },
        "video2SecWatchedActions": {
          "type": "integer",
          "description": "Plays of at least 2 seconds, replays excluded. Hook rate = video2SecWatchedActions / impressions. Sources: TikTok `video_watched_2s` (TikTok only; Meta's closest field, 2-second continuous plays, is not synced). TikTok history note: added 2026-10, and each sync re-fetches only the last 7 days, so older days read 0."
        },
        "video6SecWatchedActions": {
          "type": "integer",
          "description": "Plays of at least 6 seconds, replays excluded. Hold rate = video6SecWatchedActions / video2SecWatchedActions. Sources: TikTok `video_watched_6s` (TikTok only). Same history note as `video2SecWatchedActions`."
        },
        "video6SecFocusedViews": {
          "type": "integer",
          "description": "TikTok's 6-second focused views: plays of at least 6 seconds (or to the end, for shorter videos) or with an interaction in the first 6 seconds, so it is at least `video6SecWatchedActions`. Sources: TikTok `engaged_view` (TikTok only). Same history note as `video2SecWatchedActions`."
        },
        "videoAvgTimeWatchedActions": {
          "type": "number",
          "description": "Average seconds watched per play. Aggregated over date ranges and across children as a play-weighted average (total watch time / total plays), never a plain average of averages. Sources: Meta `video_avg_time_watched_actions`, TikTok `average_video_play`."
        },
        "costPerThruplay": {
          "type": "number",
          "description": "Derived `spend / videoThruplayWatchedActions`, in ad-account native currency. Rounded to 4 decimals rather than the usual 2 because a ThruPlay routinely costs well under a cent. 0 when the ad has no ThruPlays (ThruPlay is Meta-only)."
        },
        "funnel": {
          "$ref": "#/$defs/AdFunnelCounts"
        },
        "engagementBreakdown": {
          "$ref": "#/$defs/AdEngagementCounts"
        },
        "lastSyncedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Present on individual ads only, not on campaign aggregations"
        }
      }
    },
    "AdReviewStatus": {
      "type": "string",
      "enum": [
        "in_review",
        "approved",
        "rejected",
        "with_issues"
      ],
      "description": "Platform-side review state, independent of the delivery `status` and the `configuredStatus` on/off toggle. `in_review` means the platform is still reviewing. Absent when the platform reports no review signal (e.g. a paused ad whose review state is masked behind the pause)."
    },
    "AdStatus": {
      "type": "string",
      "enum": [
        "active",
        "paused",
        "pending_review",
        "rejected",
        "completed",
        "cancelled",
        "error"
      ]
    },
    "BidStrategy": {
      "type": "string",
      "enum": [
        "LOWEST_COST_WITHOUT_CAP",
        "LOWEST_COST_WITH_BID_CAP",
        "COST_CAP",
        "LOWEST_COST_WITH_MIN_ROAS"
      ],
      "description": "Meta bid strategy. Same enum applies at campaign and ad-set level; ad-set value (when set)\noverrides campaign-level. Cross-field rules:\n  - `LOWEST_COST_WITHOUT_CAP` (default): auto-bid, forbids `bidAmount` and `roasAverageFloor`.\n  - `LOWEST_COST_WITH_BID_CAP` / `COST_CAP`: require `bidAmount` (whole currency units).\n  - `LOWEST_COST_WITH_MIN_ROAS`: requires `roasAverageFloor` (decimal multiplier, 2.0 = 2.0x).\nSource: facebook-business-sdk-codegen api_specs/specs/enum_types.json (`AdSet_bid_strategy`,\n`Campaign_bid_strategy`).\n"
    },
    "GooglePmaxAssetGroupInput": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "finalUrl",
        "headlines",
        "longHeadline",
        "descriptions",
        "businessName",
        "images"
      ],
      "description": "Google Performance Max creative assets. At least one description must be 60 characters or fewer. Texts within each list must be distinct.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "description": "Defaults to the request name."
        },
        "finalUrl": {
          "type": "string",
          "format": "uri",
          "pattern": "^https?://",
          "description": "Required destination URL."
        },
        "headlines": {
          "type": "array",
          "minItems": 3,
          "maxItems": 15,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 30
          }
        },
        "longHeadline": {
          "type": "string",
          "minLength": 1,
          "maxLength": 90
        },
        "descriptions": {
          "type": "array",
          "minItems": 2,
          "maxItems": 5,
          "uniqueItems": true,
          "description": "At least one description must be 60 characters or fewer.",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 90
          }
        },
        "businessName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 25
        },
        "images": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "landscape",
            "square",
            "logo"
          ],
          "description": "Public HTTP(S) image URLs. GIF, JPEG or PNG, at most 5120 KB per image. Google validates dimensions and aspect ratios.",
          "properties": {
            "landscape": {
              "type": "array",
              "minItems": 1,
              "maxItems": 20,
              "description": "Landscape marketing images. Aspect ratio 1.91:1, minimum 600 x 314 pixels.",
              "items": {
                "type": "string",
                "format": "uri",
                "pattern": "^https?://"
              }
            },
            "square": {
              "type": "array",
              "minItems": 1,
              "maxItems": 20,
              "description": "Square marketing images. Aspect ratio 1:1, minimum 300 x 300 pixels.",
              "items": {
                "type": "string",
                "format": "uri",
                "pattern": "^https?://"
              }
            },
            "logo": {
              "type": "array",
              "minItems": 1,
              "maxItems": 5,
              "description": "Required square logos. Aspect ratio 1:1, minimum 128 x 128 pixels.",
              "items": {
                "type": "string",
                "format": "uri",
                "pattern": "^https?://"
              }
            }
          }
        },
        "youtubeVideoId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{11}$",
          "description": "Optional existing YouTube video id. Google can generate video when omitted. Video uploads and arbitrary video URLs are not supported."
        }
      }
    },
    "GoogleRsaDescription": {
      "type": "object",
      "required": [
        "text"
      ],
      "properties": {
        "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 90
        },
        "pinnedField": {
          "type": "string",
          "enum": [
            "DESCRIPTION_1",
            "DESCRIPTION_2"
          ],
          "description": "Optional fixed description position. Omit to leave the asset unpinned."
        }
      }
    },
    "GoogleRsaHeadline": {
      "type": "object",
      "required": [
        "text"
      ],
      "properties": {
        "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 30
        },
        "pinnedField": {
          "type": "string",
          "enum": [
            "HEADLINE_1",
            "HEADLINE_2",
            "HEADLINE_3"
          ],
          "description": "Optional fixed headline position. Omit to leave the asset unpinned."
        }
      }
    },
    "InstagramVideoFallback": {
      "type": "object",
      "description": "Meta only. Present when Meta refused an existing Instagram video as the boosted ad (code 100, subcode 1815279: upload it to Facebook first) and Zernio created the ad another way:\n\n- `instagram_video_reuploaded`: the video was copied into the ad account, and the ad still references the original post.\n- `instagram_video_rehosted_copy`: the video was uploaded as a new Facebook video in a new Page post, so the ad does not show the original post's likes and comments.\n\nSend `rehostOnInstagramVideoRejection: false` on the boost to get Meta's error instead.\n",
      "required": [
        "kind",
        "linkedToOriginalPost",
        "videoId",
        "platformError"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "instagram_video_reuploaded",
            "instagram_video_rehosted_copy"
          ]
        },
        "linkedToOriginalPost": {
          "type": "boolean",
          "description": "True when the ad still references the original Instagram post and keeps its engagement. The ad's creative may still report an effective_instagram_media_id and permalink different from the boosted media: Instagram's boosted rendition of the same post, which shares its likes and comments."
        },
        "videoId": {
          "type": "string",
          "description": "The Facebook-side ad video Zernio made.\n\n- instagram_video_reuploaded: the copy in the ad account video library (possibly one made by an earlier boost of the same media, reused). The creative carries it as video_id, unless Meta accepted the plain post reference once the copy existed; then the copy is kept for that reference.\n- instagram_video_rehosted_copy: the new upload the creative uses (an unused copy made by this request is deleted)."
        },
        "platformError": {
          "type": "object",
          "description": "Meta's original refusal.",
          "required": [
            "message"
          ],
          "properties": {
            "code": {
              "type": "integer"
            },
            "subcode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            },
            "fbtraceId": {
              "type": "string"
            }
          }
        }
      }
    },
    "MetaCreativeFeatures": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "enum": [
          "OPT_IN",
          "OPT_OUT"
        ]
      },
      "propertyNames": {
        "pattern": "^[a-z0-9_]+$"
      },
      "description": "Meta Advantage+ creative enhancements. Map snake_case feature names to OPT_IN or OPT_OUT; Meta validates supported keys. On creation Zernio sends only the keys you name, so Meta's default applies to the rest; on PUT /v1/ads/{adId} omitted keys keep the creative's current value. Send OPT_OUT to switch an enhancement off.\n\nauto_promotion_tag is an Advantage+ enhancement, not the Ads Manager Promotion setting. The deprecated standard_enhancements bundle (subcode 3858504) is a 400 before any Meta call.\n"
    }
  }
}