propose_write
ads

Create an ad set under one of the store's Meta campaigns (Meta id or Magistry id), paused and read back; it spends nothi

Changed on

Create an ad set under one of the store's Meta campaigns (Meta id or Magistry id), paused and read back; it spends nothing until it and its campaign are resumed. Targeting: countries, age, gender, Custom Audiences to include or exclude, Advantage+ audience, or a full targeting_spec. optimization_goal defaults to purchases on the pixel for a Sales campaign, else link clicks. daily_budget (ad account currency) is the ad set's own budget: required when the campaign carries no budget, refused when the campaign holds it. Refused before any write when the campaign is not on this store's ad account.

post/api/v1/tools/meta_create_ad_set

Request

  • Base URL
    https://app.magistry.io
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization codehttps://app.magistry.io/api/oauth/authorize
      Token URLhttps://app.magistry.io/api/oauth/token
      Scopesads:write

Headers

Idempotency-Key, string

Required, here or as idempotency_key in the body. A unique string you choose for this request; send the SAME key when retrying and the first answer is returned instead of writing twice (idempotent-replayed: true). The same key with other arguments is 409 idempotency_conflict. If the header and idempotency_key are both sent they must be equal.

Request body

object required
campaign_id, string required

The campaign: Meta id or Magistry id.

name, string required
optimization_goal, 'OFFSITE_CONVERSIONS' | 'LINK_CLICKS' | 'LANDING_PAGE_VIEWS' | 'IMPRESSIONS' | 'REACH' | 'VALUE'
daily_budget, number

The ad set's own daily budget, ad account currency.

bid_amount, number

Bid cap, ad account currency (bid-cap strategies only).

countries, string[]

ISO 3166 alpha-2. Required unless targeting_spec is given.

age_min, integer
age_max, integer
genders, 'all' | 'male' | 'female'

Default all.

custom_audience_ids, string[]

Meta Custom Audience ids to include.

excluded_custom_audience_ids, string[]

Meta Custom Audience ids to exclude.

advantage_audience, boolean

Let Meta reach past this targeting (Advantage+ audience). Default true.

targeting_spec, object

A full Meta targeting spec (must carry geo_locations); wins over the fields above. A targeting change answers the ad set's previous spec as before in this shape.

idempotency_key, string required

Required. A unique string you choose for this request. Send the SAME key when retrying after a timeout and Magistry returns the original outcome instead of performing the write twice. Reusing a key with different arguments is refused rather than replayed.

Response

Tool result

object required
ok, boolean required
result, unknown required

Changes

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    11 more changes in this revision