REST API
Base URL: your app origin (locally http://localhost:3477). Authenticate with Authorization: Bearer <key>. Create keys in the dashboard under Developers. Responses are { "data": ... } or { "error": { "message" } }.
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/campaigns | List campaigns |
| POST | /api/v1/campaigns | Create a draft campaign { name, niche, keywords[], platforms[], brand_name } |
| GET | /api/v1/campaigns/:id | Campaign + accounts + headline stats |
| POST | /api/v1/campaigns/:id/accounts | Add an account brief { handle, bio, platform, account_type, display_name } |
| POST | /api/v1/campaigns/:id/content | Add content { hook, caption, format, experiment, video_url } |
| POST | /api/v1/campaigns/:id/launch | Launch: creates human tasks |
| GET | /api/v1/campaigns/:id/tasks | Task board |
| GET | /api/v1/campaigns/:id/metrics | Stats, daily series, experiments, top posts |
| GET | /api/v1/usage | Billing-period usage and invoice estimate |
| POST | /api/v1/hook-score | Score a hook (public, no key) |
| GET | /api/v1/post-lab | Public leaderboard data (no key) |
Create and launch
KEY=pf_test_demo_summit_0000000000
curl -s -X POST localhost:3477/api/v1/campaigns \
-H "Authorization: Bearer $KEY" -H "content-type: application/json" \
-d '{"name":"Spring Launch","niche":"coffee","keywords":["cold brew"]}'
# => { "data": { "id": "cmp_...", "status": "draft", ... } }
curl -s -X POST localhost:3477/api/v1/campaigns/cmp_.../accounts \
-H "Authorization: Bearer $KEY" -H "content-type: application/json" \
-d '{"handle":"sam.at.summit","bio":"Runner. Ambassador for Summit Cold Brew."}'
curl -s -X POST localhost:3477/api/v1/campaigns/cmp_.../content \
-H "Authorization: Bearer $KEY" -H "content-type: application/json" \
-d '{"hook":"POV: you quit $7 coffee","caption":"Fall mornings sorted"}'
# caption comes back as "#ad Fall mornings sorted"
curl -s -X POST localhost:3477/api/v1/campaigns/cmp_.../launch -H "Authorization: Bearer $KEY"Errors
401 missing/invalid key · 404 not your campaign · 409 cannot launch (no accounts, already live) · 422 compliance check failed (bio hides brand relationship, impersonating handle).