Skip to content

Create API key API Reference

POST
/tenants/{tenant}/apikeys
curl --request POST \
--url https://api.kupe.cloud/api/v1/tenants/acme/apikeys \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "displayName": "CI/CD Pipeline", "expiresAt": "2027-01-01T00:00:00Z", "role": "admin" }'

Create a new API key for programmatic access. The raw key (prefixed with kupe_) is returned exactly once in the response — store it securely, as it cannot be retrieved again.

API keys authenticate via the standard Authorization: Bearer header. Keys can be scoped to admin or readonly roles and optionally set to expire.

tenant
required
string

Tenant name

API key configuration

Media type application/json
object
displayName

Human-readable name for identifying this key

string
Example
CI/CD Pipeline
expiresAt

Optional expiration in RFC3339 format

string
Example
2027-01-01T00:00:00Z
role

Role: admin (read-write) or readonly (read-only)

string
Example
admin

API key created (includes raw key)

Media type application/json
object
createdAt
string
createdBy
string
displayName
string
id
string
key
string
role
string
Example
{
"createdAt": "2026-03-15T08:00:00Z",
"createdBy": "alice@acme.com",
"displayName": "CI/CD Pipeline",
"id": "ak-a1b2c3d4",
"key": "kupe_a1b2c3d4_dGhpcyBpcyBhIHNhbXBsZSBrZXk",
"role": "admin"
}

Validation error

Media type application/json
object
code
string
error
string
field
string
message
string
severity
string
Example generated
{
"code": "example",
"error": "example",
"field": "example",
"message": "example",
"severity": "example"
}

Missing or invalid authentication

Media type application/json
object
code
string
error
string
field
string
message
string
severity
string
Example generated
{
"code": "example",
"error": "example",
"field": "example",
"message": "example",
"severity": "example"
}

Admin access required

Media type application/json
object
code
string
error
string
field
string
message
string
severity
string
Example generated
{
"code": "example",
"error": "example",
"field": "example",
"message": "example",
"severity": "example"
}

Rate limit exceeded

Media type application/json
object
code
string
error
string
field
string
message
string
severity
string
Example generated
{
"code": "example",
"error": "example",
"field": "example",
"message": "example",
"severity": "example"
}