Create User
POST
/admin/users/
const url = 'https://example.com/api/admin/users/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/admin/users/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "username": "example", "password": "example", "email": "[email protected]", "role": "viewer" }'Create a new user with the specified role (admin only).
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
AdminUserCreate
object
username
required
Username
Login username (3-150 chars). Must be unique across the system.
string
password
required
Password
Initial password (policy: min 12 chars, 3+ character classes). The user can change this after first login.
string
role
Role
User role: ‘admin’, ‘editor’, or ‘viewer’. Defaults to ‘viewer’.
string
Responses
Section titled “ Responses ”Successful Response
Media type application/json
UserResponse
object
id
required
Id
string format: uuid
username
required
Username
string
is_active
required
Is Active
boolean
status
required
Status
Account status: active, pending, suspended, or deactivated.
string
created_at
required
Created At
string format: date-time
roles
required
Roles
Assigned role names, e.g. [‘admin’, ‘editor’]
Array<string>
Example
{ "status": "active"}Bad request — invalid query parameters or payload
ProblemDetail
object
type
Type
string
title
required
Title
string
status
required
Status
integer
detail
required
Detail
string
Example
{ "type": "about:blank"}Unauthorized — missing or invalid credentials
ProblemDetail
object
type
Type
string
title
required
Title
string
status
required
Status
integer
detail
required
Detail
string
Example
{ "type": "about:blank"}Forbidden — caller lacks access to this resource
ProblemDetail
object
type
Type
string
title
required
Title
string
status
required
Status
integer
detail
required
Detail
string
Example
{ "type": "about:blank"}Not found
ProblemDetail
object
type
Type
string
title
required
Title
string
status
required
Status
integer
detail
required
Detail
string
Example
{ "type": "about:blank"}Validation error
ProblemDetail
object
type
Type
string
title
required
Title
string
status
required
Status
integer
detail
required
Detail
string
Example
{ "type": "about:blank"}Internal server error
ProblemDetail
object
type
Type
string
title
required
Title
string
status
required
Status
integer
detail
required
Detail
string
Example
{ "type": "about:blank"}