Zernio
APIFor you
Zernio
APIFor you
API Reference

Reach & Frequency

Create reach-frequency predictionPOSTGet reach-frequency predictionGETCancel reach-frequency bookingDELETEReserve reach-frequency inventoryPOST
Dashboard
OverviewPlatformsAPI ReferenceResources
Reach & Frequency

Create reach-frequency prediction

Quotes the reach or budget for a Meta reach and frequency campaign over a date range, without buying anything.

This is a QUOTE, nothing is bought and no ad entities are created. Provide a date range plus exactly one of budgetAmount (Meta predicts reach) or reach (Meta predicts the budget). The response carries the estimate and its allowed bounds (min/max budget and reach). Predictions expire on their own; to buy, reserve one via POST /v1/ads/rf-predictions/{predictionId}/reserve and pass the RESERVED id to POST /v1/ads/create with buyingType: "RESERVED".

Reservation campaigns reject automatic placements. Top-level placements wins; when it is omitted, targeting.placements is used; when neither is set, placements default to Facebook feed (+ Instagram stream when a linked IG professional account resolves). Instagram placements require that IG account.


PlatformsMeta
POST
/v1/ads/rf-predictions

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.reachandfrequency.createRfPrediction({  body: {    accountId: 'account_abc123',    adAccountId: 'adaccount_abc123',    startDate: '2026-01-15T10:00:00Z',    endDate: '2026-01-15T10:00:00Z',  },});console.log(data);
{  "adAccountId": "string",  "currency": "string",  "prediction": {    "predictionId": "string",    "status": "string",    "budget": 0,    "reach": 0,    "impressions": 0,    "minBudget": 0,    "maxBudget": 0,    "minReach": 0,    "maxReach": 0,    "frequencyCap": 0,    "startTime": 0,    "stopTime": 0,    "expiresAt": "string"  }}
Was this page helpful?

Create messaging ad

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

Get reach-frequency prediction

Shows a Meta reach and frequency prediction, with its estimate and status.

accountId*string

Zernio SocialAccount id (posting or ads variant).

adAccountId*string

Platform ad account id (Meta act_, Google customer id, LinkedIn account id, ...).

budgetAmount?number

Whole currency units. Exactly one of budgetAmount / reach.

reach?integer

Target unique reach. Exactly one of budgetAmount / reach.

startDate*string

Campaign window start (must be in the future).

Formatdate-time
endDate*string
Formatdate-time
frequencyCap?integer

Max impressions per person over the window.

Range1 <= value <= 90
targeting?

Canonical camelCase TargetingSpec (same shape as /v1/ads/create's targeting). Defaults to countries: [US].

placements?

Meta placements object (same shape as /v1/ads/create's placements).