Documentation / API
REST API reference
Every endpoint lives under /api/v1 and authenticates with an API key from Console → Integrations. Keys are shown once and can be read-only or read/write; revoked keys stop working immediately.
Send the key as Authorization: Bearer bfk_…. Errors come back as Problem Details JSON with a code you can switch on.
/api/v1/mescope: readWhich workspace and plan a key belongs to. The cheap way to check a key works.
curl -H "Authorization: Bearer bfk_…" \ https://your-domain/api/v1/me
/api/v1/bots?page=1&pageSize=50scope: readLists the workspace's bots with status and version.
/api/v1/bots/{botId}scope: readOne bot: status, timezone, version, last error.
/api/v1/bots/{botId}/subscribers?q=&page=1&pageSize=50scope: readThe bot's audience, searchable by name or username.
/api/v1/bots/{botId}/logs?level=error&limit=50scope: readRecent runtime logs; filter by level.
/api/v1/bots/{botId}/analytics?days=30scope: readMessage volume, delivery failures, and subscriber growth per day.
/api/v1/bots/{botId}/broadcastsscope: readBroadcast history for the bot.
/api/v1/bots/{botId}/logs/streamscope: readLive logs as Server-Sent Events. Entries arrive as data: lines of LogEntry JSON; a keepalive comment every 15s; the server closes the session after 10 minutes (reconnect). EventSource cannot send headers, so consume with fetch-based streaming.
curl -N -H "Authorization: Bearer bfk_…" https://your-domain/api/v1/bots/{botId}/logs/stream/api/v1/bots/{botId}/broadcastsscope: writeCreates and queues a broadcast in one call. Body: { "name": "…", "text": "…", "segmentId": "…" (optional) }. Delivery happens on the same paced pipeline as console broadcasts; your plan limit applies.
curl -X POST -H "Authorization: Bearer bfk_…" \
-H "Content-Type: application/json" \
-d '{"name":"June promo","text":"20% off until Friday"}' \
https://your-domain/api/v1/bots/{botId}/broadcastsStatus codes and limits
- 401 UNAUTHENTICATED — missing or invalid key.
- 403 FORBIDDEN — the key lacks the write scope.
- 403 PLAN_LIMIT — broadcast quota reached; the message names the ceiling.
- 404 NOT_FOUND — wrong id, or a bot that belongs to another workspace.
- Page sizes cap at 100; log limits at 200.