Public API v1
Workspace-scoped REST endpoints authenticated with kmn_ API keys from pengaturan → API keys.
Authentication
buat a key under /app/pengaturan/api-keys. Send it as x-api-key or Authorization: Bearer kmn_.... Write routes require the public_api_write feature flag (on by default) plus kampanye:write scope.
curl https://your-app/api/v1/campaigns \
-H "Authorization: Bearer kmn_..."Scopes
- kampanye:read / kampanye:write
- akun:read
- listener:read / listener:write (listener also accept kampanye:read/write)
- leads:read / leads:write
- activity:read
- analytics:read
- competitors:read
- templates:read
GET /api/v1/kampanye
List kampanye for the API key workspace.
POST /api/v1/kampanye
buat a kampanye. opsional listenerQuery creates a keyword listener. opsional socialAccountIds must belong to the workspace.
{
"name": "IG keyword pilot",
"platform": "instagram",
"mode": "approval_required",
"goal": "Helpful product replies",
"listenerQuery": "social ops automation",
"clientId": "optional_client_profile_id",
"dailyLimit": 30
}GET/POST /api/v1/listener
List or buat keyword/competitor/trend listener. POST requires kampanye:write.
{
"platform": "instagram",
"type": "keyword",
"query": "ai agent",
"campaignId": "optional_campaign_id"
}GET/POST /api/v1/leads
List or buat engagement leads. Query params for GET: status, clientId, q. Requires lead_capture feature flag. POST uses leads:write and fires outbound lead.captured with structured CRM fields on generic webhook.
{
"handle": "prospect_ig",
"platform": "instagram",
"intent": "Asked for pricing",
"contactEmail": "ops@brand.com",
"clientId": "optional_client_id",
"source": "api"
}Other read endpoints
- GET /api/v1/akun
- GET /api/v1/activity
- GET /api/v1/analytics
Outbound workspace webhook
Configure Slack/Discord/generic endpoints under pengaturan → webhook. Events include persetujuan.new, lead.captured (extra: handle/email/client/kampanye/status), akun.degraded, akun.reauth_required, akun.proxy_rotated, comment.gagal, usage.warning.