Create CTWA ad (deprecated)
Changed onDeprecated: use POST /v1/ads/messaging with destination: whatsapp. This endpoint stays available for back-compat; no removal planned.
Creates one or more Click-to-WhatsApp (CTWA) ads on Meta under a single campaign and ad set. When tapped, each ad opens a WhatsApp conversation with the business attached to the supplied Facebook Page. The full hierarchy (campaign, ad set, creative(s), ad(s)) is created and activated in one call. The CTA is locked to WHATSAPP_MESSAGE and the destination is hard-coded to api.whatsapp.com/send; Meta resolves the actual WhatsApp number from the Page-to-WA pairing configured in Page settings or Business Manager.
Supports two mutually-exclusive shapes:
-
Single-creative: supply top-level headline, body, and one of imageUrl / video, or a platformPostId / objectStoryId reference. Creates 1 campaign + 1 ad set + 1 ad.
-
Multi-creative: supply a creatives[] array with N entries (each carrying fresh media and copy or an existing post reference). Creates 1 campaign + 1 ad set + N ads sharing budget and targeting so Meta A/Bs the creatives inside a single auction instead of fragmenting budget across N parallel campaigns. Recommended when launching multiple creative variants for the same campaign.
Attach shape. Send adSetId (with either creative shape) to add the ads to an EXISTING messaging ad set instead of building a campaign, so the ad set keeps its learning phase, the way to refresh a CTWA creative without resetting delivery. The ad set then owns budget, targeting and schedule, so budgetAmount, budgetType, endDate, objective, countries, interests and audienceId are rejected with a 400 alongside it rather than silently dropped. The target ad set's destination_type must match the ad's destination (a WhatsApp ad needs a WHATSAPP ad set), otherwise Meta would accept an ad that never delivers.
Prerequisites enforced by Meta (surfaced as platform_error on failure): the Facebook Page must be paired with a verified WhatsApp Business number, the WhatsApp Business Account must be business-verified, and the Meta access token must carry ads_management. Existing posts and reels are supported through platformPostId (alias existingPostId) or objectStoryId, either per creative or at the top level. Omit fresh media and copy for that creative. Optional whatsappPhoneNumber selects a number already paired with the Page (WhatsApp destination only).
WhatsApp number prerequisite. Link the WhatsApp number to the Facebook Page used for the ad before creating it: Meta checks the pairing at creation. Link it from the WhatsApp Business app (Settings > Business tools > Facebook & Instagram) or from the Page settings (Linked accounts > WhatsApp). Linking does not affect the number's WhatsApp connection in Zernio (Cloud API or coexistence), so no reconnect or re-sync is needed. If Meta creates a new ad set without the requested whatsappPhoneNumber, the 201 response carries a warnings entry. This can happen even when the number is linked (Meta can drop a Page's second linked number).
Idempotency: this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an Idempotency-Key header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with Idempotent-Replayed: true) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). If the first request is cut off mid-create (for example by a function timeout), its key can stay in progress and keep returning 409 until it expires; use a new key to retry sooner, after checking whether the ad was created. Keys are scoped to your credential and expire after 24h.
Request
- Base URL: https://zernio.com/api
- URL: https://zernio.com/api/v1/ads/ctwa
- Auth: HTTP bearer
Headers
Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409. A request cut off mid-handler (for example by a function timeout) can leave its key in progress, answering 409 until the key expires after 24 hours.
Request body
Example request
{
"creativeFeatures": {
"auto_promotion_tag": "OPT_IN"
},
"creatives": [
{
"creativeFeatures": {
"auto_promotion_tag": "OPT_IN"
}
}
]
}Response
CTWA ad(s) created and submitted to Meta for review. Response is a tagged union discriminated by adType:
- adType: "single" → single-creative request: { adType, ad, message } where ad is the persisted Ad document.
- adType: "multi" → multi-creative request: { adType, ads, platformCampaignId, platformAdSetId, message } where ads is the array of N persisted Ad documents all sharing the returned campaign and ad set IDs.
Generated SDK clients can narrow on adType instead of sniffing for field presence.
Changes
- info
added the new optional request property
/
- info
- info
added the new optional request property
/// - info
added the new optional request property
- info
the request property
///became optional
- info