Update API key metadata
PATCH
/api/v1/admin/api-keys/{key_id}
const url = 'https://example.com/api/v1/admin/api-keys/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {'X-Label-Hub-Key': '<X-Label-Hub-Key>', 'Content-Type': 'application/json'}, body: '{"allowed_printer_ids":["example"],"enabled":true,"notes":"example","rate_limit_per_minute":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”key_id
required
Key Id
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
ApiKeyPatch
object
Example generated
{ "allowed_printer_ids": [ "example" ], "enabled": true, "notes": "example", "rate_limit_per_minute": 1}Responses
Section titled “Responses”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
id
required
Id
string format: uuid
key_prefix
required
Key Prefix
string
name
required
Name
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>
ValidationErrorobject
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" } ]}