Get your API key
Generate a key at
adspirer.ai/keys, then call any of the 178 endpoints below with a bearer token. Free tier includes 15 calls — enough to test everything.| Base URL | https://api.adspirer.ai |
| Interactive sandbox | api.adspirer.ai/docs (Swagger UI) |
| Raw OpenAPI spec | api.adspirer.ai/openapi.json |
Use cases
Real patterns teams ship on the REST API today. Each one is just a few HTTP calls — the hard part is already done for you.Slack ChatOps for campaigns
Team member posts a campaign brief in
#campaign-activation → n8n parses it → REST API creates the campaign PAUSED → bot confirms in the thread. Nobody needs a Meta / Google login.Daily account briefings
Every morning, pull CPL / ROAS / spend for each account manager’s book of business and deliver a Slack digest. Alert states (🟢 on-track, 🟡 watch, 🔴 red) computed against targets you store in a Google Sheet.
Portfolio rollups for owners
Weekly health summary across every client account — who’s over/under target, budget utilization, top / bottom 5 performers, per-manager breakdown.
Alert thresholds & auto-pause
Watch CPL vs target, flag breaches, pause underperforming ad sets on a rule.
create_monitor handles the poll loop on our side so you don’t run a cron.SaaS product embedding
Your app creates a starter campaign for every new customer during onboarding.
Idempotency-Key makes signup retries safe even under network flakiness.Headless CI / scheduled ops
Launch seasonal campaigns from GitHub Actions, kick off end-of-month reports from cron, trigger pause / resume on holiday calendars. No browser, no OAuth dance — just an API key.
How they wire up
Each pattern is a small variation on the same two primitives: read-only tools for data, write tools for changes.| Pattern | Ingress | Adspirer calls | Egress |
|---|---|---|---|
| Slack ChatOps | Slack webhook → n8n | create_meta_image_campaign, add_meta_ad_set, add_meta_ad | Slack thread reply |
| Daily briefings | Cron (n8n / Zapier / cron) | get_campaign_performance, analyze_wasted_spend | Slack DM per manager |
| Portfolio rollups | Cron, weekly | get_campaign_performance across accounts | Email / Notion / Slack |
| Auto-pause guardrail | create_monitor (Adspirer-hosted) | pause_ad_set or update_campaign_budget on breach | Slack alert + action log |
| SaaS onboarding | Your app’s signup hook | create_search_campaign with Idempotency-Key | Campaign ID stored in your DB |
| Scheduled ops | GitHub Actions / cron | Whatever the job needs | Job log + Slack status |
Why use the REST API?
You’re already using ChatGPT, Claude, or Cursor with Adspirer’s MCP server — and that’s great for interactive work. But there are jobs an AI conversation can’t do:- Your agent shuts off when you close the tab. A cron that pulls daily performance at 9am needs to run without a human watching.
- No-code automation tools don’t speak MCP. n8n, Zapier, and Make only know HTTP. MCP uses SSE.
- Your backend wants to embed campaign creation. A SaaS onboarding flow that creates a starter campaign for every new customer can’t open a chat with Claude.
- Multi-step workflows need to be deterministic. “If CTR drops below 2%, pause the campaign” belongs in code, not a prompt.
How it relates to MCP
Same backend. Same auth. Same quota. Same write-guards. Only the transport differs. One logical endpoint per tool:POST /api/v1/tools/<tool_name>/execute. Call add_meta_ad from a chat via MCP or from a cron via REST — the result, the quota cost, and the log entry are identical.
Quickstart
- curl
- Python
- Node (fetch)
- n8n
Core concepts
Authentication
Every call requires an API key generated at adspirer.ai/keys. Pass it as a bearer token — keys are prefixedsk_live_. Treat them as secrets; never commit them. Keys provide the same access as OAuth tokens used by MCP clients — same tools, same quotas.
Request envelope
Every endpoint takes aPOST with tool-specific input wrapped in an arguments object:
Response envelope
Success:Quota & billing
Every successful billable call decrements your monthly tool-call allowance. The current counter is attached to every 200 response underdata.quota. When the limit is hit, the API returns HTTP 402 with a quota block including upgrade_url.
Read-only diagnostic tools never consume quota: get_usage_status, list_connected_accounts, get_connections_status.
See Pricing for tier limits.
Idempotency
Write operations accept anIdempotency-Key header. A repeated call with the same key returns the cached result rather than executing twice.
Multi-account users
If you’ve connected multiple accounts on the same platform (e.g. an agency with 10 Meta ad accounts), specify the account on every call:ad_account_id— Meta Adscustomer_id— Google Adsadvertiser_id— TikTok Ads, LinkedIn Adsaccount_id— generic fallback
HTTP 400 with a list of valid IDs. Use list_connected_accounts to discover them.
HTTP status codes
| Status | Meaning |
|---|---|
200 | Success. Parse data. |
400 | Tool-level error. Surface error to users. Includes multi-account prompts and validation failures. |
401 | Invalid or missing API key. |
402 | Adspirer quota exhausted. Response includes upgrade_url. |
404 | Unknown tool_name in the URL. |
409 | Idempotency key reused with different arguments. |
429 | Upstream ad platform rate-limited us (Meta / Google / etc.). Retry with backoff. |
500 | Unexpected server error. Report to support. |
No streaming
This endpoint is plain request/response JSON. No SSE, no chunked streaming. Safe to use from n8n Cloud, Zapier, Make, curl, Pythonrequests, Node fetch, Go net/http, and every mainstream HTTP library.
Tool coverage
Google Ads
51 tools — campaigns, ad groups, keywords, extensions, Performance Max, Demand Gen
Meta Ads
36 tools — image, video, carousel, DCO, audiences, placements
LinkedIn Ads
45 tools — campaigns, creatives, audiences, conversion tracking
TikTok Ads
29 tools — campaigns, ad groups, ads, geo, optimization events
Monitoring & Reporting
13 tools — cross-platform performance, wasted spend, search terms
Account Management
3 tools — list connected accounts, connection status, usage
Architecture patterns
Slack ChatOps — campaign creation from a message
Every campaign is created PAUSED — the requester reviews and activates manually. TheIdempotency-Key header means a retry from n8n never creates a duplicate campaign.
Daily briefings — scheduled read-only reports
Read-only tools (get_*, list_*, analyze_*) don’t consume quota. At ~3 calls per account per briefing, 100 accounts = 300 calls / morning.
Guarded auto-pause — Adspirer-hosted monitor
You don’t run the cron — Adspirer does. Use this when you want rules to fire without babysitting an n8n workflow.SaaS onboarding — embedded create
signup-{customer.id} as the key means signup retries never double-create.
What’s excluded from REST
These exist in MCP but are intentionally omitted from the REST surface — call the underlying tools directly instead:- Unified aggregators (
ads_query,ads_optimize,ads_create,ads_manage,account_info) — LLM-convenience wrappers that dispatch to real tools. - Federated router meta-tools (
google_ads,meta_ads,linkedin_ads,tiktok_ads,monitoring_and_reporting) — MCP-transport workaround for Claude Desktop’s tool-list size limit. Irrelevant for REST.
FAQ
Do REST and MCP share the same quota?
Do REST and MCP share the same quota?
Can I use the REST API from a browser?
Can I use the REST API from a browser?
Technically yes, but don’t. An API key in browser JavaScript is visible to anyone who opens DevTools. Call the REST API from your backend, or use the MCP server for user-facing AI experiences.
How do I handle rate limiting from Meta / Google / etc.?
How do I handle rate limiting from Meta / Google / etc.?
If an upstream ad platform rate-limits us, you’ll see
HTTP 429. Back off and retry — typically 30–60 seconds is enough. Adspirer’s internal rate limits (HTTP 402 for quota) are separate from upstream limits.Is there a webhook or subscription API?
Is there a webhook or subscription API?
Not yet. For “run every X hours” style jobs, use
create_monitor — it polls on our side and emits alerts you can wire into Slack or email. For true push-based webhooks, book a call.Can I use the same API key from multiple machines?
Can I use the same API key from multiple machines?
Yes. Keys aren’t pinned to a device. Just be aware that concurrent calls share one quota — if you parallelize heavily, you may hit
HTTP 402 sooner.What happens if my key leaks?
What happens if my key leaks?
Revoke it immediately at adspirer.ai/keys and generate a new one. Revoked keys stop working within seconds.
Related
- How MCP Works — the protocol the REST API mirrors
- Core Workflows — step-by-step tool sequences for common jobs
- Tool Catalog — the 175-tool reference
- Pricing — quota tiers and overage billing
- Security — how API keys, OAuth, and session data are handled

