Create a Chatbot for Spotify Ads Management Using Claude Code Plugins
Learn to build a conversational ad management tool for Spotify using Claude Code Plugins, OpenAPI specs, and Markdown docs — no compiled code required.
Overview
Imagine managing your Spotify ad campaigns through plain English commands — no clicking through dashboards or writing complex API calls. By combining the Spotify Ads API with Claude's Code Plugins, you can build a conversational interface that interprets natural language instructions and executes them automatically. This tutorial walks you through the entire process, from setting up your environment to deploying a fully functional chatbot that reads OpenAPI specifications and Markdown documentation to understand the API. Best of all, no compiled code is required — everything runs through Claude’s plugin system.

The result is a tool that lets you ask things like “Create a new ad campaign for my podcast with a $500 budget targeting UK listeners” and have it work. By the end of this guide, you'll have a working prototype that can be extended to other APIs with minimal effort.
Prerequisites
Before you begin, ensure you have the following ready:
- A Spotify for Artists account with access to the Spotify Ads API (you need an API key). Request access through the Spotify for Artists developer portal.
- An Anthropic Claude account with the ability to enable Code Plugins (available in the Claude Pro tier).
- Basic familiarity with OpenAPI specs (know what paths, parameters, and responses are).
- Markdown basics — we’ll use documentation written in Markdown.
- A text editor or IDE for writing configuration files (JSON/YAML).
- Node.js v18+ (optional, only if you need to run a local server for testing).
Step-by-Step Instructions
Step 1: Prepare Your OpenAPI Specification and Documentation
Claude Code Plugins rely on structured information to understand an API. You’ll need two files:
- OpenAPI spec (YAML or JSON) – Describes all endpoints, parameters, request bodies, and responses for the Spotify Ads API. If you don’t have an official spec, you can create one by reverse-engineering the Spotify Ads API docs (but the official spec is preferred). Save this as
spotify-ads-openapi.yaml. - Markdown documentation – A human-readable guide that explains common workflows, best practices, and examples. For instance, “How to create an ad campaign” with step-by-step instructions. Save as
docs.md.
These files act as the knowledge base for the plugin.
Step 2: Set Up a Claude Code Plugin Project
Claude Code Plugins work by giving Claude access to a set of files or a local server that can invoke API calls. We’ll use the filesystem plugin approach here (no compiled code).
Create a new directory for your plugin:
mkdir spotify-ads-plugin
cd spotify-ads-plugin
Inside, create two subdirectories: specs and docs. Place your OpenAPI YAML and Markdown file in their respective folders.
Step 3: Write the Plugin Manifest
Claude needs a manifest file to know what resources your plugin provides. Create plugin.json:
{
"name": "Spotify Ads Manager",
"description": "Natural language interface to the Spotify Ads API",
"version": "1.0.0",
"resources": [
{
"path": "specs/spotify-ads-openapi.yaml",
"type": "openapi",
"description": "OpenAPI specification for Spotify Ads API"
},
{
"path": "docs/docs.md",
"type": "documentation",
"description": "Markdown guide for common ad management tasks"
}
]
}
This tells Claude exactly where to find the API definition and supplementary docs.
Step 4: Configure Claude to Use the Plugin
In the Claude interface, go to Settings → Plugins, and choose “Add from folder”. Select the spotify-ads-plugin directory. Claude will now read the manifest and load the OpenAPI spec and Markdown file.
If you prefer a remote server approach, you can run a small Express server that serves these files, but for simplicity we’ll use local files.
Step 5: Test the Plugin with a Simple Query
Now you can ask Claude natural language questions. For example:
“List all my ad campaigns.”
Claude will:
- Consult the OpenAPI spec to find the
GET /campaignsendpoint. - Check the Markdown docs for authentication requirements (e.g., Bearer token).
- Execute the API call using your stored credentials (you’ll need to provide the API key via Claude’s secure environment variables).
- Return the results in a conversational format.
If it fails, Claude will ask clarifying questions or read the error response and attempt to fix it.

Step 6: Add More Complex Workflows
To make the tool truly useful, enhance the Markdown documentation with multi-step workflows. For instance, add a section called “Creating a New Campaign” that outlines:
- Acquire targeting parameters (country, age, gender, device).
- Set budget and bid strategy.
- Choose ad format (audio, video, display).
- Submit to
POST /campaigns. - Validate response and poll for status.
Claude can then follow these instructions step by step, asking you for missing information when needed.
Step 7: Handle Authentication Securely
Spotify Ads API uses OAuth 2.0. In Claude, you can store tokens using environment variables (available in the plugin’s execution context). Add a section in your Markdown docs explaining how to refresh tokens, or include a server-side script that handles token exchange. For this tutorial, assume you have a valid API key stored in SPOTIFY_API_KEY.
Step 8: Iterate and Refine
Test various scenarios:
- “Pause campaign X and increase budget by 20%.”
- “Show me performance metrics for last week.”
- “Create a new ad set with retargeting.”
If Claude misunderstands, update the Markdown docs with more precise instructions. The goal is to make the natural language mapping as seamless as possible.
Common Mistakes
Here are pitfalls to avoid when building your plugin:
- Incomplete OpenAPI spec: If endpoints are missing or have incorrect schemas, Claude will hallucinate calls. Always validate your OpenAPI file with tools like Swagger Editor.
- No authentication instructions: The Markdown docs must explicitly mention where to put the API key and how to handle tokens. Otherwise Claude won’t know how to authenticate.
- Too much information: Including every possible parameter in the docs can confuse Claude. Focus on the most common use cases first.
- Assuming Claude remembers context: Each plugin call is stateless. Use session IDs or store campaign IDs in the Markdown as temporary variables.
- Missing error handling: The API may return 429 (rate limit) or 400 (bad request). Include example responses in your docs so Claude knows how to react (e.g., “If you get a 429, retry after 10 seconds”).
Summary
You’ve now built a conversational interface to the Spotify Ads API using Claude Code Plugins — without writing a single line of compiled code. By providing an OpenAPI spec and well-structured Markdown documentation, you enabled Claude to understand and execute complex ad management tasks from natural language. This approach can be adapted for any REST API: just swap the spec and docs. The result is a powerful tool that reduces the learning curve for advertisers and speeds up routine operations. Next steps include adding authentication flow automation and deploying the plugin as a Slack bot or web app.