campaigns and ads
Pause or resume many campaigns
Process up to 50 campaigns in one call. Each campaign is updated concurrently and the response contains a per-campaign result so a single bad row does not fail the whole batch.
PlatformsMetaGoogleTikTokLinkedInPinterestX
AuthorizationBearer <token>
API key authentication - use your Zernio API key as a Bearer token
In: header
statusstring
Value in
"active" | "paused"campaigns
Items
items <= 50Response 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.bulkUpdateAdCampaignStatus({ body: { status: 'active', campaigns: [ { platformCampaignId: 'platformcampaign_abc123', platform: 'facebook', }, ], },});console.log(data);{
"status": "active",
"totals": {
"updated": 0,
"skipped": 0,
"failed": 0
},
"results": [
{
"platformCampaignId": "string",
"platform": "string",
"updated": 0,
"skipped": 0,
"error": "string"
}
]
}Empty
{
"error": "Unauthorized"
}Cancel an ad DELETE
Cancels the ad on the platform and marks it as cancelled in the database. The ad is preserved for history. OpenAI Ads has no delete API; the ad is archived instead (a terminal state, the closest equivalent).
Boost post as ad POST
Creates a paid ad campaign from an existing published post. Creates the full platform campaign hierarchy (campaign, ad set, ad).