authAdminCreateApiKey
POST
/auth/admin/apikeys
const url = 'http://localhost:8300/auth/admin/apikeys';const options = { method: 'POST', headers: { 'x-api-key': '<x-api-key>', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"client":"example","scopes":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8300/auth/admin/apikeys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "client": "example", "scopes": [ "example" ] }'Issues a client API key (the client is created if new). The raw key is in this response only (Cache-Control: no-store); only its SHA-256 is stored.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
client
required
Client name; created if new
string
scopes
Default []
Array<string> | null
Example generated
{ "client": "example", "scopes": [ "example" ]}Responses
Section titled “Responses”The key, shown once
Media typeapplication/json
object
id
required
string format: uuid
client_id
required
string format: uuid
client
required
string
prefix
required
First 12 characters of the key (“helm_” + 7), for recognising it
string
scopes
required
Array<string>
created_at
required
string format: date-time
revoked_at
required
string | null format: date-time
last_used_at
required
Updated at most once a minute
string | null format: date-time
key
required
The raw key; returned only here
string
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "client_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "client": "example", "prefix": "example", "scopes": [ "example" ], "created_at": "2026-04-15T12:00:00Z", "revoked_at": "2026-04-15T12:00:00Z", "last_used_at": "2026-04-15T12:00:00Z", "key": "example"}Missing or invalid x-api-key (Kong), or missing/invalid/expired/revoked bearer token
Media typeapplication/json
object
detail
required
string
Example generated
{ "detail": "example"}Valid token without the admin role: “admin role required”
Media typeapplication/json
object
detail
required
string
Example generated
{ "detail": "example"}Invalid input: “invalid JSON body”, or the failed rule (“invalid email”, “name must be 1-200 characters”, “password must be at least 10 characters”, “password is too common”, “roles must not be empty”, …)
Media typeapplication/json
object
detail
required
string
Example generated
{ "detail": "example"}