Create an account (the only way in while sign-up is closed); the user signs in with this email and password
POST
/auth/admin/users
const url = 'http://localhost:8300/auth/admin/users';const options = { method: 'POST', headers: { 'x-api-key': '<x-api-key>', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"email":"hello@example.com","password":"example","name":"example","roles":["user"]}'};
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/users \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "email": "hello@example.com", "password": "example", "name": "example", "roles": [ "user" ] }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
email
required
Trimmed and lower-cased; a plain address
string format: email
password
required
Common passwords are refused (422 “password is too common”)
string
name
Trimmed; empty or missing = the part of the email before @
string
roles
required
Array<string>
Responses
Section titled “Responses”The new user
Media typeapplication/json
object
id
required
string format: uuid
email
required
string format: email
name
required
string
roles
required
Sorted; may be empty
Array<string>
disabled
required
boolean
created_at
required
string format: date-time
Example
{ "roles": [ "user" ]}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"}“email already registered”
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"}