Skip to content

Create a management key for the signed-in member

POST
/api/v1/me/management-keys
curl --request POST \
--url https://gpu-kitchen.example.lan/api/v1/me/management-keys \
--header 'Content-Type: application/json' \
--cookie gpuk_session=<gpuk_session> \
--data '{ "label": "example", "role_ceiling": "super_admin", "read_only": true, "expires_at": "2026-04-15T12:00:00Z" }'

The token is in this response only, once. The role ceiling defaults to the member’s role short of super_admin; a ceiling above the member’s own role is refused.

Media typeapplication/json
object
label
Any of:
string
<= 100 characters
role_ceiling
string
Allowed values: super_admin admin operator user
read_only
boolean
expires_at
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/

Success.

Media typeapplication/json
object
key
required
object
id
required

Key id: the public part of the token.

string
label
required
string | null
role_ceiling
required

Highest role the key acts with; the owner’s live role caps it.

string
Allowed values: super_admin admin operator user
read_only
required

A read-only key may only call GET operations.

boolean
prefix
required

Non-secret display hint: the head of the token.

string
created_at
required
string format: date-time
expires_at
required
Any of:
string format: date-time
last_used_at
required
Any of:
string format: date-time
last_used_ip
required
string | null
key
required

The full token. Shown once.

string
Example
{
"key": {
"role_ceiling": "super_admin"
}
}

Error codes: validation_error.

Media typeapplication/json
object
error
required
object
code
required

Stable snake_case code to branch on.

string
message
required

A sentence to show a person.

string
details

Optional structured context.

fix

Optional place where the problem is fixed.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": "example",
"fix": "example"
}
}

Error codes: auth_required.

Media typeapplication/json
object
error
required
object
code
required

Stable snake_case code to branch on.

string
message
required

A sentence to show a person.

string
details

Optional structured context.

fix

Optional place where the problem is fixed.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": "example",
"fix": "example"
}
}

Error codes: cannot_grant_higher_role, forbidden, operator_requires_offer, session_required.

Media typeapplication/json
object
error
required
object
code
required

Stable snake_case code to branch on.

string
message
required

A sentence to show a person.

string
details

Optional structured context.

fix

Optional place where the problem is fixed.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": "example",
"fix": "example"
}
}

Error codes: payload_too_large.

Media typeapplication/json
object
error
required
object
code
required

Stable snake_case code to branch on.

string
message
required

A sentence to show a person.

string
details

Optional structured context.

fix

Optional place where the problem is fixed.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": "example",
"fix": "example"
}
}