Skip to content

Update API key metadata

PATCH
/api/v1/admin/api-keys/{key_id}
curl --request PATCH \
--url https://example.com/api/v1/admin/api-keys/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Content-Type: application/json' \
--header 'X-Label-Hub-Key: <X-Label-Hub-Key>' \
--data '{ "allowed_printer_ids": [ "example" ], "enabled": true, "notes": "example", "rate_limit_per_minute": 1 }'

Update enabled, rate_limit_per_minute, notes, or allowed_printer_ids. Cannot change scopes or the key value itself — revoke and recreate for that.

key_id
required
Key Id
string format: uuid
Media typeapplication/json
ApiKeyPatch
object
allowed_printer_ids
Allowed Printer Ids
Any of:
Array<string>
enabled
Enabled
Any of:
boolean
notes
Notes
Any of:
string
rate_limit_per_minute
Rate Limit Per Minute
Any of:
integer

Example generated

{
"allowed_printer_ids": [
"example"
],
"enabled": true,
"notes": "example",
"rate_limit_per_minute": 1
}

Successful Response

Media typeapplication/json
ApiKeyRead

Metadata-only view — no key_hash, no plaintext.

object
allowed_printer_ids
required
Allowed Printer Ids
Array<string>
created_at
required
Created At
string
enabled
required
Enabled
boolean
expires_at
required
Expires At
Any of:
string
id
required
Id
string format: uuid
key_prefix
required
Key Prefix
string
last_used_at
required
Last Used At
Any of:
string
last_used_ip
required
Last Used Ip
Any of:
string
name
required
Name
string
notes
required
Notes
Any of:
string
rate_limit_per_minute
required
Rate Limit Per Minute
integer
scopes
required
Scopes
Array<string>

Example generated

{
"allowed_printer_ids": [
"example"
],
"created_at": "example",
"enabled": true,
"expires_at": "example",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"key_prefix": "example",
"last_used_at": "example",
"last_used_ip": "example",
"name": "example",
"notes": "example",
"rate_limit_per_minute": 1,
"scopes": [
"example"
]
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string

Example generated

{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}