Zernio
Zernio
API Reference

Accounts & Ops

Accounts

List ad accountsGETCreate Meta ad accountPOSTUpdate ad account settingsPATCHAd account financesGET

Manager Accounts

Get manager account hierarchyGETInvite a client account to a managerPOSTAccept, decline, cancel or end a manager linkPATCH

Activity

Ad account change / audit logGETList comments on an adGETReply to an ad commentPOSTHide or unhide an ad commentPOSTDelete an ad commentDELETE

Business Assets

Businesses listGETList TikTok Business CentersGETA/B tests and lift studiesGETList Instagram ad identitiesGETList Instagram posts to boostGETList advertisable appsGETGet iOS 14 campaign limitsGETList TikTok ad pixelsGET

Labels

List ad labelsGETCreate a Google Ads labelPOSTUpdate a Google Ads labelPATCHRemove a Google Ads labelDELETEAttach a Google Ads labelPOSTDetach a Google Ads labelDELETE

Extension Assets

List account calloutsGETAdd account calloutsPOSTUpdate account calloutsPUTRemove account calloutDELETEList account sitelinksGETAdd account sitelinksPOSTUpdate account sitelinksPUTRemove account sitelinkDELETEList account snippetsGETAdd account snippetsPOSTUpdate account snippetsPUTRemove account snippetDELETE

Negative Keyword Lists

List negative keyword listsGETCreate a negative keyword listPOSTGet a negative keyword listGETRename a negative keyword listPUTDelete a negative keyword listDELETEReplace negative list keywordsPUT

Custom Conversions

List custom conversionsGETCreate custom conversionPOST

Value Rules

List value rule setsGETCreate a value rule setPOSTRead a value rule setGETReplace a value rule setPUTDelete a value rule setDELETE

Budget Scheduling

List high-demand periodsGETSchedule a budget increasePOST

DSA Compliance

Get ad account DSA defaultsGETGet DSA recommendationsGET

Other

Assign a user to an ad accountPOSTAssign a user to a PagePOSTRead an ad account's campaigns and ad sets liveGETAd account usersGETBusiness usersGETPage users of a businessGETRemove a user from an ad accountDELETERemove a user from a PageDELETE
Dashboard
llms.txtOpenAPI
OverviewPlatformsAPI ReferenceResources
Accounts & Ops

Read an ad account's campaigns and ad sets live

Reads the campaigns and ad sets of one Meta ad account live from Meta, in a single Graph call per request (the account's /campaigns and /adsets edges, filtered by effective_status), so it is cheap enough to run before every write: for example a per-ad-account spend ceiling that must see the current daily_budget / lifetime_budget rather than the synced copy.

Live vs synced. GET /v1/ads/campaigns and GET /v1/ads/ad-sets serve Zernio's synced store, refreshed by background sync (typically 15 to 60 minutes behind Meta), and their live=true re-reads only the on/off switches of at most 20 objects. This endpoint returns what Meta reports at readAt, for every matching campaign and ad set, and stores nothing.

Budgets and bid amounts are converted from Meta's minor units to whole units of currency, the same units as the synced rows. A campaign with a campaign budget (Advantage+ campaign budget) carries budget and its ad sets have budget: null; otherwise each ad set carries its own.

Each level returns at most limit rows. When more match, paging.<level>.after is a cursor: pass it back as after together with level to read the next page of that level only. Other platforms answer 501 rather than serving synced data.


PlatformsMeta
GET
/v1/ads/accounts/live

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

Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.

adAccountId*string

Meta ad account id (act_).

status?string

Comma-separated Meta effective_status values to keep: ACTIVE, PAUSED, IN_PROCESS, WITH_ISSUES, DELETED, ARCHIVED, and CAMPAIGN_PAUSED (ad sets only; the campaigns level ignores it). Defaults to every status except DELETED and ARCHIVED. An unknown value is a 400.

level?string

Read only one level. Required with after. Both levels are read when omitted.

Value in

  • "campaign"
  • "adSet"
limit?integer

Maximum rows per level in this response.

Range1 <= value <= 500
Default200
after?string

Cursor from paging.campaigns.after or paging.adSets.after of a previous response. Requires level.

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.adaccounts.getAdAccountLiveEntities({  query: {    accountId: 'account_abc123',    adAccountId: 'adaccount_abc123',  },});console.log(data);
{  "accountId": "string",  "adAccountId": "string",  "platform": "facebook",  "currency": "string",  "readAt": "2019-08-24T14:15:22Z",  "campaigns": [    {      "platformCampaignId": "string",      "campaignName": "string",      "platformCampaignStatus": "string",      "configuredStatus": "string",      "status": "string",      "budget": {        "amount": 0,        "type": "daily"      },      "dailyBudget": 0,      "lifetimeBudget": 0,      "budgetRemaining": 0,      "spendCap": 0,      "bidStrategy": "string"    }  ],  "adSets": [    {      "platformAdSetId": "string",      "adSetName": "string",      "platformCampaignId": "string",      "platformAdSetStatus": "string",      "configuredStatus": "string",      "status": "string",      "budget": {        "amount": 0,        "type": "daily"      },      "dailyBudget": 0,      "lifetimeBudget": 0,      "budgetRemaining": 0,      "bidStrategy": "string",      "bidAmount": 0,      "optimizationGoal": "string",      "billingEvent": "string",      "promotedObject": {},      "targeting": {},      "schedule": {        "startDate": "2019-08-24T14:15:22Z",        "endDate": "2019-08-24T14:15:22Z"      }    }  ],  "paging": {    "campaigns": {      "after": "string"    },    "adSets": {      "after": "string"    }  }}
Was this page helpful?

Assign a user to a Page

Gives a person of the portfolio tasks on a Page the portfolio owns or was granted as a partner. Meta does not assign partner admins automatically, so after an owner shares a Page the partner calls this for the people whose tokens will advertise for it. `ADVERTISE` is what ad creation needs. Assigning an already assigned user replaces their task set.

Ad account users

People of a business portfolio assigned to a Meta ad account, with their tasks. Ids are business-scoped user ids (see `GET /v1/ads/businesses/users`).