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

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_autional_base_dto.SimpleResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
message string No
timestamp string No