Skip to main content
POST
/
api
/
api-keys
/
generate
Generate a new API key
curl --request POST \
  --url https://api.example.com/api/api-keys/generate \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --header 'organization-id: <organization-id>' \
  --data '
{
  "name": "My API Key"
}
'
{
  "id": 1,
  "key": "bc_1234567890abcdef"
}

Headers

Authorization
string
required

Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.

Example:

"Bearer bc_1234567890abcdef"

organization-id
string
required

Required if Authorization is a JWT token. The organization ID to operate within.

Body

application/json
name
string

Optional name for the API key

Example:

"My API Key"

Response

201 - application/json

The generated API key

id
number
required

API key ID

Example:

1

key
string
required

The API key string

Example:

"bc_1234567890abcdef"