Update Api Key
PATCH
/api-keys/{key_id}
const url = 'https://api.mengi.cloud/api-keys/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {'Content-Type': 'application/json'}, body: '{"name":"example","description":"example","expires_at":"2026-04-15T12:00:00Z"}'};
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://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.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” key_id
required
Key Id
string format: uuid
Request Body required
Section titled “Request Body required ”Responses
Section titled “ Responses ”Successful Response
Media type application/json
APIKeyResponse
object
id
required
Id
string format: uuid
name
required
Name
string
key_prefix
required
Key Prefix
string
is_active
required
Is Active
boolean
created_at
required
Created At
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>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}