A AuthMS API Wiki API Reference iam.tianv.com →

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

轮换指定 API Key,生成新 key 并使旧 key 立即失效

租户服务 `bearerAuth` application/json

Request Parameters

NameInTypeRequiredDefaultExampleConstraintsDescription
id path string Yes 租户ID
key_id path string Yes API Key ID

Responses

StatusDescriptionSchema
200新API Keydto.DataResponse-dto_RotateApiKeyResponse
400请求参数错误gitee_com_linmes_authms_base_dto.SimpleResponse
401未认证gitee_com_linmes_authms_base_dto.SimpleResponse
403权限不足gitee_com_linmes_authms_base_dto.SimpleResponse
404API Key未找到gitee_com_linmes_authms_base_dto.SimpleResponse
500服务器内部错误gitee_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 请立即保存新API Key,旧Key已失效

gitee_com_linmes_authms_base_dto.SimpleResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
message string No
timestamp string No