Skip to main content
Version: v3

Upsert adset

PUT 

/ad-publishing/facebook/adsets

Create or update a Facebook ad set

Request

Version stringrequired

API Version

Available optionsv3
application/json

Bodyrequired

    idstring

    Ad set identifier

    locationIdstringrequired

    Location identifier

    namestring

    Ad set name

    pageIdstring

    Facebook page ID

    instagramActorIdstring

    Instagram actor ID

    messagingPlatformsstring[]

    Messaging platforms

    Available optionsWHATSAPPMESSENGERINSTAGRAM_DIRECT
    whatsappNumberstring

    WhatsApp phone number

    audienceobject

    Targeting audience configuration including geo-locations, locales, placements, and custom audiences

    budgetobject

    Ad set budget config

    conversionLocationstring

    Where the conversion happens. Valid values depend on the parent campaign objective — OUTCOME_LEADS: on_ad (instant form), website, website_and_lead_form; OUTCOME_SALES: website (pixel), messaging. Not validated server-side, so values outside this set are forwarded to Facebook and may be rejected there.

    customEventTypestring

    Facebook standard event optimised for. Only meaningful when conversionLocation is website (requires pixelId). Valid values depend on the parent campaign objective — OUTCOME_LEADS: COMPLETE_REGISTRATION, CONTACT, CONTENT_VIEW, FIND_LOCATION, LEAD, SCHEDULE, SEARCH, START_TRIAL, SUBMIT_APPLICATION, SUBSCRIBE; OUTCOME_SALES: ADD_PAYMENT_INFO, ADD_TO_CART, ADD_TO_WISHLIST, COMPLETE_REGISTRATION, CONTENT_VIEW, DONATE, INITIATED_CHECKOUT, PURCHASE, SEARCH, START_TRIAL, SUBSCRIBE. Not validated server-side, so values outside this set are forwarded to Facebook and may be rejected there.

    pixelIdstring

    Conversion pixel ID

    campaignIdstringrequired

    Parent campaign ID

application/json

The saved ad set

Schema
    idstringrequired

    Ad set identifier

    namestringrequired

    Ad set name

    campaignIdstringrequired

    Parent campaign id

    fbAdSetIdstring

    Facebook ad set id, set once published

    publishingStatusstringrequired

    Publishing status. On a published entity this is not the state you asked for but the effective_status Meta reports, mapped back — a pause or resume re-reads it live, so an ad awaiting review comes back IN_REVIEW rather than PAUSED or PUBLISHED. Any effective status this service does not recognise also maps to IN_REVIEW.

    Available optionsDRAFTSCHEDULEDPUBLISHINGPUBLISHEDPAUSEDIN_REVIEWWITH_ISSUESREJECTEDARCHIVEDFAILED
    fbErrorstringnullable

    Publish error from Facebook. null on reads when there is none.

    pageIdstringrequired

    Page the ads run under

    instagramActorIdstringnullable

    Instagram account the ads run under. null when not linked.

    messagingPlatformsstring[]required

    Messaging destinations for click-to-message ads. Empty for other conversion locations.

    conversionLocationstring

    Where the conversion happens

    budgetobjectrequired

    Budget configuration

    audienceobjectrequired

    Targeting

    unpublishedChangesboolean

    Whether the ad set has edits not yet published

    createdAtstringrequired

    Created at

    updatedAtstringrequired

    Updated at