POST /admin/tenants/{tenant_id}/api-keys/{key_id}/rotate
轮换指定 API Key,生成新 key 并使旧 key 立即失效
租户服务 `bearerAuth` application/json
请求参数
| 名称 | 位置 | 类型 | 必填 | 默认值 | 示例 | 约束 | 描述 |
tenant_id |
path |
string |
是 |
|
|
|
租户ID |
key_id |
path |
string |
是 |
|
|
|
API Key ID |
引用的 Schema
dto.DataResponse-service-tenant/internal/handler/dto/RotateApiKeyResponse
service-core/base/dto.SimpleResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
code |
integer |
否 |
|
|
|
message |
string |
否 |
|
|
|
timestamp |
string |
否 |
|
|
|
service-tenant/internal/handler/dto.RotateApiKeyResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
api_key |
string |
否 |
tk_f6e7d8c9a0b1... |
|
|
created_at |
string |
否 |
2026-05-12T16:00:00Z |
|
|
id |
string |
否 |
tak_001 |
|
|
key_prefix |
string |
否 |
tk_f6e7d8c9 |
|
|
message |
string |
否 |
请立即保存新API Key,旧Key已失效 |
|
|