/spotify-ads-api:bulk pause | resume | budget | delivery | archive | creative | trackingfrom spotify-ads-api
Stages batch changes to Spotify Ads API campaigns, ad sets, and ads through drafts — pause, resume, budgets, delivery, archive, creative, and tracking.
Ships in spotify-ads-api. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Apply batch changes to multiple entities in a single workflow. Campaign hierarchy changes are staged through drafts by default, grouped and validated by parent campaign, and never published automatically.
Set the plugin root and define the request wrapper:
PLUGIN_ROOT="${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-.}}"
api() { "$PLUGIN_ROOT/scripts/api-request.sh" bulk "$@"; }
Before the first Ads API v3 call, read and follow $PLUGIN_ROOT/skills/api-reference/references/live-openapi.md.
Before sending any output to a human user, read and follow $PLUGIN_ROOT/skills/api-reference/references/language-standards.md.
Also read $PLUGIN_ROOT/skills/api-reference/references/api-behaviors.md for API behaviour the spec does not express (no DELETE on live entities, micro-amounts, retry safety).
To retrieve settings values (TOKEN, AD_ACCOUNT_ID, AUTO_EXECUTE, BASE_URL, SDK_HEADER, SKILL_HEADER, PLUGIN_VERSION) for use outside API calls, run api --env. The output is eval-safe, so eval $(api --env) assigns them all.
Parse the user's argument to determine the operation:
pause — Pause multiple active ad sets or campaignsresume — Resume paused ad sets or campaignsbudget — Update budgets across selected ad setsdelivery — Toggle ad delivery ON/OFFarchive — Archive multiple entitiescreative — Swap creative assets across adstracking — Update third-party tracking across adsAll operations optionally accept a campaign filter: pause --campaign <campaign_id> narrows the entity list to a specific campaign.
All operations follow this pattern:
Fetch entities matching the operation's criteria. Present as a numbered table:
Active Ad Sets (5 found):
| # | ID | Name | Campaign | Budget | Format |
|---|----|------|----------|--------|--------|
| 1 | abc... | US 18-34 Audio | Summer Promo | $75/day | AUDIO |
| 2 | def... | US 25-54 Video | Summer Promo | $50/day | VIDEO |
| 3 | ghi... | UK All Audio | Q2 Brand | $100/day | AUDIO |
| 4 | jkl... | CA 18-44 Audio | Q2 Brand | $60/day | AUDIO |
| 5 | mno... | US All Display | Podcast Launch | $40/day | IMAGE |
Ask the user to select entities. Support these selection formats:
1, 3, 51-3all1-3, 5Before showing the final change summary, read and follow
$PLUGIN_ROOT/skills/api-reference/references/ad-product-validation.md. Fetch the live
catalog once for the batch, fetch each current entity, resolve each distinct parent
campaign once, and validate the final effective entities. Group validation by campaign
and product instead of repeating catalog or campaign requests for every entity.
For budget decreases, retrieve any available spend and pacing state needed to apply the catalog's delivery floor. Treat cooldowns or account exemptions that the public API does not expose as server-only checks; do not claim they passed and do not add a user confirmation for them.
Show a summary of what will change. For budget operations, show before/after values. For status changes, show entity names and the target state. Include one compact catalog-validation status in this existing summary. Do not print per-field checklists or add a separate confirmation.
Ad set and ad pause, resume, and delivery toggles skip this step: they are confirmed live delivery PATCHes (see Operations), with no draft and no VALIDATE. Report them as "Applied live".
Group selected entities by parent campaign. For each target, check for an existing same-ID draft and disclose pending changes. If none exists, create a draft from the published entity, then PATCH the draft endpoint. Preserve fields the user did not request to change.
Draft creates may run in a loop, one loop per campaign. Break at the first non-2xx HTTP_STATUS: so you can read the error before sending more creates:
for AD_SET_ID in $AD_SET_IDS; do
out=$(api POST "ad_accounts/{ad_account_id}/ad_sets/$AD_SET_ID/drafts")
echo "$out"
case "$out" in *"HTTP_STATUS:2"*) ;; *) break ;; esac
done
After a failure, read the error. If it is the max-ad-set-drafts 400, stop that campaign (see below). After a non-limit failure, skip that ad set and its dependents, then resume the loop with the ad sets not yet attempted. Only the max-ad-set-drafts 400 stops the whole campaign.
If creating a draft fails, skip every step that depends on it: its PATCH, draft ads under it, reads of it, and its campaign's VALIDATE. Report those targets as skipped. Continue only with targets that don't depend on the failed draft.
A campaign can hold only a limited number of ad set drafts, and stale drafts accumulate on heavily edited campaigns. The limit isn't a fixed public value. If create-from-published returns 400 saying the campaign has reached the maximum number of ad set drafts, stop all remaining work for that campaign, because every further create there fails the same way. Don't retry. Report the error message and which targets were staged and which were skipped. Then list the campaign's ad set drafts (api GET "ad_accounts/{ad_account_id}/drafts/ad_sets?campaign_ids=$CAMPAIGN_ID&limit=50", paging with offset) and offer to validate and publish them, or to delete stale ones (draft DELETE is safe to retry). Resume only after the user chooses. Continue with other campaigns. Bulk draft creates (drafts/ad_sets/bulk, drafts/ads/bulk) are atomic, so one item over the limit fails the whole request. Split the request or clean up first. The spec also caps each request: bulk create takes at most 40 draft ad sets or 100 draft ads, and bulk delete (DELETE drafts/ad_sets or DELETE drafts/ads) takes at most 40 draft ad set IDs or 100 draft ad IDs.
After staging all selected changes, fetch each affected draft campaign's current draft_hierarchy_version and validate once per campaign. Run the start-time recheck below before each VALIDATE. Do not validate a campaign until all successful edits for that campaign are staged, and skip VALIDATE for a campaign stopped by the draft limit.
The live ad product catalog's start_time constraint text (in its constraint and required-field lists) states the minimum lead time. Apply it when choosing start times. When the user gives no exact start time, propose one well clear of that minimum, such as the start of the hour after next, so it stays valid through staging and confirmation. If the user wants an exact time close to the minimum, warn that it can expire before validation. Times that were valid at staging can expire during a long batch. Immediately before each VALIDATE (and again before PUBLISH), compare every staged ad set start_time in that campaign with the current UTC time and the catalog's minimum. If any falls short, don't validate. Show the affected ad sets and propose a later start time, or ask whether the exact time matters. PATCH only after the user agrees, then refetch draft_hierarchy_version. If VALIDATE still returns INVALID.AD_SET.START_TIME_TOO_CLOSE, follow the error message and handle it the same way. Never re-validate an unchanged hierarchy.
Display a final summary table:
Bulk Pause Staging Results:
| Campaign | Status | Result |
|--------|--------|--------|
| Summer Sale | PAUSED | Staged; validation passed |
| Holiday Promo | PAUSED | Staged; validation passed |
| Spring Launch | — | Failed: [what went wrong, in plain words] |
2/3 changes staged. Nothing was published.
For live delivery changes, use the result "Applied live" and say the changes are already in effect instead of "Nothing was published".
pausePause multiple active ad sets or campaigns.
api GET "ad_accounts/{ad_account_id}/ad_sets?statuses=ACTIVE&limit=50&sort_direction=DESC"
To filter by campaign: add &campaign_ids=$CAMPAIGN_ID.
To pause campaigns instead of ad sets, ask the user first, then:
api GET "ad_accounts/{ad_account_id}/campaigns?statuses=ACTIVE&limit=50&sort_direction=DESC"
Ad sets have no PAUSED status; they pause through delivery. Draft ad sets and ads cannot carry delivery, so this is a live change: show the full list and get explicit confirmation before the first request. Then, for each selected ad set (delivery must be the only field in the body):
api PATCH "ad_accounts/{ad_account_id}/ad_sets/$AD_SET_ID" \
'{"delivery":"OFF"}'
For campaigns, create or reuse the campaign draft and PATCH /drafts/campaigns/{id} with {"status":"PAUSED"} instead.
Skip entities that are already paused (ad sets with is_paused: true, campaigns with status PAUSED) — note them as "Already paused, skipped" in the results.
resumeResume paused ad sets or campaigns.
api GET "ad_accounts/{ad_account_id}/ad_sets?delivery=OFF&limit=50&sort_direction=DESC"
Keep only ad sets with is_paused: true and pause_reason: USER_PAUSED (statuses=PAUSED is not a valid ad set filter). Ad sets paused for an account-level reason cannot be resumed through delivery; list them separately and tell the user the account issue must be resolved. For campaigns, list with statuses=PAUSED.
Draft ad sets and ads cannot carry delivery, so this is a live change: show the full list and get explicit confirmation before the first request. Then, for each selected ad set:
api PATCH "ad_accounts/{ad_account_id}/ad_sets/$AD_SET_ID" \
'{"delivery":"ON"}'
For campaigns, create or reuse the campaign draft and PATCH /drafts/campaigns/{id} with {"status":"ACTIVE"}.
budgetUpdate budgets across multiple ad sets.
api GET "ad_accounts/{ad_account_id}/ad_sets?limit=50&sort_direction=DESC"
Present the table with current budget amounts (convert micro_amount ÷ 1,000,000 to the ad account's billing currency) and budget type (DAILY/LIFETIME).
After selection, ask how to change the budget:
Budget changes (+20%):
| Ad Set | Budget Type | Current | New |
|--------|-------------|---------|-----|
| US 18-34 Audio | DAILY | $75.00 | $90.00 |
| UK All Audio | DAILY | $100.00 | $120.00 |
Proceed with these changes?
For each selected ad set, create or reuse its draft, then:
api PATCH "ad_accounts/{ad_account_id}/drafts/ad_sets/$AD_SET_ID" \
'{"budget":{"micro_amount":<NEW_MICRO_AMOUNT>,"type":"<DAILY|LIFETIME>"}}'
Always convert amounts to micro-amounts (multiply by 1,000,000).
deliveryToggle ad delivery ON or OFF across multiple ads.
api GET "ad_accounts/{ad_account_id}/ads?limit=50&sort_direction=DESC"
To filter by ad set: add &ad_set_ids=$AD_SET_ID (repeat per ad set). Ads have no campaign_ids filter, so for a campaign list its ad sets first with ad_sets?campaign_ids=$CAMPAIGN_ID.
Present the table showing current delivery status (ON/OFF), ad name, ad set name, and status.
Ask the user: toggle all selected to ON, or toggle all to OFF?
Draft ad sets and ads cannot carry delivery, so this is a live change: show the full list and get explicit confirmation before the first request. Then, for each selected ad:
api PATCH "ad_accounts/{ad_account_id}/ads/$AD_ID" \
'{"delivery":"ON"}'
Skip ads already in the target delivery state.
archiveStage archival of multiple entities. The draft can be reviewed or deleted before publishing, but publishing an archive is effectively permanent because campaigns, ad sets, and ads cannot be unarchived.
Ask the user: "What do you want to archive — campaigns, ad sets, or ads?"
Fetch non-archived entities of the selected type:
# For ad sets:
api GET "ad_accounts/{ad_account_id}/ad_sets?limit=50&sort_direction=DESC"
# then drop ad sets whose status is already ARCHIVED (paused ad sets are not a status; they show is_paused: true)
Before staging, warn: "Publishing these staged archive changes will be effectively permanent. Archived entities cannot be reactivated. Stage these changes for review?"
For each selected entity, create or reuse its draft, then:
api PATCH "ad_accounts/{ad_account_id}/drafts/ad_sets/$AD_SET_ID" \
'{"status":"ARCHIVED"}'
trackingUpdate third_party_tracking across multiple ads. This is the default workflow for requests to fix, add, remove, or replace impression, click, quartile, completion, or viewability trackers.
List candidates, then fetch every selected published ad so the current tracking array is available. Present the existing trackers with measurement_event, measurement_partner, and a safely shortened URL.
Apply the user's requested transformations while preserving entries they did not ask to remove or replace. Strip or rewrite URL macros only as explicitly requested. Set measurement_event on every entry; use CLICKED for click trackers and IMPRESSION for impression trackers.
Show a before/after summary and ask for confirmation.
For each selected ad, check for an existing same-ID draft. Create one from the published ad only after a 404, then PATCH the draft with the complete intended tracking array:
api GET "ad_accounts/{ad_account_id}/drafts/ads/$AD_ID"
api POST "ad_accounts/{ad_account_id}/ads/$AD_ID/drafts" # only after draft GET returns 404
api PATCH "ad_accounts/{ad_account_id}/drafts/ads/$AD_ID" \
'{"third_party_tracking":[...]}'
Resolve the parent draft campaign for every ad, group by campaign, and validate once per affected campaign after all successful tracking patches are staged. Report that nothing was published.
creativeSwap creative assets across multiple ads.
The live PATCH /ads/{id} endpoint does not support updating asset fields, but draft ads do. Create or reuse a same-ID draft for each selected published ad and update its assets field. Preserve third-party tracking exactly unless the user explicitly asks to remove or change tracking.
api GET "ad_accounts/{ad_account_id}/ads?limit=50&sort_direction=DESC"
Present table showing ad name, current asset, ad set, delivery status.
api GET "ad_accounts/{ad_account_id}/assets?statuses=READY&limit=50&sort_direction=DESC"
Present table of available assets filtered to READY status.
Ask the user to select which ads to update and which new asset to use. The new asset must match the ad set's asset_format (AUDIO, VIDEO, or IMAGE).
Read the existing ad:
api GET "ad_accounts/{ad_account_id}/ads/$AD_ID"
The batch validation step must include the current ad, its parent ad set and campaign, the replacement asset, and the final replacement-ad body.
Check for or create the draft:
api GET "ad_accounts/{ad_account_id}/drafts/ads/$AD_ID"
api POST "ad_accounts/{ad_account_id}/ads/$AD_ID/drafts" # only after draft GET returns 404
Update the draft ad with the complete intended assets object:
api PATCH "ad_accounts/{ad_account_id}/drafts/ads/$AD_ID" \
'{
"assets": {
"asset_id": "<NEW_ASSET_ID>",
"logo_asset_id": "<same_logo>",
"companion_asset_id": "<same_companion>"
}
}'
Resolve each draft ad's parent draft campaign and validate once per affected campaign after all swaps are staged. Do not archive the published ad and do not create a replacement live ad.
Creative Swap Results:
| Draft Ad | Published ID | Asset | Result |
|----------|--------------|-------|--------|
| 30s Spot A | abc... | new-audio.mp3 | Staged; validation passed |
| 30s Spot B | ghi... | new-audio.mp3 | Staged; validation passed |
2/2 swaps staged. Nothing was published.
auto_execute is true, stage and validate after the user confirms the change summary. The listing and selection steps always require user interaction regardless of auto_execute.auto_execute is false, present each curl command and ask for confirmation before executing.HTTP_STATUS: line from curl output to determine success or failure before interpreting the response body.--campaign <id>) to narrow results.PUBLISH request./spotify-ads-api:dashboard./spotify-ads-api:drafts stage-edit <campaign|ad-set|ad> <id> <changes>./spotify-ads-api:assets list.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
20 skills in this plugin
/account-adminAdminister Spotify Ads API businesses and ad accounts: discover businesses and accounts, inspect or update supported profile and billing fields, create businesses or ad accounts, list members and roles, invite users, assign ad-account access, update roles, cancel invitations, and remove access. Use when a user asks to find an ad account by ID, audit access, onboard an agency or teammate, manage business/ad-account membership, or update supported account identity details./adsList or get Spotify Ads API ad sets and ads, and stage their creation or updates through drafts by default. Use direct live writes only when explicitly requested./spotify-ads-api-referenceThis skill should be used when the user asks to "call the Spotify Ads API", "create a Spotify ad campaign", "manage Spotify ads", "pull Spotify ad reports", "set up ad sets or ads", "upload ad assets", "target audiences on Spotify", "check campaign status", "get ad account info", "look up API schema or fields", "check what targeting options exist", or asks about Spotify advertising endpoints, request/response formats, enum values, or authentication./assetsUpload, list, and manage Spotify Ads API creative assets — audio, video, and images for ad campaigns./audiencesManage Spotify Ads API audiences: upload or replace customer lists, create custom web-event or ad-engagement audiences, create lookalikes, list/get/edit audiences, inspect eligible datasets, and delete audiences. Use when a user asks to onboard first-party data, retarget people who saw or clicked ads, build an event-based audience, create a lookalike, replace an audience file, check audience status, or remove an audience./build-campaignCreate a full campaign (campaign + ad sets + ads) from a plain-text description. Parses natural language into structured API calls. Prefers the draft workflow for safer creation with batch validation.Other plugins' skills for the same job
npx claudepluginhub spotify/ads-agentic-tools --plugin spotify-ads-api