Skip to main content
Stateful API requests authenticate with a bearer token:
Batch Relay accepts three public bearer modes: Create an isolated anonymous session without signup at POST /v1/anonymous-sessions, or let the CLI create and store one automatically. See Keyless Test Mode. Create, view, and revoke API keys from:

Scopes

Studio management always uses an explicit studio ID in the request path. A studio-owned key can access only its owning studio. An individual key must have an active grant for the requested studio, and both the key and grant must carry the required scope. Studio offer management also enforces studio roles: owners and admins can change offers, while authorized staff can read them. offers:write does not implicitly grant offers:read. Checkout-link creation, preparation, and recovery require offers:apply because those operations resolve the selected or automatic offer; see Studio discounts and offers. Anonymous credentials cannot access studio management. Test keys may read studio management resources, but only Live Mode keys can create, update, or publish form revisions, change studio catalog drafts, or replace storefront assortments. Checkout-link management is an isolated exception for Test Mode: only an account-owned key beginning with br_test_ can select its sandbox management lane. Anonymous sessions cannot create, read, or revoke checkout links. The credential record, not an environment field in the request, chooses the lane; Test Mode has no implicit promotion into Live Mode. Sandbox promotions are different. They require a Live br_... API key plus an authorized studio grant and the matching sandbox_promotions scope. Test keys, anonymous sessions, and OAuth sessions cannot promote studio configuration. See Promote sandbox studio setup. Semantic-field vocabulary reads are public and do not require a bearer token: GET /v1/catalog/semantic-fields.

Missing or invalid credentials

The hosted API returns 401 invalid_api_key for an invalid API key and 401 invalid_anonymous_session for an invalid, revoked, or expired anonymous session. A missing bearer credential on a stateful route returns invalid_api_key; create an anonymous session first or use the CLI bootstrap.

Revocation

Revoked keys stop working immediately. Create a new key if a bearer token is exposed. Anonymous sessions expire after seven days by default and cannot be renewed. Create a new session after expiry. Treat br_anon_... exactly like another secret while it is active.

Test and Live keys

Send Test and Live API keys to https://api.batchrelay.com. The stored API-key record selects Test Mode or Live Mode and is authoritative. The br_test_ prefix helps identify a Test key, but does not choose the lane by itself. Never put Live API keys or production provider credentials in test, development, local test, or client configuration.