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 (minimum 8 characters). 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, disabled
string
created_at
required
Created At
string format: date-time
roles
required
Roles
Assigned role names, e.g. [‘admin’, ‘editor’]
Array<string>
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "username": "example", "email": "example", "is_active": true, "status": "example", "last_login_at": "2026-04-15T12:00:00Z", "created_at": "2026-04-15T12:00:00Z", "roles": [ "example" ]}Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}