Postfield

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" } }.

MethodPathDescription
GET/api/v1/campaignsList campaigns
POST/api/v1/campaignsCreate a draft campaign { name, niche, keywords[], platforms[], brand_name }
GET/api/v1/campaigns/:idCampaign + accounts + headline stats
POST/api/v1/campaigns/:id/accountsAdd an account brief { handle, bio, platform, account_type, display_name }
POST/api/v1/campaigns/:id/contentAdd content { hook, caption, format, experiment, video_url }
POST/api/v1/campaigns/:id/launchLaunch: creates human tasks
GET/api/v1/campaigns/:id/tasksTask board
GET/api/v1/campaigns/:id/metricsStats, daily series, experiments, top posts
GET/api/v1/usageBilling-period usage and invoice estimate
POST/api/v1/hook-scoreScore a hook (public, no key)
GET/api/v1/post-labPublic 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).