Authentication
Bedrock supports two authentication schemes. Most programmatic callers use an API key; the Bedrock portal and a handful of user-scoped endpoints use token auth.API Key (Bearer)
API keys are scoped to your organization and grant access to every resource your organization owns — templates, agents, adapters, tracing, and default adapter state.Getting an API Key
- Sign in to the Bedrock portal
- Navigate to API Keys
- Click Create API Key, give it a name (e.g., “Production”), and copy the value immediately
Using Your API Key
Include your API key in theAuthorization header with the Bearer prefix:
API Key Scope
An API key’s access follows the organization it belongs to:| Resource | Access |
|---|---|
| Templates | Full CRUD on templates in your org |
| Agents | Full CRUD — create, read, update, delete, run, tag, stop |
| Traces | Read / write for traces on agents in your org |
| Adapters | Read org adapters; create / delete your own custom ones |
| Adapter Configs | Full CRUD on configs for templates in your org |
| Default Adapter State | Contacts, messages, documents, projects, notifications |
Creating API Keys via API
You can also create API keys programmatically against/api/organizations/api-keys/:
Managing API Keys
List keys:Token Auth (portal / user-scoped)
The portal and the/api/organizations/auth/* endpoints use DRF’s TokenAuthentication:
POST /api/organizations/auth/signup/— creates org + user + membership + tokenPOST /api/organizations/auth/login/— returns a token for an existing userPOST /api/organizations/invites/{id}/accept/— returns a token for the invitee
TokenAuthentication and APIKeyAuthentication are installed): /api/organizations/organizations/, /api/organizations/api-keys/, /api/templates/.
Security Best Practices
Environment Variables
Store API keys in environment variables, never hardcode in source.
Server-Side Only
Never expose API keys in client-side code or public repositories.
Rotate Regularly
Create new keys and delete old ones periodically.
Descriptive Names
Name keys by environment/purpose for easy auditing.
Error Responses
| Status | Meaning |
|---|---|
401 Unauthorized | Missing or invalid API key / token |
403 Forbidden | Valid key but the resource belongs to another org |