API Keys Endpoint

Manage API keys for programmatic access.

Endpoints

MethodEndpointDescription
GET/api-keysList API keys
POST/api-keysCreate an API key
GET/api-keys/:idGet API key details
PATCH/api-keys/:idUpdate an API key
DELETE/api-keys/:idRevoke an API key

API Key Object

Loading code block...

Note: The full API key is only returned once when created. Store it securely.

List API Keys

Loading code block...

Example Request

Loading code block...

Response

Loading code block...

Create API Key

Loading code block...

Request Body

FieldTypeRequiredDescription
namestringYesKey name (1-100 chars)
scopesarrayNoPermission scopes (default: all)
expiresInDaysintegerNoDays until expiration

Available Scopes

ScopeDescription
read:projectsRead project data
write:projectsCreate and update projects
delete:projectsDelete projects
read:usageView usage statistics
write:usageTrack usage events
read:subscriptionView subscription details
manage:api-keysCreate and revoke API keys
invoke:agentsInvoke AI agents
apply:skillsApply skill patterns

Example Request

Loading code block...

Response

Loading code block...

Important: The key field contains the full API key. This is the only time it will be shown. Store it securely.

Get API Key

Loading code block...

Example Request

Loading code block...

Response

Returns the API key object (without the full key).

Update API Key

Loading code block...

Request Body

FieldTypeDescription
namestringKey name
scopesarrayPermission scopes

Example Request

Loading code block...

Response

Returns the updated API key object.

Revoke API Key

Loading code block...

Example Request

Loading code block...

Response

Loading code block...

Key Prefixes

PrefixEnvironment
bs_live_Production keys
bs_test_Test/development keys

Test keys can only access test data and have lower rate limits.

Best Practices

1. Use Minimal Scopes

Only grant the scopes needed for each key:

Loading code block...

2. Set Expiration for Temporary Keys

Loading code block...

3. Rotate Keys Regularly

Create new keys and revoke old ones periodically:

Loading code block...

4. Use Environment Variables

Loading code block...

Limits

PlanMax Keys
Free2
Pro10
Team50
EnterpriseUnlimited

Errors

CodeDescription
key_not_foundAPI key doesn't exist
key_limit_exceededMaximum keys reached
invalid_scopeUnknown scope specified
key_expiredAPI key has expired