propose_write
ads

Replace one Meta ad set's targeting (countries, age, gender, Custom Audiences, Advantage+ audience, or a full targeting_

Changed on

Replace one Meta ad set's targeting (countries, age, gender, Custom Audiences, Advantage+ audience, or a full targeting_spec). The answer carries the targeting Meta held before as before: sending it back as targeting_spec is the undo. Read back after the write. Widening an active ad set's audience can change what it spends.

post/api/v1/tools/meta_update_targeting

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
ad_set_id, string required

The ad set: Meta id or Magistry id.

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