API: users
GET /api/users#
List Users
Whoever may manage users (an admin) sees everyone. Every other role sees only its own account: the full list (names, roles, last login, 2FA status) is a directory an attacker with any low-privilege account or token could use to pick targets.
Permission users.read (look)
Response 200 UserRead[]
Show 7 fields
| Field | Type | Notes |
|---|---|---|
auth_source | string | default: "local" |
created_at * | string (date-time) | |
id * | string (uuid) | |
last_login_at * | string (date-time) | null | |
role * | string | |
totp_enabled | boolean | default: false |
username * | string |
POST /api/users#
Create User
Permission users.manage (administer)
Request body UserCreate
Show 3 fields
| Field | Type | Notes |
|---|---|---|
password * | string | minLength 10, maxLength 1024 |
role | string | default: "read_only" · minLength 2, maxLength 40, pattern ^[a-z0-9_-]+$ |
username * | string | minLength 1, maxLength 150 |
Response 201 UserRead
Show 7 fields
| Field | Type | Notes |
|---|---|---|
auth_source | string | default: "local" |
created_at * | string (date-time) | |
id * | string (uuid) | |
last_login_at * | string (date-time) | null | |
role * | string | |
totp_enabled | boolean | default: false |
username * | string |
DELETE /api/users/{user_id}#
Delete User
Permission users.manage (administer)
Parameters
user_id * | path | string (uuid) |
Response 204
POST /api/users/{user_id}/reset-2fa#
Reset Two Factor
Admin recovery for a user who lost their authenticator and recovery codes.
Permission users.manage (administer)
Parameters
user_id * | path | string (uuid) |
Response 200 UserRead
Show 7 fields
| Field | Type | Notes |
|---|---|---|
auth_source | string | default: "local" |
created_at * | string (date-time) | |
id * | string (uuid) | |
last_login_at * | string (date-time) | null | |
role * | string | |
totp_enabled | boolean | default: false |
username * | string |
POST /api/users/{user_id}/reset-password#
Reset Password
Permission users.manage (administer)
Parameters
user_id * | path | string (uuid) |
Request body UserPasswordReset
Show 1 fields
| Field | Type | Notes |
|---|---|---|
new_password * | string | minLength 10, maxLength 1024 |
Response 200 UserRead
Show 7 fields
| Field | Type | Notes |
|---|---|---|
auth_source | string | default: "local" |
created_at * | string (date-time) | |
id * | string (uuid) | |
last_login_at * | string (date-time) | null | |
role * | string | |
totp_enabled | boolean | default: false |
username * | string |
PATCH /api/users/{user_id}/role#
Update Role
Permission users.manage (administer)
Parameters
user_id * | path | string (uuid) |
Request body UserRoleUpdate
Show 1 fields
| Field | Type | Notes |
|---|---|---|
role * | string | minLength 2, maxLength 40, pattern ^[a-z0-9_-]+$ |
Response 200 UserRead
Show 7 fields
| Field | Type | Notes |
|---|---|---|
auth_source | string | default: "local" |
created_at * | string (date-time) | |
id * | string (uuid) | |
last_login_at * | string (date-time) | null | |
role * | string | |
totp_enabled | boolean | default: false |
username * | string |