Skip to content

Update Api Key

PATCH
/api-keys/{key_id}
curl --request PATCH \
--url https://api.mengi.cloud/api-keys/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "description": "example", "expires_at": "2026-04-15T12:00:00Z" }'

Update an API key’s name or description.

key_id
required
Key Id
string format: uuid
Media type application/json
APIKeyCreate
object
name
required
Name
string
description
Any of:
string
expires_at
Any of:
string format: date-time
Example generated
{
"name": "example",
"description": "example",
"expires_at": "2026-04-15T12:00:00Z"
}

Successful Response

Media type application/json
APIKeyResponse
object
id
required
Id
string format: uuid
name
required
Name
string
description
required
Any of:
string
key_prefix
required
Key Prefix
string
scopes
required
Any of:
string
is_active
required
Is Active
boolean
last_used_at
required
Any of:
string format: date-time
last_used_ip
required
Any of:
string
expires_at
required
Any of:
string format: date-time
created_at
required
Created At
string format: date-time
revoked_at
required
Any of:
string format: date-time
Example generated
{
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"name": "example",
"description": "example",
"key_prefix": "example",
"scopes": "example",
"is_active": true,
"last_used_at": "2026-04-15T12:00:00Z",
"last_used_ip": "example",
"expires_at": "2026-04-15T12:00:00Z",
"created_at": "2026-04-15T12:00:00Z",
"revoked_at": "2026-04-15T12:00:00Z"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}