REST API

Every MCP tool is also a plain HTTP endpoint under https://adflitz.com/api/v1. JSON in, JSON out, same keys and permissions.

Basics

curl https://adflitz.com/api/v1/overview \
  -H "Authorization: Bearer apk_YOUR_KEY"

GET endpoints take query parameters, POST endpoints a JSON body. Errors return { "error": { "code", "message" } } with 400, 401, 402 (not enough credits), 403, 404, 409 or 429. The machine-readable spec is at /api/v1/openapi.json.

Endpoints

GET /api/v1/overviewWorkspace overview
GET /api/v1/projectsList projects
GET /api/v1/connectionsPlatform connection status
GET /api/v1/accountsList ad accounts
GET /api/v1/campaignsList campaigns
GET /api/v1/ad-groupsList ad groups / ad sets
GET /api/v1/adsList ads
GET /api/v1/reportsPerformance report
GET /api/v1/platform-optionsPlatform options for drafts
POST /api/v1/accounts/:ad_account_id/syncSync an ad account now
GET /api/v1/draftsList drafts
GET /api/v1/drafts/:draft_idGet a draft
POST /api/v1/draftsCreate a change draft
POST /api/v1/drafts/:draft_id/approveApprove a draft
POST /api/v1/drafts/:draft_id/publishPublish a draft
POST /api/v1/drafts/:draft_id/rejectReject a draft
GET /api/v1/librarySearch the ads library
GET /api/v1/competitorsList tracked competitors
POST /api/v1/competitorsTrack a competitor
DELETE /api/v1/competitors/:competitor_idStop tracking a competitor
GET /api/v1/boardsList swipe-file boards
GET /api/v1/saved-adsList saved ads
POST /api/v1/saved-adsSave an ad to the swipe file
GET /api/v1/activityActivity feed
GET /api/v1/autopilot/rulesList autopilot rules
POST /api/v1/autopilot/runRun autopilot now
GET /api/v1/creditsAI credit balance
POST /api/v1/ai/copyGenerate ad copy (uses credits)
POST /api/v1/studio/static-adRender a static ad (uses credits)
POST /api/v1/ai/auditAudit performance (uses credits)

Currencies

Budgets, spend, revenue and bids always use the ad account's own currency (a EUR account reports euros, a daily budget of 25 means €25.00). Every campaign, ad set and report carries a currency field, and reports never add up accounts that bill in different currencies: pass currency to pick one, and read currencies for what is available. Only Adflitz's own plans and credit packs are priced in USD.

Create a draft

curl -X POST https://adflitz.com/api/v1/drafts \
  -H "Authorization: Bearer apk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Scale retargeting","operations":[{"type":"campaign.update","campaign_id":"…","changes":{"daily_budget":120}}]}'