Zernio
APIFor you
Zernio
APIFor you
API Reference

Campaigns and Ads

Overview

Get campaign treeGETGet daily account metricsGET

Campaigns

List campaignsGETCreate a standalone campaignPOSTGet live campaign detailsGETUpdate a campaignPUTDuplicate a campaignPOSTDelete a campaignDELETEPause or resume a campaignPUTPause or resume many campaignsPOSTList campaign assetsGETAttach campaign assetsPOSTUpdate campaign assetsPUTRemove campaign assetsDELETERead a Google campaign's device, location, excluded location, and language targetingGETEdit a Google campaign's device, location, excluded location, or language targetingPUTRead a campaign's ad schedule (dayparting)GETReplace a campaign's ad schedule (dayparting)PUTGet campaign conversion goalsGETUpdate campaign conversion goalsPATCH

Asset Groups

List Performance Max asset groupsGETCreate a Performance Max asset groupPOSTGet a Performance Max asset groupGETUpdate a Performance Max asset groupPATCHRemove a Performance Max asset groupDELETELink or unlink asset group assetsPOSTReplace an asset group's listing-group treePUT

Ad Sets

List ad setsGETCreate a standalone ad groupPOSTGet live ad-set detailsGETUpdate an ad setPUTDuplicate an ad setPOSTDelete an ad setDELETEPause or resume a single ad setPUTList ad-group assetsGETAttach ad-group assetsPOSTUpdate ad-group assetsPUTRemove ad-group assetsDELETE

Ads

List adsGETGet ad detailsGETCreate standalone adPOSTBoost post as adPOSTUpdate adPUTDuplicate an adPOSTCancel an adDELETEPause or resume a single adPUT

Keywords

List Search keywordsGETAdd Search ad-group keywordsPOSTPause or enable a Search keywordPATCHRemove a Search keywordDELETEList campaign-level negative keywordsGETReplace campaign-level negative keywordsPUTList campaign negative listsGETReplace campaign negative listsPUT

Bidding

Read a campaign's current biddingGETList portfolio bid strategiesGETCreate portfolio bid strategyPOSTUpdate portfolio bid strategyPATCH

Recommendations

List Google Ads recommendationsGETApply Google Ads recommendationsPOSTDismiss Google Ads recommendationsPOST

Other

Create a shared budgetPOSTRead the platform's review verdict for an adGETReview status of each creative in a TikTok Smart+ adGETList shared budgetsGETReview status of every TikTok Smart+ ad of an advertiserGET
Dashboard
OverviewPlatformsAPI ReferenceResources
Campaigns and Ads

List ad sets

Lists ad sets (ad groups on Google) with their targeting, bidding and optimization settings, optionally for one campaign.

Ad sets (Google ad groups) synced for the connection, optionally filtered by platform and campaignId. Reads the ad_sets table directly, independent of the ads rollup GET /v1/ads/tree uses, so a newly created standalone ad group with no ad yet (POST /v1/ads/ad-sets, Google only) is visible here even though it is invisible in the tree until an ad joins it via adSetId on POST /v1/ads/create. Returns at most 500 rows, newest first.

This list is SYNCED, not live (refreshed by background sync, see below). Each row also carries the ad set's config (targeting, bidStrategy, bidAmount, optimizationGoal, billingEvent, promotedObject), so ?accountId=...&adAccountId=act_... returns the config of every ad set of an ad account in one call, without a campaignId. To read budgets, status, targeting, promoted object and bid strategy of every campaign and ad set of a Meta ad account LIVE in one call (for example as a pre-write spend gate), use GET /v1/ads/accounts/live instead.

Status freshness. status, configuredStatus, platformStatus, platformAdSetStatus and platformCampaignStatus are the values Zernio last stored. Background sync refreshes them, typically within 15 to 60 minutes (Google up to about 3 hours), and ended or long-paused objects may be refreshed less often. Zernio's own status writes re-read the switches they change. A change made in the platform's own ads manager therefore shows up here only after the next sync. Controllers that act on a switch should pass live=true, which reads the switches from the platform now, stores them, and returns statusReadAt (null when the read failed and the stored values were returned). With live=true (which needs a campaignId or adSetId filter) each listed ad set's own switch (platformAdSetStatus) is read live, for the first 20 rows; later rows keep their synced value with statusReadAt: null. Live reads cover TikTok, Meta, Google, OpenAI and Reddit. The rolled-up status is not re-derived by a live read. On TikTok the same live read also returns the ad group's applied optimizationGoal and billingEvent, as TikTok's adgroup/get reports them, so you can verify the goal TikTok applied rather than the one you requested. It also returns nativeSettings: a fixed subset of TikTok's own adgroup/get record for the ad group, with TikTok's own values, read in that same call (budget, budget_mode, schedule, placements, locations, ages, gender, languages, interests, actions, audiences and exclusions), plus the advertiser's currency and timezone. TikTok's schedule_start_time / schedule_end_time are UTC wall clocks ("YYYY-MM-DD HH:MM:SS", no offset); Ads Manager displays them in advertiser_timezone. configReadAt says when it was read; it is null on every row whose native settings were not read now, so never treat a null as a match. These are read, not retained create payloads, and are not stored.


PlatformsMetaGoogleTikTokLinkedInPinterestXOpenAI
GET
/v1/ads/ad-sets

Authorization

bearerAuth
AuthorizationBearer <token>

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

In: header

Query Parameters

accountId?string

Account ID

adAccountId?string

Platform ad account id (Meta act_). Lists every synced ad set of that ad account; no campaignId needed.

campaignId?string

Platform campaign ID

adSetId?string

Platform ad set ID

platform?string

Value in

  • "facebook"
  • "instagram"
  • "tiktok"
  • "linkedin"
  • "pinterest"
  • "google"
  • "twitter"
  • "openai"
  • "reddit"
live?boolean

Read the on/off switches live from the platform instead of returning the synced values. The fresh values are stored (so later reads return them too) and the response carries statusReadAt, the time of the read. At most 20 platform objects are read per request. Where a read fails (credentials, platform error, no reader on that platform), the stored values come back with statusReadAt: null. See "Status freshness" in the operation description. On X the budget is read live in the same read: on GET /v1/ads/{adId} budget, adSetBudget, campaignBudget and budgetLevel are the line item and campaign budgets X holds now (stored like the switches); on the ad set and campaign listings budget is the one that line item or campaign holds now (returned, not stored); a row whose budget the other level holds keeps its synced budget.

Defaultfalse

Response Body

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.adcampaigns.listAdSets();console.log(data);
{  "adSets": [    {      "platformAdSetId": "string",      "platform": "string",      "adSetName": "string",      "status": "string",      "platformAdSetStatus": "string",      "platformCampaignId": "string",      "platformAdAccountId": "string",      "accountId": "string",      "profileId": "string",      "currency": "string",      "budget": {        "amount": 0,        "type": "daily",        "daily": 0,        "lifetime": 0,        "pacing": "string"      },      "schedule": {        "startDate": "2019-08-24T14:15:22Z",        "endDate": "2019-08-24T14:15:22Z"      },      "targeting": {        "include": {},        "exclude": {},        "audienceExpansionEnabled": true,        "offsiteDeliveryEnabled": true      },      "isExternal": true,      "platformCreatedAt": "2019-08-24T14:15:22Z",      "statusReadAt": "2019-08-24T14:15:22Z",      "optimizationGoal": "string",      "billingEvent": "string",      "bidStrategy": "string",      "bidAmount": 0,      "promotedObject": {},      "nativeSettings": {},      "configReadAt": "2019-08-24T14:15:22Z"    }  ]}
Was this page helpful?

Replace an asset group's listing-group tree

Replaces the product targeting tree of a Performance Max retail asset group; only works on campaigns linked to Merchant Center. Replace the product (listing-group) tree of a Performance Max retail asset group. The current tree is removed and the new one created in one atomic request. Read the current tree with GET on the asset group. Requires a campaign linked to Merchant Center; other campaigns return 400 LISTING_SOURCE_NOT_ALLOWED from Google. validateOnly: true validates without writing.

Create a standalone ad group

Creates an empty Google ad group under an existing campaign, ready for ads to be added later. Google Ads compliance row C.190: creates an ad group WITHOUT an ad, under an existing campaign. Ads join it later via `adSetId` on POST /v1/ads/create. Google only; every other platform returns 501. Created `PAUSED` unless `status: ACTIVE`. The new ad group has no ad yet, so it will not appear in GET /v1/ads/tree (built purely from `ads` rows) until one is added; use GET /v1/ads/ad-sets to see it in the meantime. **Idempotency:** send an `Idempotency-Key` header to make retries safe.