Call it
curl https://api.peume.com/v1/call/update-an-ad-set \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"adSetId": "your adSetId",
"platform": "facebook"
}
}'const res = await fetch("https://api.peume.com/v1/call/update-an-ad-set", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"adSetId": "your adSetId",
"platform": "facebook"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/update-an-ad-set",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"adSetId": "your adSetId",
"platform": "facebook"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: update-an-ad-set.
Parameters
adSetIdRequiredstringPlatform ad set ID
validateOnlybooleanMeta only. Sends every write of this update to Meta with `execution_options: ["validate_only"]`. Meta checks it and changes nothing; stores nothing and fires no webhook. - Answers `200` with `{ validateOnly: true, results, message }`, the shape of a validateOnly POST /v1/ads/create. - The checks runs before the write (body, bid strategy, live ads allowance) run as for a real update. - `true` on any other platform is a 400 naming `validateOnly`; `false` is ignored. - Cannot be combined with `stage` (400 `mutually_exclusive_fields`). Counts toward the Meta ad account write guar
stagebooleanSend true to stage this change instead of applying it. Nothing is written to the ad network; the response is `202` with the staged change and its diff. Apply it with POST /v1/ads/changes/{changeId}/confirm. Meta, Google, TikTok, X, Snapchat and Reddit; cannot be combined with `validateOnly` or `dryRun`.
platformRequiredstringfacebook · instagram · tiktok · linkedin · pinterest · google · twitter · openai · reddit · snapchat
budgetobjectOmit if not updating budget
statusstringWrites the ad set's own on/off switch (Meta: `configured_status`; X: the line item's `entity_status` ACTIVE / PAUSED), whatever delivery status its ads report. Omit if not toggling delivery state.
active · paused
namestringRename the ad set. At least one of budget/status/bidStrategy/name is required. Supported on Meta, Google (the ad group), TikTok, LinkedIn (the campaign), Pinterest, X (the line item `name`), OpenAI and Reddit. Platforms without a rename return 501. The new name is stored right away, so GET /v1/ads/ad-sets and GET /v1/ads/tree return it without a sync.
bidStrategystringAd-set-level bid strategy. Overrides the campaign-level default. - **Meta** (facebook, instagram): supported. - **TikTok:** the Meta-style enum is mapped to bid_type / bid_price / deep_bid_type automatically. - **OpenAI:** LOWEST_COST_WITH_BID_CAP and COST_CAP both map to the ad group's `bidding_config.max_bid_micros` (one knob covers both). LOWEST_COST_WITH_MIN_ROAS is rejected with 422 (no ROAS-based bidding). - **X:** writes the line item's `bid_strategy`: LOWEST_COST_WITHOUT_CAP = AUTO, LOWEST_COST_WITH_BID_CAP = MAX, COST_CAP = TARGET, with `bidAmount` as `bid_amount_local_micro`. LOWEST
dsaBeneficiarystringMeta only (400 elsewhere, before anything in the request is written). Writes the ad set's `dsa_beneficiary`, the legal entity that benefits from its ads. Same field and limits as `dsaBeneficiary` on POST /v1/ads/create. Only the fields you send are written. This is the EU DSA field. For regional regimes (Brazil, Malaysia, Thailand, Australia, Singapore, Taiwan, India) use `regionalRegulatedCategories` and `regionalRegulationIdentities` instead. Read it back with GET /v1/ads/ad-sets/{adSetId}?accountId={accountId}&fields=dsa_beneficiary,dsa_payor.
dsaPayorstringMeta only (400 elsewhere, before anything in the request is written). Writes the ad set's `dsa_payor`, the legal entity that pays for its ads, same field and limits as `dsaPayor` on POST /v1/ads/create. Can differ from `dsaBeneficiary`.
regionalRegulatedCategoriesarrayMeta only (400 elsewhere, before anything in the request is written). Writes the ad set's `regional_regulated_categories`, same values as on POST /v1/ads/create (AUSTRALIA_FINSERV, AUSTRALIA_UNIVERSAL, BRAZIL_REGULATION, INDIA_FINSERV, MALAYSIA_UNIVERSAL, SINGAPORE_UNIVERSAL, TAIWAN_FINSERV, TAIWAN_UNIVERSAL, THAILAND_UNIVERSAL, US_SECURITIES_LICENSING). Send it with `regionalRegulationIdentities`. An empty array is a 400.
regionalRegulationIdentitiesobjectMeta only (400 elsewhere, before anything in the request is written). Writes the ad set's `regional_regulation_identities`: the Verified identity IDs of the beneficiary and payer for each declared category. - Same keys and validation as on POST /v1/ads/create (for example `universal_beneficiary` / `universal_payer` for BRAZIL_REGULATION, MALAYSIA_UNIVERSAL, THAILAND_UNIVERSAL and US_SECURITIES_LICENSING). - Send each ID as a string of digits; an empty object is a 400. - When Meta refuses the ad set for a missing verified advertiser, the 400 `platform_api_error` names the expected keys in `det
smartTargetingobjectTikTok only (a 400 elsewhere). TikTok Smart Targeting on the ad group: `audience` is TikTok's `smart_audience_enabled`, `interestsBehaviors` its `smart_interest_behavior_enabled`. When on, TikTok may deliver beyond the selected audiences or interests. Available on Video views, Traffic, Lead generation, App install, Web conversion and Community interaction. Only the flags you send are written. An unwritten flag reads back null in `nativeSettings`, so send `false` explicitly to be able to verify it is off. Applied with TikTok's adgroup/update; read it back with GET /v1/ads/ad-sets?adSetId=...&
placementsobjectMeta only (400 elsewhere). Manual placements, with the same object and enums as `placements` on POST /v1/ads/create. - **Object:** REPLACES the ad set's current placement set (`publisher_platforms`, every `*_positions` list and `device_platforms`). A position list you leave out is removed. An object with no non-empty list is a 400 (send `null` instead). - **`null`:** removes every placement key, so Meta returns to automatic (Advantage+) placements. - **Omitted:** placements are left untouched. Meta enforces co-selection rules (e.g. a position needs its publisher platform) and its error is re
startDatestringReddit only: the ad group's new start_time, ISO 8601. A value without an offset (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SS`) is read in the ad account timezone. It cannot be earlier than the start of a campaign that starts in the future, nor at or after the ad group's end (400, `param: startDate`). Every other platform ignores it (nothing is written and no error is returned, so a body that also sends `status` still applies it). Meta takes it in `platformSpecificData.startDate`.
endDatestringReddit only. The ad group's new end_time, ISO 8601, read in the ad account timezone when it has no offset; a date alone means the end of that day. `null` removes the end date so the ad group runs continuously. Every other platform ignores it: nothing is written and no error is returned, so a body that also sends `status` still applies it. Meta takes it in `platformSpecificData.endDate`. Returns 400 with `param: endDate` when: - it is not after the start - it falls after the campaign's end - the campaign uses campaign budget optimization with no end date (Reddit then takes no end date on its
rawTargetingobjectMeta only. Meta-native targeting keys (snake_case, as GET /v1/ads/{adId} returns them) layered over the ad set's live targeting before `targeting` is applied. Each key replaces its live counterpart and `null` removes it.
targetingstringTargeting fields to change. Meta and Reddit (400 elsewhere). **Reddit** (see the description above): - `languages` must be among Reddit's ISO 639-1 codes (AR, CS, DA, DE, EL, EN, ES, FI, FR, HU, IT, JA, KO, NL, NO, PL, PT, RO, SV, VI, ZH, any case). - Emptying every included location is a 400 with `param: targeting.countries`. - Fields Reddit ad groups cannot take (age, income, devices, behaviors, B2B, `places`) return 400 with `param: targeting.<field>`. **Meta**: same shape as the `targeting` object on POST /v1/ads/create. - Only the keys you send change. reads the ad set's live t
bidAmountnumberBid cap in WHOLE currency units (USD: 5 = $5.00; JPY: 100 = ¥100). Required when bidStrategy is LOWEST_COST_WITH_BID_CAP or COST_CAP. Internally converted to Meta's smallest-denomination integer, or (on OpenAI and X) to micros (× 1,000,000). Meta only: may be sent alone, WITHOUT bidStrategy, to update the cap amount on an ad set whose parent campaign is COST_CAP or LOWEST_COST_WITH_BID_CAP. The strategy is inherited from the campaign and left untouched.
roasAverageFloornumberMinimum ROAS as a decimal multiplier (2.0 = 2.0x). Required when bidStrategy is LOWEST_COST_WITH_MIN_ROAS. Sent to Meta as `bid_constraints.roas_average_floor` × 10000. Not supported on OpenAI (422). Meta only: may be sent alone, WITHOUT bidStrategy, to update the floor on an ad set whose strategy (its own, or the campaign's under CBO) is LOWEST_COST_WITH_MIN_ROAS.
valueRuleSetIdstringMeta only (other platforms return 501). Value rule set to attach to this ad set, from `/v1/ads/value-rule-sets`. Sending a different id replaces the current association. To DETACH, send `valueRulesApplied: false` and omit this field.
valueRulesAppliedbooleanMeta only (other platforms return 501). `false` DETACHES the ad set's value rule set and must be sent WITHOUT `valueRuleSetId`; the combination returns 400. `true` is optional when attaching, since attachment is driven by `valueRuleSetId`, and requires it to be present.
platformSpecificDataobjectPlatform-specific post-launch delivery settings. The platform is implied by the `platform` body param. Meta and TikTok (`placements` only); other platforms return 400. Unknown keys are rejected.
