POST /admin/tenants/{id}/api-keys
为指定租户创建 API Key,返回完整 key(仅显示一次),用于外部系统集成。参考:NIST SP 800-53 AC-2 (Account Management)
租户服务 `bearerAuth` application/json
Request Parameters
| Name | In | Type | Required | Default | Example | Constraints | Description |
id |
path |
string |
Yes |
|
|
|
租户ID |
Request Body
Schema: dto.CreateApiKeyRequest
| Field | Type | Required | Example | Constraints | Description |
name |
string |
Yes |
HR系统同步 |
|
|
scope |
string |
No |
admin |
|
|
Referenced Schemas
dto.CreateApiKeyResponse
| Field | Type | Required | Example | Constraints | Description |
api_key |
string |
No |
tk_a1b2c3d4e5f6... |
|
|
created_at |
string |
No |
2026-05-12T10:00:00Z |
|
|
id |
string |
No |
tak_001 |
|
|
key_prefix |
string |
No |
tk_a1b2c3d4 |
|
|
message |
string |
No |
请立即保存API Key,关闭后无法再次查看完整Key |
|
|
name |
string |
No |
HR系统同步 |
|
|
scope |
string |
No |
admin |
|
|
dto.DataResponse-dto_CreateApiKeyResponse
| Field | Type | Required | Example | Constraints | Description |
code |
integer |
No |
|
|
|
data |
dto.CreateApiKeyResponse |
No |
|
|
|
message |
string |
No |
|
|
|
timestamp |
string |
No |
|
|
|
gitee_com_linmes_authms_base_dto.SimpleResponse
| Field | Type | Required | Example | Constraints | Description |
code |
integer |
No |
|
|
|
message |
string |
No |
|
|
|
timestamp |
string |
No |
|
|
|