Autional Autional
API Reference GitHub autional.com →

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

NameInTypeRequiredDefaultExampleConstraintsDescription
id path string Yes Tenant ID

Request Body

Schema: dto.CreateApiKeyRequest

FieldTypeRequiredExampleConstraintsDescription
name string Yes HR system sync
scope string No admin

Responses

StatusDescriptionSchema
201API Key created successfullydto.DataResponse-dto_CreateApiKeyResponse
400Invalid request parametersgitee_com_linmes_authms_base_dto.SimpleResponse
401Unauthenticatedgitee_com_linmes_authms_base_dto.SimpleResponse
403Insufficient permissionsgitee_com_linmes_authms_base_dto.SimpleResponse
409API Key name conflictgitee_com_linmes_authms_base_dto.SimpleResponse
500Internal server errorgitee_com_linmes_authms_base_dto.SimpleResponse

Referenced Schemas

dto.CreateApiKeyResponse

FieldTypeRequiredExampleConstraintsDescription
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

FieldTypeRequiredExampleConstraintsDescription
code integer No
data dto.CreateApiKeyResponse No
message string No
timestamp string No

gitee_com_linmes_authms_base_dto.SimpleResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
message string No
timestamp string No