Create messaging ad
Changed onCreates a Meta ad that opens a chat with you on WhatsApp, Messenger or Instagram Direct when someone taps it.
Creates a click-to-message ad; destination selects where the tapped ad opens a conversation: WhatsApp, the Page's Messenger inbox or the linked Instagram account's Direct inbox. destinations puts two or three of them on one ad set and lets Meta pick the app per viewer. The ad set is created with the matching destination_type and CONVERSATIONS optimization; the campaign objective defaults to OUTCOME_ENGAGEMENT. Supports single-creative and multi-creative shapes. Supersedes POST /v1/ads/ctwa (deprecated, equivalent to destination: whatsapp). 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). accountId is a Facebook, Instagram or Meta ads (business login) connection; pageId picks the Page when that connection was granted several.
Required fields per shape (a missing one is a 400 naming it in param):
- Always accountId, adAccountId, name, and exactly one of destination / destinations.
- budgetAmount and budgetType unless adSetId or existingCampaignId is set, plus endDate for a lifetime budget.
- Single image or video: headline, body, and exactly one of imageUrl / video. With placementAssets, headline and body only (the media comes from placementAssets).
- carouselCards: body and the 2-10 cards; headline is optional, imageUrl / video / top-level description are a 400.
- Existing post (platformPostId or objectStoryId): no copy or media fields.
- creatives[]: the same rules per entry, with no top-level creative fields.
- welcomeMessage, when sent: text plus exactly one of prefillText / quickReplies.
WhatsApp number prerequisite. For the WhatsApp destination, 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/messaging
- 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"
}
}
],
"placementAssets": {
"defaultImageUrl": "https://example.com/feed-4x5.jpg",
"rules": [
{
"imageUrl": "https://example.com/feed-4x5.jpg",
"headline": "Build with Zernio",
"body": "Schedule social posts from your app.",
"description": "One API for your social content.",
"placements": {
"publisherPlatforms": [
"facebook"
],
"facebookPositions": [
"feed"
]
}
},
{
"imageUrl": "https://example.com/story-9x16.jpg",
"headline": "Your next story",
"body": "Bring your social workflow to Zernio.",
"placements": {
"publisherPlatforms": [
"facebook"
],
"facebookPositions": [
"story",
"facebook_reels"
]
}
}
]
}
}Response
validateOnly: true only. Meta accepted every node; nothing was created.
Changes
- info
added the new optional request property
/////
- info
- warning
added the new
unverifiedenum value to the//response property for the response status
- warning