Zernio · Schema

CtwaAdRequestBody

Besides the `required` list, the request must use EXACTLY ONE of these shapes: - Single-creative: `headline`, `body`, and one of `imageUrl` / `video`, OR `platformPostId` / `objectStoryId` to reuse an organic post. On POST /v1/ads/messaging, `placementAssets` can replace `imageUrl` / `video`. - Carousel (messaging and CTWA): `body` and `carouselCards` (2-10 image or video cards) instead of `imageUrl` / `video`, top level or per `creatives[]` entry. - Multi-creative: a non-empty `creatives[]` array. Top-level creative fields must NOT be set on this shape. **Existing post references** work on messaging and CTWA only (not call ads). They cannot be combined with each other or with headline, body, imageUrl or video. `welcomeMessage` works on them (it lives on the ad, not the post). No media is uploaded and the organic post is retained. Fresh creatives still require headline, body, and image or video. The route enforces this at the Zod boundary; OpenAPI's `required` cannot express the OR cleanly. **Campaign, ad set and targeting fields** match POST /v1/ads/create on Meta and run through the same builders: - the full targeting set (including `rawTargeting`, `languages`, `gender`, exclusions and `savedTargetingId`); - `budgetLevel` (campaign budget); - `startDate` / `endDate` in the ad account timezone; - `existingCampaignId` to add a new ad set to a campaign you already have.

Marketing InfrastructureSocial Media APIAdvertising APICommunication APICreator ToolsAgent Platforms

Properties

Name Type Description
stage boolean Send true to store this write as a staged change instead of applying it. The response is `202` with the change, and POST /v1/ads/changes/{changeId}/confirm applies it later. Cannot be combined with `v
retryOnServerError boolean When Meta answers a create with a 5xx and reading the parent back by name finds no such object, Zernio sends the create again (at most 3 POSTs per object, never for an object created ACTIVE) and repor
creativeFeatures object Meta enhancement settings for single or attached ads, and defaults for creatives[]. An item replaces the entire map, including with an empty object.
tracking object
accountId string Facebook or Instagram SocialAccount ID.
adAccountId string Meta ad account ID, e.g. `act_123456789`.
name string Ad display name. Used to derive campaign / ad set names. On the multi-creative shape, each ad's Meta name gets a " #N" suffix (1-indexed) so Ads Manager shows them as a numbered batch.
campaignName string Exact name for the campaign this request provisions. Omitted keeps ` - Campaign`. Ignored with `adSetId` (the ad set already has a campaign).
adSetName string Exact name for the ad set this request provisions. Omitted keeps ` - Ad Set`. Ignored with `adSetId`.
platformPostId string Messaging and CTWA only. Platform post or reel ID, the same input boostPost takes as platformPostId. Mutually exclusive with objectStoryId and fresh creative fields. - Facebook IDs become object_story
existingPostId string Alias of platformPostId, kept for existing callers. Sending both with different values is a 400.
objectStoryId string Messaging and CTWA only. Raw Facebook pageId_postId reference, used as object_story_id even with an Instagram account. Mutually exclusive with platformPostId and fresh creative fields.
pageId string Facebook Page the ad runs as, when the connection was granted several Pages. Defaults to the Page bound to the connection. Any Page granted to the connection is accepted; other ids answer 400 listing
whatsappPhoneNumber string WhatsApp only. Optional E.164 number already paired with the Facebook Page. Omit to let Meta select the paired number. - Sent to the creative CTA and, when creating a new ad set, its promoted_object.
headline string Single-creative shape only. Mutually exclusive with `creatives[]`. Required on a single image or video ad (including one built with `placementAssets`); not used by a `carouselCards` ad and not accepte
body string Primary text shown above the image / video. Single-creative shape only. Mutually exclusive with `creatives[]`.
description string Link description, independent of `headline` and `body`: Meta's `link_data.description`, `video_data.link_description` on video, and the shared description of a `placementAssets` feed. Meta shows it ma
imageUrl string Image asset for single-creative shape. Mutually exclusive with `video` and with `creatives[]`. Required on the single-creative shape if neither `video` nor an existing post reference is supplied.
video object Video creative for single-creative shape. Mutually exclusive with `imageUrl` and with `creatives[]`. Required on the single-creative shape if neither `imageUrl` nor an existing post reference is suppl
welcomeMessage object Custom chat welcome message (Meta's `page_welcome_message`, "Mensaje de bienvenida" / "Mensaje predefinido" in Ads Manager). Single-creative shape only; for `creatives[]` set it per entry.
carouselCards array Messaging and CTWA only (a 400 on POST /v1/ads/call). A hand-built carousel of 2-10 image or video cards, sent to Meta in the given order as `link_data.child_attachments`. - Meta may reorder cards for
optimizeCardOrder boolean Only with `carouselCards` (a 400 without them). Single-creative shape; for `creatives[]` set it per entry. Sets the creative's `link_data.multi_share_optimized`. - `false`: keeps the cards in the orde
creatives array Multi-creative shape: N CTWA ads under one campaign + one ad set, sharing budget and targeting. Fresh and existing creatives can be mixed. Each entry supplies headline, body, and image/video, or a pla
adSetId string Attaches the creatives to this EXISTING messaging ad set instead of building a campaign, so the ad set keeps its learning phase. Its `destination_type` must match the ad's destination. The ad set then
existingCampaignId string Creates the new messaging ad set (and its ads) under this EXISTING Meta campaign instead of a new one, e.g. several audience ad sets under one campaign. To add ads to an existing ad set instead, use `
budgetLevel string Where the budget lives. `adset` (default) puts it on the new ad set. `campaign` creates an Advantage campaign budget (CBO): the budget and bid strategy sit on the campaign and the ad set inherits them
budgetAmount number Budget amount in the ad account's currency major units (e.g. dollars for USD, not cents). Must be > 0. Required unless `adSetId` is set (the ad set owns it) or `existingCampaignId` names a campaign wi
budgetType string Required unless `adSetId` is set or `existingCampaignId` names a campaign with a campaign budget. `lifetime` requires `endDate`.
currency string ISO 4217 currency code matching the ad account's currency (e.g. `USD`). Optional: Zernio resolves it from the ad account when omitted. The value selects the minor-unit exponent Zernio converts budget/
startDate string When the ad set starts delivering. ISO 8601 date or date-time. A value with an offset (`2027-01-15T10:00:00+01:00`, `...Z`) is used as is; one without an offset (`2027-01-15T10:00:00`) is read in the
endDate string ISO 8601 date or date-time, read like `startDate`; a date-only value ends at 23:59:59 local. Required when `budgetType` is `lifetime`.
countries array ISO 3166-1 alpha-2 country codes. Defaults to `["US"]` only when no other geo (`cities`, `regions`, `zips`, `metros`, `customLocations`) is supplied.
cities array City-level geo targeting for local CTWA campaigns. Each entry maps to Meta's TargetingGeoLocationCity; `key` is Meta's city ID. `radius` and `distance_unit` are coupled: set both or neither. Meta enfo
regions array Region / state-level geo targeting. `key` is Meta's region ID (lookupable via GET /v1/ads/targeting/search?type=region).
zips array ZIP / postal-code geo targeting. `key` is the platform's postal id resolved via /v1/ads/targeting/search.
metros array DMA / metro-area geo targeting. `key` is Meta's metro id (e.g. `DMA:807`).
countryGroups array Meta only. Continents and trade blocs (`geo_locations.country_groups`), for targeting a whole region without listing its countries. Combines with `countries` rather than replacing it, and is also acce
customLocations array Point-radius geo (Meta `geo_locations.custom_locations`). Use for targeting a radius around a specific lat/long when no Meta city/region key fits. `distanceUnit` is required.
ageMin integer
ageMax integer
interests array
audienceId string Custom audience ID to target.
placements object Manual ad placements on the shared ad set. Omit for automatic placements. When set, restricts delivery to the chosen surfaces, mapped onto the ad set's `targeting.{publisher_platforms, facebook_positi
gender string Restrict the audience by gender (Meta `genders`). Omit or send all for everyone; all is ignored in adSetId attach mode. Stored on the ad and read back in `targeting.gender`.
languages array Audience languages (Meta `locales`). A bare ISO 639-1 code targets all regional variants ("en" = all English), a region-qualified code a specific one ("en_GB", "pt_BR"). Meta numeric locale ids (e.g.
places array Meta place keys (from GET /v1/ads/targeting/search).
neighborhoods array Meta neighborhood keys (from GET /v1/ads/targeting/search).
excludedLocations object Geo to exclude, same shape as POST /v1/ads/create (countries, countryGroups, regions, cities, zips, places, neighborhoods, customLocations).
behaviors array Behavior ids from /v1/ads/targeting/search?dimension=behavior. Meta: each dimension is its own flexible_spec entry (OR within, AND across). TikTok: video/creator interaction categories, sent as the ad
workPositions array
workEmployers array
workIndustries array
incomeTier string Normalized household-income tier, same as POST /v1/ads/create. Incompatible with housing, employment and credit specialAdCategories.
userOs array Meta `user_os`, e.g. ["iOS_ver_14.0_and_above"].
userDevice array Meta `user_device`.
audienceInclude array Custom or lookalike audience ids to include.
audienceExclude array Custom or lookalike audience ids to exclude.
savedTargetingId string ID of a saved_targeting audience (POST /v1/ads/audiences), expanded as the base targeting. Precedence: savedTargetingId, then `targeting`, then the flat fields.
targeting object Nested targeting object, same contract as POST /v1/ads/create and boost. Flat fields win per key.
rawTargeting object Meta targeting spec sent as the BASE layer of the ad set's `targeting`, exactly as POST /v1/ads/create does. Use it for anything the flat fields cannot express, such as a layered `flexible_spec` (entr
metaSavedAudienceId string The id of a Meta saved audience on `adAccountId` (made in Ads Manager, listed by `GET /v1/ads/saved-audiences`). Its targeting is read live from Meta and used as `rawTargeting` for the new ad set, so
specialAdCategories array Meta special ad categories on the new campaign.
specialAdCategoryCountry array Countries the special ad category applies to. Requires specialAdCategories.
advantageAudience object Meta's Advantage+ audience expansion. `0` or `false` (default) keeps targeting strict; `1` or `true` lets Meta expand beyond the supplied targeting when its delivery system finds better matches. Boole
objective string Defaults to `OUTCOME_ENGAGEMENT` on POST /v1/ads/ctwa and POST /v1/ads/messaging, and to `OUTCOME_LEADS` on POST /v1/ads/call and on POST /v1/ads/messaging with `optimizationGoal: LEAD_GENERATION` (wh
status string Defaults to `ACTIVE`. `PAUSED` pauses only the top-most object this call creates: the new campaign (ad set and ads switched on), or, with `adSetId`, the new ads themselves.
campaignStatus string Campaign-level status, same semantics as `POST /v1/ads/create`. Defaults to `status`. - `PAUSED`: holds the new campaign off while the ad set and ads switch on (one resume call brings the whole hierar
adSetStatus string Ad-set-level status, same semantics as `POST /v1/ads/create`. Sets the new ad set's switch alone and overrides `status` for it. A level status (`campaignStatus`, `adSetStatus`, `adStatus`) always wins
adStatus object Ad-level status, same semantics as `POST /v1/ads/create`. Sets the new ads' switch and overrides `status` for them, also with `adSetId`. Send `campaignStatus`, `adSetStatus` and `adStatus` all PAUSED
bidStrategy string Meta bid strategy applied to the shared ad set. Defaults to `LOWEST_COST_WITHOUT_CAP` (auto-bid) when omitted. `LOWEST_COST_WITH_BID_CAP` and `COST_CAP` require `bidAmount`. `LOWEST_COST_WITH_MIN_ROAS
bidAmount number Whole currency units (e.g. `5` = $5.00 on a USD account). Required when `bidStrategy` is `LOWEST_COST_WITH_BID_CAP` or `COST_CAP`; rejected otherwise.
roasAverageFloor number Decimal ROAS multiplier (e.g. `2.0` = 2.0× ROAS floor). Required when `bidStrategy` is `LOWEST_COST_WITH_MIN_ROAS`; rejected otherwise. Meta enforces its own upper bound server-side.
dsaBeneficiary string Legal entity that benefits from the ad. Required when targeting EU users (EU DSA, Article 26). Optional if the ad account has a default beneficiary: set it once via `PATCH /v1/ads/accounts` or in Meta
dsaPayor string Legal entity that pays for the ad. Can differ from `dsaBeneficiary` (for example, an agency paying for a client's ads). Same rules as `dsaBeneficiary`: required for EU targeting unless the ad account
regionalRegulatedCategories array Meta only. Regional regulation categories required when the ad set targets certain countries (e.g. AUSTRALIA_FINSERV, AUSTRALIA_UNIVERSAL, BRAZIL_REGULATION, INDIA_FINSERV, MALAYSIA_UNIVERSAL, SINGAPO
regionalRegulationIdentities object Meta only. Verified identity IDs of the beneficiary and payer for each declared regionalRegulatedCategories value. Ignored when adSetId adds the ad to an existing ad set. Meta may require them on API-
View JSON Schema on GitHub

JSON Schema

zernio-com-ctwa-ad-request-body-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zernio-com/json-schema/zernio-com-ctwa-ad-request-body-schema.json",
  "title": "CtwaAdRequestBody",
  "description": "Besides the `required` list, the request must use EXACTLY ONE of these shapes:\n\n- Single-creative: `headline`, `body`, and one of `imageUrl` / `video`, OR `platformPostId` / `objectStoryId` to reuse an organic post. On POST /v1/ads/messaging, `placementAssets` can replace `imageUrl` / `video`.\n- Carousel (messaging and CTWA): `body` and `carouselCards` (2-10 image or video cards) instead of `imageUrl` / `video`, top level or per `creatives[]` entry.\n- Multi-creative: a non-empty `creatives[]` array. Top-level creative fields must NOT be set on this shape.\n\n**Existing post references** work on messaging and CTWA only (not call ads). They cannot be combined with each other or with headline, body, imageUrl or video. `welcomeMessage` works on them (it lives on the ad, not the post).\n\nNo media is uploaded and the organic post is retained. Fresh creatives still require headline, body, and image or video.\n\nThe route enforces this at the Zod boundary; OpenAPI's `required` cannot express the OR cleanly.\n\n**Campaign, ad set and targeting fields** match POST /v1/ads/create on Meta and run through the same builders:\n\n- the full targeting set (including `rawTargeting`, `languages`, `gender`, exclusions and `savedTargetingId`);\n- `budgetLevel` (campaign budget);\n- `startDate` / `endDate` in the ad account timezone;\n- `existingCampaignId` to add a new ad set to a campaign you already have.\n",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zernio-com-openapi.json#/components/schemas/CtwaAdRequestBody",
  "type": "object",
  "required": [
    "accountId",
    "adAccountId",
    "name"
  ],
  "properties": {
    "stage": {
      "type": "boolean",
      "description": "Send true to store this write as a staged change instead of applying it. The response is `202` with the change, and POST /v1/ads/changes/{changeId}/confirm applies it later. Cannot be combined with `validateOnly`."
    },
    "retryOnServerError": {
      "type": "boolean",
      "default": true,
      "description": "When Meta answers a create with a 5xx and reading the parent back by name finds no such object, Zernio sends the create again (at most 3 POSTs per object, never for an object created ACTIVE) and reports it in `recoveredWrites`.\n\n`false` never sends it again: the request fails with 502 and `details.unconfirmedWrite`, so you can check the parent yourself. One object found by name is still reused.\n"
    },
    "creativeFeatures": {
      "$ref": "#/$defs/MetaCreativeFeatures",
      "description": "Meta enhancement settings for single or attached ads, and defaults for creatives[]. An item replaces the entire map, including with an empty object."
    },
    "tracking": {
      "$ref": "#/$defs/AdTracking"
    },
    "accountId": {
      "type": "string",
      "minLength": 1,
      "description": "Facebook or Instagram SocialAccount ID."
    },
    "adAccountId": {
      "type": "string",
      "minLength": 1,
      "description": "Meta ad account ID, e.g. `act_123456789`."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "Ad display name. Used to derive campaign / ad set names.\nOn the multi-creative shape, each ad's Meta name gets a\n\" #N\" suffix (1-indexed) so Ads Manager shows them as a\nnumbered batch.\n"
    },
    "campaignName": {
      "type": "string",
      "maxLength": 255,
      "description": "Exact name for the campaign this request provisions. Omitted keeps `<name> - Campaign`. Ignored with `adSetId` (the ad set already has a campaign)."
    },
    "adSetName": {
      "type": "string",
      "maxLength": 255,
      "description": "Exact name for the ad set this request provisions. Omitted keeps `<name> - Ad Set`. Ignored with `adSetId`."
    },
    "platformPostId": {
      "type": "string",
      "minLength": 1,
      "description": "Messaging and CTWA only. Platform post or reel ID, the same input boostPost takes as platformPostId. Mutually exclusive with objectStoryId and fresh creative fields.\n\n- Facebook IDs become object_story_id.\n- Instagram IDs become source_instagram_media_id, run as the media owner (resolved from the media on a Meta ads business-login connection, so no Instagram connection is needed).\n"
    },
    "existingPostId": {
      "type": "string",
      "minLength": 1,
      "deprecated": true,
      "description": "Alias of platformPostId, kept for existing callers. Sending both with different values is a 400."
    },
    "objectStoryId": {
      "type": "string",
      "pattern": "^\\d+_\\d+$",
      "description": "Messaging and CTWA only. Raw Facebook pageId_postId reference, used as object_story_id even with an Instagram account. Mutually exclusive with platformPostId and fresh creative fields."
    },
    "pageId": {
      "type": "string",
      "description": "Facebook Page the ad runs as, when the connection was granted several Pages. Defaults to the Page bound to the connection. Any Page granted to the connection is accepted; other ids answer 400 listing the granted Pages. Same semantics as `pageId` on POST /v1/ads/create."
    },
    "whatsappPhoneNumber": {
      "type": "string",
      "pattern": "^\\+[1-9]\\d{6,14}$",
      "description": "WhatsApp only. Optional E.164 number already paired with the Facebook Page. Omit to let Meta select the paired number.\n\n- Sent to the creative CTA and, when creating a new ad set, its promoted_object.\n- Meta can accept the number yet create the ad set without it; the response then carries a `warnings` entry.\n- Attach requests do not change the existing ad set.\n- Stored as creative.whatsappPhoneNumber on every created ad.\n"
    },
    "headline": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Single-creative shape only. Mutually exclusive with\n`creatives[]`. Required on a single image or video ad (including\none built with `placementAssets`); not used by a `carouselCards`\nad and not accepted with an existing post reference.\n"
    },
    "body": {
      "type": "string",
      "minLength": 1,
      "description": "Primary text shown above the image / video. Single-creative\nshape only. Mutually exclusive with `creatives[]`.\n"
    },
    "description": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Link description, independent of `headline` and `body`: Meta's `link_data.description`, `video_data.link_description` on video, and the shared description of a `placementAssets` feed.\n\nMeta shows it mainly on Facebook Feed placements, under the headline, when there is room. Instagram, Stories, Reels and Messenger placements do not display it.\n\nAlso accepted per entry in `creatives[]`. Not allowed with an existing post creative.\n"
    },
    "imageUrl": {
      "type": "string",
      "format": "uri",
      "description": "Image asset for single-creative shape. Mutually exclusive\nwith `video` and with `creatives[]`. Required on the\nsingle-creative shape if neither `video` nor an existing post reference is supplied.\n"
    },
    "video": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Public URL of the video to upload. Provide either `url` or `id`."
        },
        "id": {
          "type": "string",
          "description": "Reuse a video already uploaded to this ad account (list them with GET /v1/ads/videos) instead of re-uploading. Wins over `url`. Provide either `url` or `id`. Meta: a video still processing is waited on for up to 30 s, then answered 409 `invalid_resource_state` (poll GET /v1/ads/videos/{videoId})."
        },
        "thumbnailUrl": {
          "type": "string",
          "format": "uri",
          "description": "OPTIONAL: when omitted, the poster is auto-generated from\nMeta's own preferred video thumbnail. When Meta produces no\ncandidate the request fails with a 502 platform_error\n(reason: video_thumbnail_unavailable). Retry, or supply\nthis field to control the poster frame exactly.\n"
        }
      },
      "description": "Video creative for single-creative shape. Mutually\nexclusive with `imageUrl` and with `creatives[]`. Required\non the single-creative shape if neither `imageUrl` nor an existing post reference is supplied.\n"
    },
    "welcomeMessage": {
      "type": "object",
      "required": [
        "text"
      ],
      "properties": {
        "text": {
          "type": "string",
          "minLength": 1,
          "description": "Greeting shown when the chat opens. Replaces Meta's default (\"Hi! Can we help you?\")."
        },
        "prefillText": {
          "type": "string",
          "minLength": 1,
          "description": "Message put into the user's text input, ready to send. Replaces Meta's default (\"Hi! I want more info.\"). Lets one ad steer the opening message toward what it promotes (e.g. a specific product). Exactly one of prefillText or quickReplies."
        },
        "quickReplies": {
          "type": "array",
          "minItems": 1,
          "maxItems": 13,
          "items": {
            "type": "object",
            "required": [
              "title",
              "payload"
            ],
            "properties": {
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 20,
                "description": "Chip label the person taps."
              },
              "payload": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1000,
                "description": "Opaque string you choose; delivered on the message.received webhook as interactiveMetadata.quickReplyPayload when the chip is tapped."
              }
            }
          },
          "description": "Tappable chips under the greeting instead of a prefilled message. Exactly one of prefillText or quickReplies.\n\nPut your own campaign or ad key in each payload. The tap arrives on the messages webhook with that payload even where Meta delivers no ad referral (Pages owned by an EU business under the Europe/Japan Messenger restrictions).\n"
        }
      },
      "description": "Custom chat welcome message (Meta's `page_welcome_message`,\n\"Mensaje de bienvenida\" / \"Mensaje predefinido\" in Ads Manager).\nSingle-creative shape only; for `creatives[]` set it per entry.\n"
    },
    "carouselCards": {
      "type": "array",
      "minItems": 2,
      "maxItems": 10,
      "items": {
        "$ref": "#/$defs/MessagingCarouselCard"
      },
      "description": "Messaging and CTWA only (a 400 on POST /v1/ads/call). A hand-built carousel of 2-10 image or video cards, sent to Meta in the given order as `link_data.child_attachments`.\n\n- Meta may reorder cards for performance, since `multi_share_optimized` defaults to true; `optimizeCardOrder: false` keeps your order.\n- Every card (and the carousel) carries the destination's messaging call to action (WHATSAPP_MESSAGE, MESSAGE_PAGE or INSTAGRAM_MESSAGE), so a tap on any card opens the conversation.\n- Replaces `imageUrl` / `video` (sending either is a 400).\n- `body` is required as the primary text. `headline` is optional and only names the creative (each card has its own `headline`). A top-level `description` is a 400 (set it per card).\n- `welcomeMessage`, `whatsappPhoneNumber` and `destinations` apply as on a single-image ad.\n- Also a 400 with `placementAssets`, `platformPostId`, `existingPostId` or `objectStoryId`.\n- Single-creative shape; for `creatives[]` set it per entry.\n"
    },
    "optimizeCardOrder": {
      "type": "boolean",
      "description": "Only with `carouselCards` (a 400 without them). Single-creative shape; for `creatives[]` set it per entry. Sets the creative's `link_data.multi_share_optimized`.\n\n- `false`: keeps the cards in the order given. Meta then takes at most 5 cards, so `false` with more than 5 `carouselCards` is a 400.\n- `true`: lets Meta pick and reorder the cards for performance (up to 10).\n- Omitted: nothing is sent and Meta's default (`true`) applies.\n"
    },
    "creatives": {
      "type": "array",
      "minItems": 1,
      "description": "Multi-creative shape: N CTWA ads under one campaign + one ad set, sharing budget and targeting. Fresh and existing creatives can be mixed.\n\nEach entry supplies headline, body, and image/video, or a platformPostId or objectStoryId reference.\n\nMutually exclusive with the top-level single-creative fields (`headline` / `body` / `imageUrl` / `video`): setting both is a 400. This differs from `POST /v1/ads/create`, where the top-level fields are silently ignored in multi-creative mode.\n",
      "items": {
        "type": "object",
        "description": "Supply headline, body, and image/video; or body and carouselCards (no headline); or exactly one existing post reference. References cannot be combined with headline, body, imageUrl, video or carouselCards; welcomeMessage works on all three.",
        "properties": {
          "platformPostId": {
            "type": "string",
            "minLength": 1,
            "description": "Messaging and CTWA only. Platform post or reel ID, the same input boostPost takes as platformPostId. Mutually exclusive with objectStoryId and fresh creative fields.\n\n- Facebook IDs become object_story_id.\n- Instagram IDs become source_instagram_media_id, run as the media owner (resolved from the media on a Meta ads business-login connection, so no Instagram connection is needed).\n"
          },
          "existingPostId": {
            "type": "string",
            "minLength": 1,
            "deprecated": true,
            "description": "Alias of platformPostId, kept for existing callers. Sending both with different values is a 400."
          },
          "objectStoryId": {
            "type": "string",
            "pattern": "^\\d+_\\d+$",
            "description": "Messaging and CTWA only. Raw Facebook pageId_postId reference, used as object_story_id even with an Instagram account. Mutually exclusive with platformPostId and fresh creative fields."
          },
          "creativeFeatures": {
            "$ref": "#/$defs/MetaCreativeFeatures",
            "description": "Replaces the top-level creativeFeatures map for this item. Omit to inherit; an empty object clears inherited enrollment choices."
          },
          "headline": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "description": "Primary text shown above the image / video."
          },
          "imageUrl": {
            "type": "string",
            "format": "uri",
            "description": "Image asset. Mutually exclusive with this entry's\n`video`. Required if neither `video` nor an existing post reference is supplied.\n"
          },
          "video": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri",
                "description": "Public URL of the video to upload. Provide either `url` or `id`."
              },
              "id": {
                "type": "string",
                "description": "Reuse a video already uploaded to this ad account (list them with GET /v1/ads/videos) instead of re-uploading. Wins over `url`. Provide either `url` or `id`. Meta: a video still processing is waited on for up to 30 s, then answered 409 `invalid_resource_state` (poll GET /v1/ads/videos/{videoId})."
              },
              "thumbnailUrl": {
                "type": "string",
                "format": "uri",
                "description": "OPTIONAL: when omitted, the poster is auto-generated\nfrom Meta's own preferred video thumbnail. When Meta\nproduces no candidate the request fails with a 502\nplatform_error (reason: video_thumbnail_unavailable).\n"
              }
            },
            "description": "Video creative. Mutually exclusive with this entry's\n`imageUrl`. Required if neither `imageUrl` nor an existing post reference is supplied.\n"
          },
          "welcomeMessage": {
            "type": "object",
            "required": [
              "text"
            ],
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "description": "Greeting shown when the chat opens. Replaces Meta's default."
              },
              "prefillText": {
                "type": "string",
                "minLength": 1,
                "description": "Message put into the user's text input, ready to send. Replaces Meta's default. Exactly one of prefillText or quickReplies."
              },
              "quickReplies": {
                "type": "array",
                "minItems": 1,
                "maxItems": 13,
                "items": {
                  "type": "object",
                  "required": [
                    "title",
                    "payload"
                  ],
                  "properties": {
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 20,
                      "description": "Chip label the person taps."
                    },
                    "payload": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000,
                      "description": "Opaque string you choose; delivered on the message.received webhook as interactiveMetadata.quickReplyPayload when the chip is tapped."
                    }
                  }
                },
                "description": "Tappable chips under the greeting instead of a prefilled message. Exactly one of prefillText or quickReplies."
              }
            },
            "description": "Custom chat welcome message for this entry: `text` plus exactly one of `prefillText` or `quickReplies` (400 otherwise). Same shape as the top-level `welcomeMessage` of the single-creative shape."
          },
          "carouselCards": {
            "type": "array",
            "minItems": 2,
            "maxItems": 10,
            "items": {
              "$ref": "#/$defs/MessagingCarouselCard"
            },
            "description": "A 2-10 card carousel for this entry instead of `imageUrl` / `video`; `body` is required. Same rules as the top-level `carouselCards`. Carousel and single-media entries can be mixed on one ad set."
          }
        }
      }
    },
    "adSetId": {
      "type": "string",
      "description": "Attaches the creatives to this EXISTING messaging ad set instead of building a campaign, so the ad set keeps its learning phase. Its `destination_type` must match the ad's destination.\n\nThe ad set then owns budget, targeting and schedule, so these are rejected with a 400 alongside it: `budgetAmount`, `budgetType`, `budgetLevel`, `startDate`, `endDate`, `objective`, `campaignStatus`, `adSetStatus`, `existingCampaignId`, the special ad category fields, and every targeting field except `ageMin`, `ageMax`, `placements` and `advantageAudience`.\n"
    },
    "existingCampaignId": {
      "type": "string",
      "pattern": "^\\d+$",
      "description": "Creates the new messaging ad set (and its ads) under this EXISTING Meta campaign instead of a new one, e.g. several audience ad sets under one campaign. To add ads to an existing ad set instead, use `adSetId`.\n\n- The campaign's objective must be OUTCOME_ENGAGEMENT, OUTCOME_SALES or OUTCOME_LEADS (400 otherwise).\n- If the campaign has a campaign budget, omit `budgetAmount` and `budgetType` (400 if sent). Otherwise they are required and land on the new ad set.\n- `objective`, `campaignName`, `campaignStatus`, `budgetLevel`, `specialAdCategories`, `specialAdCategoryCountry` and `adSetId` are rejected alongside it.\n"
    },
    "budgetLevel": {
      "type": "string",
      "enum": [
        "adset",
        "campaign"
      ],
      "description": "Where the budget lives. `adset` (default) puts it on the new ad\nset. `campaign` creates an Advantage campaign budget (CBO): the\nbudget and bid strategy sit on the campaign and the ad set\ninherits them, same as POST /v1/ads/create. Not allowed with\n`adSetId` or `existingCampaignId`.\n"
    },
    "budgetAmount": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Budget amount in the ad account's currency major units\n(e.g. dollars for USD, not cents). Must be > 0.\nRequired unless `adSetId` is set (the ad set owns it) or\n`existingCampaignId` names a campaign with a campaign budget.\n"
    },
    "budgetType": {
      "type": "string",
      "enum": [
        "daily",
        "lifetime"
      ],
      "description": "Required unless `adSetId` is set or `existingCampaignId` names a campaign with a campaign budget. `lifetime` requires `endDate`."
    },
    "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3,
      "description": "ISO 4217 currency code matching the ad account's currency\n(e.g. `USD`). Optional: Zernio resolves it from the ad account\nwhen omitted. The value selects the minor-unit exponent Zernio\nconverts budget/bid amounts by before calling Meta (most\ncurrencies are cents; zero-decimal currencies like JPY/KRW are\nsent as-is).\n"
    },
    "startDate": {
      "type": "string",
      "description": "When the ad set starts delivering. ISO 8601 date or date-time. A\nvalue with an offset (`2027-01-15T10:00:00+01:00`, `...Z`) is used\nas is; one without an offset (`2027-01-15T10:00:00`) is read in the\nad account's timezone, and a date-only value starts at 00:00 local.\nDefaults to now.\n"
    },
    "endDate": {
      "type": "string",
      "description": "ISO 8601 date or date-time, read like `startDate`; a date-only\nvalue ends at 23:59:59 local. Required when `budgetType` is\n`lifetime`.\n"
    },
    "countries": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 2,
        "maxLength": 2
      },
      "description": "ISO 3166-1 alpha-2 country codes. Defaults to `[\"US\"]` only\nwhen no other geo (`cities`, `regions`, `zips`, `metros`,\n`customLocations`) is supplied.\n"
    },
    "cities": {
      "type": "array",
      "description": "City-level geo targeting for local CTWA campaigns. Each entry maps to Meta's TargetingGeoLocationCity; `key` is Meta's city ID.\n\n`radius` and `distance_unit` are coupled: set both or neither. Meta enforces a minimum city radius (~17 km / 10 mi); smaller values resolve to a 0-size audience and the ad fails at launch. For a tighter catchment use customLocations (lat/lng).\n",
      "items": {
        "type": "object",
        "required": [
          "key"
        ],
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1
          },
          "radius": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "distance_unit": {
            "type": "string",
            "enum": [
              "mile",
              "kilometer"
            ]
          }
        }
      }
    },
    "regions": {
      "type": "array",
      "description": "Region / state-level geo targeting. `key` is Meta's region\nID (lookupable via GET /v1/ads/targeting/search?type=region).\n",
      "items": {
        "type": "object",
        "required": [
          "key"
        ],
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "zips": {
      "type": "array",
      "description": "ZIP / postal-code geo targeting. `key` is the platform's\npostal id resolved via /v1/ads/targeting/search.\n",
      "items": {
        "type": "object",
        "required": [
          "key"
        ],
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "metros": {
      "type": "array",
      "description": "DMA / metro-area geo targeting. `key` is Meta's metro id\n(e.g. `DMA:807`).\n",
      "items": {
        "type": "object",
        "required": [
          "key"
        ],
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "countryGroups": {
      "type": "array",
      "description": "Meta only. Continents and trade blocs (`geo_locations.country_groups`),\nfor targeting a whole region without listing its countries. Combines\nwith `countries` rather than replacing it, and is also accepted under\n`excludedLocations`. Discoverable via\n`GET /v1/ads/targeting/search?dimension=geo&geoType=country_group`.\n",
      "items": {
        "type": "string",
        "enum": [
          "africa",
          "asia",
          "europe",
          "north_america",
          "south_america",
          "oceania",
          "central_america",
          "caribbean",
          "eea",
          "euro_area",
          "nafta",
          "mercosur",
          "afta",
          "apec",
          "gcc",
          "cisfta",
          "emerging_markets",
          "itunes_app_store",
          "android_free_store",
          "android_paid_store"
        ]
      }
    },
    "customLocations": {
      "type": "array",
      "description": "Point-radius geo (Meta `geo_locations.custom_locations`).\nUse for targeting a radius around a specific lat/long when\nno Meta city/region key fits. `distanceUnit` is required.\n",
      "items": {
        "type": "object",
        "required": [
          "latitude",
          "longitude",
          "radius",
          "distanceUnit"
        ],
        "properties": {
          "latitude": {
            "type": "number",
            "minimum": -90,
            "maximum": 90
          },
          "longitude": {
            "type": "number",
            "minimum": -180,
            "maximum": 180
          },
          "radius": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "distanceUnit": {
            "type": "string",
            "enum": [
              "mile",
              "kilometer"
            ]
          },
          "name": {
            "type": "string"
          },
          "address": {
            "type": "string"
          }
        }
      }
    },
    "ageMin": {
      "type": "integer",
      "minimum": 13,
      "maximum": 65
    },
    "ageMax": {
      "type": "integer",
      "minimum": 13,
      "maximum": 65
    },
    "interests": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "audienceId": {
      "type": "string",
      "description": "Custom audience ID to target."
    },
    "placements": {
      "type": "object",
      "description": "Manual ad placements on the shared ad set. Omit for automatic placements.\n\nWhen set, restricts delivery to the chosen surfaces, mapped onto the ad set's `targeting.{publisher_platforms, facebook_positions, instagram_positions, messenger_positions, audience_network_positions, threads_positions, whatsapp_positions, device_platforms}`.\n\nEnum membership is validated here. Meta additionally enforces co-selection rules and restricts which placements are eligible for click-to-WhatsApp ads, returning an actionable error which we surface.\n",
      "properties": {
        "publisherPlatforms": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "facebook",
              "instagram",
              "threads",
              "messenger",
              "audience_network",
              "whatsapp"
            ]
          },
          "description": "Top-level platforms to deliver on. A position field below is only honoured when its parent platform is included here."
        },
        "facebookPositions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "feed",
              "right_hand_column",
              "marketplace",
              "story",
              "search",
              "instream_video",
              "facebook_reels",
              "facebook_reels_overlay",
              "profile_feed",
              "notification"
            ]
          }
        },
        "instagramPositions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "stream",
              "story",
              "explore",
              "explore_home",
              "reels",
              "profile_feed",
              "ig_search",
              "profile_reels"
            ]
          }
        },
        "messengerPositions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "messenger_home",
              "sponsored_messages",
              "story"
            ]
          }
        },
        "audienceNetworkPositions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "classic",
              "rewarded_video"
            ]
          }
        },
        "threadsPositions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "threads_stream"
            ]
          }
        },
        "whatsappPositions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "status"
            ]
          }
        },
        "devicePlatforms": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "mobile",
              "desktop"
            ]
          },
          "description": "Restrict by device. Omit to deliver on both mobile and desktop."
        }
      }
    },
    "gender": {
      "type": "string",
      "enum": [
        "all",
        "male",
        "female"
      ],
      "description": "Restrict the audience by gender (Meta `genders`). Omit or send all for everyone; all is ignored in adSetId attach mode. Stored on the ad and read back in `targeting.gender`."
    },
    "languages": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Audience languages (Meta `locales`). A bare ISO 639-1 code targets all regional variants (\"en\" = all English), a region-qualified code a specific one (\"en_GB\", \"pt_BR\"). Meta numeric locale ids (e.g. \"24\" for English UK) are also accepted. Unknown values are rejected. Same format as `targeting.languages` on POST /v1/ads/boost."
    },
    "places": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "key"
        ],
        "properties": {
          "key": {
            "type": "string"
          }
        }
      },
      "description": "Meta place keys (from GET /v1/ads/targeting/search)."
    },
    "neighborhoods": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "key"
        ],
        "properties": {
          "key": {
            "type": "string"
          }
        }
      },
      "description": "Meta neighborhood keys (from GET /v1/ads/targeting/search)."
    },
    "excludedLocations": {
      "type": "object",
      "description": "Geo to exclude, same shape as POST /v1/ads/create (countries, countryGroups, regions, cities, zips, places, neighborhoods, customLocations).",
      "additionalProperties": true
    },
    "behaviors": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "description": "Behavior ids from /v1/ads/targeting/search?dimension=behavior. Meta: each dimension is its own

# --- truncated at 32 KB (74 KB total) ---
# Full source: https://artifacts.apis.io/zernio-com/json-schema/zernio-com-ctwa-ad-request-body-schema.json

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/zernio-com-ctwa-ad-request-body"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.