Create a standalone campaign
Creates a campaign WITHOUT its first ad set / ad (the ODAX shell only). Ad sets join it
later via existingCampaignId on the create endpoints. A budget here is campaign-level
(CBO) by definition; omit it for ABO (each ad set carries its own budget). Created
PAUSED unless status: ACTIVE. The campaign materializes in /v1/ads/tree via the
next sync discovery pass.
API key authentication - use your Zernio API key as a Bearer token
In: header
Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
Meta ad account id (act_).
length <= 255Mapped to the ODAX objective (same mapping as POST /v1/ads/create).
"engagement" | "traffic" | "awareness" | "video_views" | "lead_generation" | "lead_conversion" | "job_applicants" | "conversions" | "app_promotion" | "catalog_sales"Campaign-level (CBO) budget in whole currency units. Requires budgetType.
"daily" | "lifetime""PAUSED""ACTIVE" | "PAUSED"Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.adcampaigns.createAdCampaign({ body: { accountId: 'account_abc123', adAccountId: 'adaccount_abc123', name: 'Example', goal: 'engagement', },});console.log(data);{
"adAccountId": "string",
"campaignId": "string",
"objective": "string",
"status": "ACTIVE"
}{
"error": "Unauthorized"
}List ads GET
Returns a paginated list of ads with metrics computed over an optional date range. Use source=all to include externally-synced ads from platform ad managers. If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max. To find the Zernio ad behind a comment you see in Meta Business Manager, filter by platformAdId (the Meta ad ID), effectiveObjectStoryId (Facebook), or effectiveInstagramMediaId (Instagram) — those are the post/media the ad's engagement lives on, and are also returned on each ad's `creative` object. Then call GET /v1/ads/{adId}/comments with the returned ad id.
Create standalone ad POST
Creates a paid ad with custom creative across Meta, Google Ads, Pinterest, TikTok, X/Twitter, LinkedIn, and OpenAI Ads (ChatGPT Ads). Supports three mutually-exclusive request shapes selected by the body, a legacy single-creative shape (all platforms, default), a Meta-only multi-creative shape via the creatives array (one ad set with N ads sharing budget and targeting), and a Meta-only attach shape via adSetId (adds one new ad to an existing ad set). Per-platform required fields, budget minimums, and video-ad rules are documented on each property below. LinkedIn creates a Single Image or Single Video Ad backed by a Direct Sponsored Content "dark post" authored by a Company Page (see `organizationId`); supported goals are engagement, traffic, awareness, and video_views (video ads use the `video` field; video_views requires a video), and traffic ads require `linkUrl`. **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). Keys are scoped to your credential and expire after 24h.