Getting started

Authentication and API keys

Every request carries an API key as a bearer token. A key belongs to one organization, may be bound to one workspace, and holds a set of scopes that decide which operations it can call.

bash

Key types

PrefixUse
ba_live_Production traffic.
ba_test_Same access as a live key; its requests are recorded as test traffic.

Keys are shown once, when they are created. BidAuthor stores only a hash; a lost key is revoked and replaced, never recovered.

Scopes

A key holds one or more scopes. An operation that needs a scope the key lacks fails with 403 api_scope_missing, before anything runs or is charged. GET /api-keys/scopes lists every scope a key can carry.

GroupScopes
Documentsdocuments:read, documents:write, documents:delete
Proposalsrfp:read, rfp:write, rfp:generate, rfp:finalize
Arthuragent:invoke, agent:read
Categoriescategories:read, categories:write, categories:delete
Workspacesworkspaces:read, workspaces:write, workspaces:delete
Webhookswebhooks:read, webhooks:write
Runsruns:read, runs:write
Suggestionssuggestions:read, suggestions:write
Notificationsnotifications:read, notifications:write, devices:write
Accountkeys:read, keys:write, organizations:admin
Billingbilling:read, billing:write

Organization and workspace

The key's organization is fixed; X-Organization-ID is not needed. Workspace resolution follows the key:

  • A key bound to a workspace reads and writes there, whatever headers are sent.
  • An organization-wide key reads from the default workspace unless X-Workspace-ID names another, and must send X-Workspace-ID on every POST, PUT, PATCH and DELETE. Without it the request fails with 400 workspace_id_required, so a write never lands in the default workspace by accident.

Creating more keys

A key holding keys:write can mint further keys for its organization, when the organization has programmatic keys enabled. A new key's scopes must be a subset of the parent's and cannot include keys:write. Plan limits on the number of keys and scopes per key apply.

bash

The response includes secret once. GET /api-keys lists the organization's keys without secrets, and POST /api-keys/{key_id}/revoke revokes one; revoking an already revoked key returns it unchanged.

Failures

CodeStatusMeaning
api_key_invalid401The key is unknown, malformed, or a key type this API does not accept.
api_key_revoked401The key was revoked.
api_key_expired401The key passed its expiry date.
api_scope_missing403The key lacks a scope the operation needs.
workspace_id_required400An organization-wide key wrote without X-Workspace-ID.

See Errors for the envelope and the full list.