Docs › API Reference › Tenant Service › POST /admin/tenants/{tenant_id}/api-keys
POST /admin/tenants/{tenant_id}/api-keys
Create an API Key for a tenant, returning the full key (shown only once). For external system integration. Reference: NIST SP 800-53 AC-2 (Account Management).
Tenant Service `bearerAuth` application/json
Request Parameters
Name In Type Required Default Example Constraints Description
id
path
string
Yes
Tenant ID
Request Body
Schema: dto.CreateApiKeyRequest
Field Type Required Example Constraints Description
name
string
Yes
HR system sync
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
Please save the API Key immediately; it cannot be viewed again after closing
name
string
No
HR system sync
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