Docs menu

API keys and scopes

How bubblr API keys work: the five scopes, limiting a key to some lines, guardrails for agents, and what 401, 403 and 404 mean.

Every request to /v1 carries an API key as a Bearer token:

HTTP
Authorization: Bearer sk_live_…

Making a key

Team owners and admins make keys in the app: Developers → API keys. Choose:

  • Scopes: what the key may do (below).
  • Lines: every line the team has, or only some. A key limited to some lines can't see the others at all.
  • Guardrails (optional): a sending rate limit, a list of allowed recipients, and drafts-only. See Guardrails and rate limits.

The key is shown once. bubblr keeps only a hash of it, so a lost key can't be shown again: make a new one.

Give each integration and each agent its own key, with only the scopes it needs. When one is compromised or retired, revoke just that one.

Scopes

Scope Lets the key
messages:read Read lines' status, chats, messages, drafts, contacts and files; search messages; stream events
messages:send Send messages, react, show typing, mark chats read, assign chats, approve drafts, edit contacts and notes, upload files
calls:read Read the call log, calling status, voice endpoints, call routing and voicemail
calls:write Place, transfer and hang up calls; change voice endpoints, call routing and the voicemail greeting
webhooks:manage Create, change and delete webhooks, see their deliveries and replay them

GET /v1/profiles, GET /v1/profiles/{profile_id} and GET /v1/me work with any key. Each endpoint in the API reference says which scope it needs.

Checking a key

GET /v1/me answers with the key's own settings, which is a quick way to see that it works and what it may do:

Shell
curl https://api.bubblr.io/v1/me -H "Authorization: Bearer $BUBBLR_API_KEY"
JSON
{
  "object": "api_key_identity",
  "key_id": "key_6Nd1rM8pWc",
  "tenant_id": "ten_4Ls9bH3vQk",
  "scopes": ["messages:read", "messages:send"],
  "profile_ids": null,
  "draft_only": false
}

profile_ids: null means every line; otherwise, the lines the key is limited to.

When a key is refused

Answer Why
401 unauthorized No key, a key that doesn't exist, or a revoked key.
403 insufficient_scope The key lacks the scope the endpoint needs. The message names it.
403 session_required Only a signed-in team member can do this (managing the team, keys or billing), not a key.
404 not_found The line, chat or message doesn't exist, or the key can't see it. A key limited to some lines gets 404 for the others, never 403, so it can't learn what else exists.

Keeping keys safe

  • Keep keys on your servers. A key in a browser or a mobile app can be read by anyone who has it.
  • Use environment variables or a secrets manager, never source control.
  • Rotate by making a new key, deploying it, then revoking the old one in the app. Revoking takes effect at once; an open event stream stops within seconds.
  • Keys can't make or change other keys: only people in the app can.

Keys come with your first line.

Request an invite and we'll set up a line for your team. API access is part of every plan.

Request an invite