Autional Autional
API Reference GitHub autional.com →

POST /admin/tenants/{tenant_id}/api-keys/{key_id}/rotate

Rotate an API Key, generating a new key and immediately invalidating the old one.

Tenant Service `bearerAuth` application/json

Request Parameters

NameInTypeRequiredDefaultExampleConstraintsDescription
id path string Yes Tenant ID
key_id path string Yes API Key ID

Responses

StatusDescriptionSchema
200New API Keydto.DataResponse-dto_RotateApiKeyResponse
400Invalid request parametersgitee_com_linmes_authms_base_dto.SimpleResponse
401Unauthenticatedgitee_com_linmes_authms_base_dto.SimpleResponse
403Insufficient permissionsgitee_com_linmes_authms_base_dto.SimpleResponse
404API Key not foundgitee_com_linmes_authms_base_dto.SimpleResponse
500Internal server errorgitee_com_linmes_authms_base_dto.SimpleResponse

Referenced Schemas

dto.DataResponse-dto_RotateApiKeyResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
data dto.RotateApiKeyResponse No
message string No
timestamp string No

dto.RotateApiKeyResponse

FieldTypeRequiredExampleConstraintsDescription
api_key string No tk_f6e7d8c9a0b1...
created_at string No 2026-05-12T16:00:00Z
id string No tak_001
key_prefix string No tk_f6e7d8c9
message string No Please save the new API Key immediately; the old key is no longer valid

gitee_com_linmes_authms_base_dto.SimpleResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
message string No
timestamp string No