/spotify-ads-api:ads ad-sets list|create|get|update | ads list|create|get|update | *-live for explicit direct writesfrom spotify-ads-api
Manages Spotify Ads API ad sets and ads with draft-first workflow. Lists, creates, gets, and updates resources via staged drafts; supports explicit live writes.
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.
Manage ad sets and ads via the Spotify Ads API. Read settings from the active platform settings file.
Set the plugin root and define the request wrapper:
PLUGIN_ROOT="${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-.}}"
api() { "$PLUGIN_ROOT/scripts/api-request.sh" ads "$@"; }
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 (estimates and min-audience-threshold handling, geo lookup, micro-amounts, Reserved pricing).
Critical rules:
targets.placements).placements when creating an ad set and on every audience estimate, using only values the ad product catalog allows for that product's ad sets (and any narrower limit the objective's spec description states). On ad set updates, keep a valid placements in the merged result.draft_hierarchy_version from the draft campaign.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.
The argument format is: <resource> <operation> [id]
ad-sets or adslist, create, get, updateFor create and update, default to draft endpoints even when the user does not mention drafts. create-live and update-live are explicit escape hatches for direct published writes.
ad-sets listapi GET "ad_accounts/{ad_account_id}/ad_sets?limit=50&sort_direction=DESC"
Format as table: ID | Name | Campaign ID | Status | Format | Budget | Start
ad-sets createCollect the required fields below first. Before the POST, read and follow
$PLUGIN_ROOT/skills/api-reference/references/ad-product-validation.md. Fetch the live
catalog, parent campaign, and any runtime inputs required by its rules, then validate
the final ad set body against ad_set.create plus ad_set.both. Do not add a separate
validation confirmation.
Prompt for required fields:
ADV_X_Y code, fetch from GET /ad_categories if needed)"age_ranges": [{"min": 18, "max": 34}]"genders": ["MALE", "FEMALE", "NON_BINARY"]"platforms": ["ANDROID", "DESKTOP", "IOS"] (NOT "MOBILE" or "CONNECTED_DEVICE")"placements": ["MUSIC"]MAX_BID, COST_PER_RESULT, AUTOBID, or UNSET. Default to MAX_BID.15000000, ¥160 JPY = 160000000Important: Convert amounts to micro-amounts by multiplying by 1,000,000. This applies to both budget.micro_amount and bid_micro_amount.
Ad set validation guardrails before any POST:
budget.micro_amount; ask for a positive budget and convert it to micro-units.bid_micro_amount: 0 with MAX_BID or COST_PER_RESULT; ask for a positive bid cap.bid_strategy=UNSET, omit bid_micro_amount unless the current API contract or user-provided source requires it. For Reserved buys, follow the live product rules and use the fixed rate returned by reserved_prices as bid_micro_amount.budget to micro_amount and type; do not include currency on ad set create payloads.targets.platforms values are only ANDROID, DESKTOP, and IOS; never send WEB, MOBILE, CONNECTED_DEVICE, or ad_platforms.cost_model, skippable, is_skippable, or ad_platforms in ad set create payloads.min >= 18 unless the user has explicitly confirmed a market/category that allows minors.city_ids, postal_code_ids, or region_ids, include the parent country_code in the same geo_targets object.Structure: geo_targets is a flat object (NOT an array) with a required country_code and optional refinement arrays.
Lookup Geo IDs: Use the /targets/geos endpoint to find geo IDs:
# Search by location name
api GET "targets/geos?country_code=US&q=Connecticut&limit=20"
# Search by postal code
api GET "targets/geos?country_code=US&q=06103&limit=20"
Response includes id, type, name, and parent_geo_name for each geo.
Geo Types:
REGION — States/provinces (e.g., Connecticut, California, Ontario)DMA_REGION — Designated Market Areas for media targeting (e.g., "Hartford & New Haven, CT"). Note: DMA-level targeting via dma_ids is no longer supported. DMAs can still be looked up but cannot be used as targeting refinements.CITY — Cities and townsPOSTAL_CODE — ZIP codes (format: "US:06103", "CA:M5H")Targeting Examples:
"geo_targets": {
"country_code": "US"
}
"geo_targets": {
"country_code": "US",
"region_ids": ["4831725"] // Connecticut
}
"geo_targets": {
"country_code": "US",
"city_ids": ["4845411", "5284283"] // West Hartford, Colchester
}
"geo_targets": {
"country_code": "US",
"postal_code_ids": ["US:06103", "US:06105"]
}
"geo_targets": {
"country_code": "US",
"region_ids": ["4831725"], // Connecticut
"city_ids": ["4845411"] // West Hartford
}
Workflow:
/targets/geos with user's querygeo_targets object with appropriate IDsPre-flight audience estimate: Before executing the POST, run an audience estimate to validate targeting. If the parent campaign uses CONTENT or FPMNG, follow skills/api-reference/references/api-behaviors.md (Reserved Pricing and Forecasting) first: fetch the fixed rate for the planned product, dates, format, and targeting; use cost_micro in both the ad set and audience estimate as bid_micro_amount; set ad_product and the returned currency in the estimate, and resolve the other product-specific fields from the current OpenAPI contract and live catalog. Report the fixed rate separately from forecast CPM and bid suggestions. The generic example below is for auction buys.
api POST "estimates/audience" \
'{
"ad_account_id": "<AD_ACCOUNT_ID>",
"start_date": "<start_time>",
"asset_format": "<AUDIO|VIDEO|IMAGE|CATALOG>",
"objective": "<campaign_objective>",
"bid_strategy": "<MAX_BID|COST_PER_RESULT|AUTOBID|UNSET>",
"bid_micro_amount": <bid>,
"budget": {"micro_amount": <budget>, "type": "<DAILY|LIFETIME>", "currency": "USD"},
"targets": { <same targets as above> }
}'
Estimate payload checks (most estimate 400s come from these): send the request body as one JSON object containing every field the live spec marks required for POST /estimates/audience; set budget.currency to the ad account's billing currency (never omit it); always include bid_micro_amount, even when bid_strategy is AUTOBID (the AUTOBID no-bid exception applies only to ad set payloads); always send targets.placements with at least one placement the ad product catalog allows for the chosen ad product; and omit targets.platforms when the catalog does not allow platform targeting for that product.
Note: This endpoint is NOT scoped under /ad_accounts/{id}/ — it's at the top level: POST /estimates/audience. Use the base URL directly followed by /estimates/audience.
Display the estimate summary:
Audience Estimate:
Projected unique users: ~142,000
Estimated daily reach: 8,500 – 12,000
Estimated daily impressions: 15,000 – 22,000
Estimated CPM: $12.50 – $18.00
If the audience is too small (low projected users or a "Min audience threshold was not met" 400), warn the user and suggest:
A "Min audience threshold was not met" 400 means the targeting is too narrow. Do not resend the same request, and do not widen the targeting on your own. Show bid_suggestion only when the response includes it, ask the user how to broaden the targeting, then estimate again with their choice.
If the estimate came back valid but low, ask whether to proceed, adjust targeting, or cancel before creating the ad set. After a threshold 400, do not offer to proceed with the same targeting; offer only to adjust targeting or cancel.
Create the draft ad set:
The campaign_id must reference a draft campaign. If the supplied campaign is published, first check for and reuse its draft or create one with POST /campaigns/{campaign_id}/drafts.
api POST "ad_accounts/{ad_account_id}/drafts/ad_sets" \
'{...}'
ad-sets get <id>api GET "ad_accounts/{ad_account_id}/ad_sets/$AD_SET_ID"
ad-sets update <id>Before the PATCH, read and follow
$PLUGIN_ROOT/skills/api-reference/references/ad-product-validation.md. Fetch the live
catalog, current ad set, parent campaign, and runtime state required by applicable
rules. Deep-merge the proposed PATCH into the current ad set and validate the effective
entity against ad_set.update plus ad_set.both. Do not add a separate validation
confirmation.
Prompt for fields to update (min 1). Same fields as create, all optional.
Read the published ad set, then check GET /drafts/ad_sets/{id}. If it returns 404, create a draft with POST /ad_sets/{id}/drafts. If a draft already exists, disclose its pending state before combining changes. PATCH /drafts/ad_sets/{id}, resolve its draft campaign_id, fetch the draft campaign's current hierarchy version, and validate it. Keep the result staged.
ads listapi GET "ad_accounts/{ad_account_id}/ads?limit=50&sort_direction=DESC"
Format as table: ID | Name | Ad Set ID | Status | Delivery
ads createCollect the required fields and asset selections below first. Before the POST, read and
follow $PLUGIN_ROOT/skills/api-reference/references/ad-product-validation.md. Fetch
the live catalog, current parent ad set and campaign, and referenced assets, then
validate the final ad body against ad.create plus ad.both. Do not add a separate
validation confirmation.
Prompt for required fields:
GET /assets and prompt user to select:
asset_id (required for live ads, optional for drafts — audio/video/image creative matching ad set format)logo_asset_id (required — logo image)companion_asset_id (required for AUDIO format — companion image)key (NOT type) and clickthrough_url (NOT url):
key: SHOP_NOW, LEARN_MORE, LISTEN_NOW, SIGN_UP, WATCH_NOW, BUY_NOW, DOWNLOAD, etc.clickthrough_url: landing page URL (required for live ads, optional for drafts)measurement_event: required — IMPRESSION, CLICKED, START, FIRST_QUARTILE, MIDPOINT, THIRD_QUARTILE, COMPLETE, or VIEWABLE_IMPRESSION. If omitted, defaults to IMPRESSION — always set explicitly, especially for click trackers.measurement_partner: DCM, IAS, MOAT, DOUBLEVERIFY, or UNSETurl: the tracking pixel URL"third_party_tracking": [
{"measurement_event": "IMPRESSION", "measurement_partner": "DCM", "url": "https://ad.doubleclick.net/ddm/trackimp/..."},
{"measurement_event": "CLICKED", "measurement_partner": "DCM", "url": "https://ad.doubleclick.net/ddm/trackclk/..."}
]
Paused is not an ad set or ad status: ad set and ad statuses have no PAUSED (only campaigns do). Pause or resume an ad set or ad with a live PATCH of {"delivery":"OFF"} or {"delivery":"ON"} (an ad set PATCH carrying delivery must contain only that field), and find paused ad sets from the read-only is_paused response field, never statuses=PAUSED. Ad sets for a campaign: api GET "ad_accounts/{ad_account_id}/ad_sets?campaign_ids=$CAMPAIGN_ID". There is no nested /campaigns/{id}/ad_sets route. Updates are PATCH, never PUT: the spec defines no PUT on Ads API v3 endpoints.
api POST "ad_accounts/{ad_account_id}/drafts/ads" \
'{...}'
The ad_set_id must reference a draft ad set. If the supplied ad set is published, first check for and reuse its draft or create one with POST /ad_sets/{ad_set_id}/drafts.
ads get <id>api GET "ad_accounts/{ad_account_id}/ads/$AD_ID"
ads update <id>Before the update, read and follow
$PLUGIN_ROOT/skills/api-reference/references/ad-product-validation.md. Fetch the live
catalog, current ad, parent ad set and campaign, and any referenced assets. Deep-merge
the proposed changes into the current ad and validate the effective entity against
ad.update (when present) plus ad.both. Do not add a separate validation
confirmation.
Read the published ad, then check GET /drafts/ads/{id}. If it returns 404, create a draft with POST /ads/{id}/drafts. If a draft already exists, disclose its pending state before combining changes. PATCH /drafts/ads/{id}, fetch its parent draft ad set to resolve the draft campaign, fetch the campaign's current hierarchy version, and validate it. Keep the result staged.
Draft ad updates support name, advertiser_name, tagline, assets, asset_format, call_to_action, third_party_tracking, placements, weight, and status. Always preserve third-party tracking entries the user did not explicitly remove or replace, and set measurement_event explicitly on every entry.
Use ad-sets create-live, ad-sets update-live <id>, ads create-live, or ads update-live <id> only when the user explicitly requests an immediate/direct change to a published entity or asks to skip drafts.
If a direct write returns HTTP 403 or an edit-permission error, do not retry it and do not conclude that the credentials are entirely read-only. State that direct editing of the published entity was denied and offer draft staging instead.
auto_execute is true, execute directly.auto_execute is false, present the curl command and ask for confirmation.HTTP_STATUS: line from curl output to determine success or failure before interpreting the response body.PUBLISH.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub spotify/ads-agentic-tools --plugin spotify-ads-api20 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./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./assetsOther plugins' skills for the same job