Skip to main content
Version: v3

Get entities

GET 

/ad-publishing/facebook/entity

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.

Request

Version stringrequired

API Version

Available optionsv3
locationId stringrequired

Location identifier

type stringrequired

Integration source type

Available optionsAD_MANAGERINTEGRATION
next string

Pagination cursor

fetchAll string

Fetch all entities

campaignId string

Campaign identifier

adSetId string

Ad set identifier

entityType stringrequired

Entity type to fetch

Available optionsCAMPAIGNADSETAD
searchId string

Search identifier

selectedAdAccountId string

Selected ad account ID

application/json

Campaigns, ad sets, or ads, matching the requested entityType

Schema
    oneOf
    dataobject[]required

    Campaigns, shaped by the requested type

    nextstring

    Cursor for the next page, to be passed back as next. Present only on the INTEGRATION branch, and absent once the last page is reached.