---
title: "Edit a Meta ad set (targeting is merged)"
method: POST
path: "/api/v1/tools/meta_update_ad_set/execute"
tags: ["Meta Ads"]
---

# Edit a Meta ad set (targeting is merged)

`POST /api/v1/tools/meta_update_ad_set/execute`

## Request

- Base URL: `https://adako.ai`
- URL: `https://adako.ai/api/v1/tools/meta_update_ad_set/execute`
- Auth: HTTP bearer

Changes one ad set's targeting, optimisation goal, schedule, DSA fields or name. Targeting is **merged**: every add and remove is applied to the spec Meta currently holds, so nothing you did not name is lost. The preview shows the merged result field by field before anything is sent.
Use when: the user wants to widen, narrow or correct an existing audience, or shift its schedule.
Do not use to change the budget (meta_update_adset_budget) or to pause it (meta_pause_entity).
Do not change targeting on an ad set that is still learning unless the user accepts that learning restarts and delivery gets worse first — the preview warns when that applies.
Do not pass free text: interests, behaviours and locations must be ids from meta_search_targeting or meta_browse_targeting.
Returns the ad set read back from Meta, so the merged targeting is confirmed rather than assumed.
If a removal would leave the ad set with no location or no detailed targeting at all, the tool refuses or warns — ask the user what they intended instead of guessing. It also refuses EU/EEA locations added to an ad set without dsa_beneficiary and dsa_payor (ask the user for both), unknown location keys, past dates, placement combinations Meta rejects, and targeting the campaign's special ad category forbids.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `arguments` object, required
    - `ad_account_id` string: Meta ad account id such as act_1234567890. Omit it to use the primary account; if several accounts are active and none is primary the call fails and lists the valid ids.
    - `ad_set_id` string, required: The ad set to change, from meta_list_ad_sets.
    - `name` string: New ad set name.
    - `add_countries` string[]: ISO 3166-1 two-letter country codes to add to the existing locations (GB, not UK).
    - `remove_countries` string[]: Two-letter country codes to remove. The ad set must keep at least one location.
    - `add_region_keys` string[]: Region keys to add, from meta_search_targeting. Checked with Meta first.
    - `remove_region_keys` string[]: Region keys to remove.
    - `add_city_keys` string[]: City keys to add, from meta_search_targeting (not postcodes or media markets). Each gets a 25 km radius.
    - `remove_city_keys` string[]: City keys to remove.
    - `add_interest_ids` string[]: Interest ids to add, from meta_search_targeting or meta_browse_targeting.
    - `remove_interest_ids` string[]: Interest ids to remove.
    - `add_behavior_ids` string[]: Behaviour ids to add.
    - `remove_behavior_ids` string[]: Behaviour ids to remove.
    - `add_custom_audience_ids` string[]: Custom audience ids to include, from meta_list_custom_audiences.
    - `remove_custom_audience_ids` string[]: Custom audience ids to stop including.
    - `add_excluded_custom_audience_ids` string[]: Custom audience ids to exclude, e.g. existing customers.
    - `remove_excluded_custom_audience_ids` string[]: Custom audience ids to stop excluding.
    - `age_min` integer: New minimum age.
    - `age_max` integer: New maximum age.
    - `genders` 'all' | 'men' | 'women': New gender targeting.
    - `publisher_platforms` string[]: Replace the placement platforms with exactly this list. Omit to leave placements alone (Advantage+ placements). audience_network cannot be the only one, and threads needs instagram.
    - `device_platforms` string[]: Replace the device targeting with exactly this list.
    - `advantage_audience` boolean: Turn Advantage+ audience on or off for this ad set.
    - `optimization_goal` string: New optimisation goal. Must be valid for the campaign objective; delivery relearns.
    - `start_time` string: New start: YYYY-MM-DD (00:00 in the ad account's time zone) or an ISO timestamp with a UTC offset. Not in the past.
    - `end_time` string: New end: YYYY-MM-DD (23:59:59 in the ad account's time zone) or an ISO timestamp with a UTC offset.
    - `dsa_beneficiary` string: Who benefits from the ad. Required when this change adds EU/EEA locations to an ad set that has no beneficiary yet.
    - `dsa_payor` string: Who pays for the ad. Required when this change adds EU/EEA locations to an ad set that has no payor yet.
    - `idempotency_key` string: Optional caller-supplied key; identical keys never execute twice.
    - `raw_data` boolean: Return compact JSON only (no markdown). Use when you will compute on the result.

## Response `200`

The tool ran. A write returns proposal_id and approve_url while the change waits for approval.

- SuccessEnvelope
  - `success` unknown, required
  - `tool` string, required
  - `data` object, required: Machine-readable result.
  - `markdown` string, required: The same result written for a person or a model.
  - `quota` Quota: Task usage for the current billing period.
    - `plan` string
    - `used` integer
    - `limit` integer
    - `period_end` string
    - `upgrade_url` string
  - `proposal_id` string: Present for writes. Nothing changes on the ad platform until it is approved.
  - `approve_url` string: Where a person approves the proposal.
  - `request_id` string, required

## Other responses

- `400`: Invalid arguments, or the ad account could not be resolved.
- `401`: Missing, invalid, revoked or expired API key.
- `402`: Monthly task quota used up, or the plan does not include this tool.
- `403`: The connected ad account lacks the access level this tool needs.
- `404`: Unknown tool name.
- `409`: Not connected, reconnect needed, confirmation required, a proposal already pending or no longer pending, an identical create that failed earlier today (proposal_failed_before), a create that duplicates an approved one (duplicate_create), the ad-account limit of the plan reached (account_limit), or an Idempotency-Key reused with different arguments.
- `429`: Rate limited by Adako or by the ad platform. See Retry-After.
- `500`: Unexpected error inside Adako.
- `502`: The ad platform returned an error.

---

[API](https://skmtc.dev/adako/apis/adako-rest-api.md) · [All operations](https://skmtc.dev/adako/apis/adako-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/adako/apis/adako-rest-api/revisions/59ee60d48a56?raw)
