Docs
API 1.39
Status
API keys

Create an API key; the secret is shown once

POST /v1/api-keys: Create an API key; the secret is shown once

POST /v1/api-keys
Operation idcreateApiKey
Key scopeadmin: admin keys only
SectionAPI keys

#Request body

FieldTypeRequiredDescription
namestringyesmin length 1 · max length 64
scopes"run", "read", "admin"yesmin items 1
mode"live", "test"default "live"
expires_atstring (date-time)

#Example request

curl -X POST "https://api.kaab.ist/v1/api-keys" \
  -H "Authorization: Bearer $KAAB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"ci","scopes":["run","read"],"mode":"live","expires_at":"2027-01-01T00:00:00Z"}'

#Responses

#201

Key

FieldTypeRequiredDescription
idstringyespattern ^key_[0-9a-hjkmnp-tv-z]{26}$
object"api_key"yes
namestringyes
prefixstringyes
scopes"run", "read", "admin"yesmin items 1
mode"live", "test"yes
last_used_atstring or null (date-time)yes
expires_atstring or null (date-time)yes
created_atstring (date-time)yes
keystringyespattern ^sk_(live|test)_[A-Za-z0-9]{32,}$

#Errors

Every error answers with the error envelope; its code is one of the error codes.

StatusWhen
400request_invalid: request validation failed
401Missing or invalid API key
402insufficient_credits: top up to continue
403The key's scope does not cover this operation
409Conflicting state (see error.code)
422Semantically invalid request (see error.code)
429Rate limited; see Retry-After
500internal: unexpected server error

Was this page helpful?