Skip to content

Create an API key

POST
/api/v1/api-keys
curl --request POST \
--url https://api.deploybase.eu/api/v1/api/v1/api-keys \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "kind": "standard", "name": "example" }'

Creates an API key for the current team and returns it with the raw secret in raw_key. The raw key is shown only in this response; store it now. kind is “standard” (default; never expires) or “agent” (expires 90 days after creation; rotate it to extend). The lifetime is set by the server. A team holds at most 25 usable keys (expired and revoked keys do not count). Requires the admin role and a verified email.

Key name and kind

Media type application/json
object
kind

Kind is “standard” (the default when empty; never expires) or “agent” (expires 90 days after creation or the last rotation). The server sets the lifetime; a client cannot choose one.

string
Allowed values: standard agent
name
required
string
>= 1 characters <= 255 characters

Created

Media type application/json
object
data
meta
object
request_id
string
timestamp
string
trace_id
string
data
object
created_at
string
expires_at
string
id
string
key_prefix
string
kind
string
Allowed values: standard agent
last_used_at
string
name
string
raw_key

Only returned on create and rotate

string
revoked_at
string
rotated_at
string
scopes
Array<string>
team_id
string
updated_at
string

Example

{
"data": {
"kind": "standard"
}
}

INVALID_INPUT

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

Example generated

{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

Unauthorized

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

Example generated

{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

FORBIDDEN or EMAIL_NOT_VERIFIED

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

Example generated

{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

QUOTA_EXCEEDED

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

Example generated

{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

Internal Server Error

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

Example generated

{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

Live 174db30c built