Skip to main content
Version: v3

Facebook Ads

Documentation for Ad-publishing API

📄️Get conversion pixels

Retrieve Facebook conversion pixels for a location. `channel` selects between two unrelated behaviours. For `FACEBOOK` (the default) the response is `{ items, total }`, or a paginated `{ items, paging }` envelope when `limit` (max 100) is given — pass `after` from `paging.next` for the next batch — and `projection` (comma-separated, from `createdAt`, `fbIsCrmPixel`, `fbPixelCode`, `fbPixelId`, `name`, `type`) narrows each item. For `IG` the response is instead a bare array of Instagram datasets carrying only an id, and `limit`, `after`, and `projection` are ignored.

📄️Get custom audiences

Retrieve Facebook custom audiences for a location. Without `limit` the response is a plain array. When `limit` is provided (max 100) the response is a paginated `{ customAudiences, paging }` envelope; pass `after` (from `paging.next`) to fetch the next batch. By default each item is returned in full; pass `projection` (comma-separated, dot-notation for nested fields, e.g. ?projection=id,name,dataSource.type) to return only the requested fields — any value outside the known field set is rejected.

📄️Get entities

Retrieve campaigns, ad sets, or ads for a location. `entityType` selects which, and each returns a `{ data }` envelope whose item shape differs — the id key is `campaignId`, `adSetId`, or `adId` respectively, and the status fields differ too: campaigns carry both `status` and `effectiveStatus`, ad sets only `effectiveStatus`, and ads only `status`. `next` is returned only when the branch pages through Meta, so treat its absence as the end of the results rather than assuming a cursor. For `CAMPAIGN`, `type=INTEGRATION` queries Meta while `type=AD_MANAGER` reads campaigns this service published, filtered to `PAUSED` and `PUBLISHED`. `ADSET` requires `campaignId`; `AD` accepts `adSetId` for a single ad set or `campaignId` to page across the campaign.