OPNexusdocs

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.

Berechtigung users.read (ansehen)

Antwort 200 UserRead[]

7 Felder anzeigen
FeldTypHinweise
auth_sourcestring default: "local"
created_at *string (date-time)
id *string (uuid)
last_login_at *string (date-time) | null
role *string
totp_enabledboolean default: false
username *string

POST /api/users#

Create User

Berechtigung users.manage (verwalten)

Anfrage-Body UserCreate

3 Felder anzeigen
FeldTypHinweise
password *stringminLength 10, maxLength 1024
rolestring default: "read_only" · minLength 2, maxLength 40, pattern ^[a-z0-9_-]+$
username *stringminLength 1, maxLength 150

Antwort 201 UserRead

7 Felder anzeigen
FeldTypHinweise
auth_sourcestring default: "local"
created_at *string (date-time)
id *string (uuid)
last_login_at *string (date-time) | null
role *string
totp_enabledboolean default: false
username *string

DELETE /api/users/{user_id}#

Delete User

Berechtigung users.manage (verwalten)

Parameter

user_id *pathstring (uuid)

Antwort 204

POST /api/users/{user_id}/reset-2fa#

Reset Two Factor

Admin recovery for a user who lost their authenticator and recovery codes.

Berechtigung users.manage (verwalten)

Parameter

user_id *pathstring (uuid)

Antwort 200 UserRead

7 Felder anzeigen
FeldTypHinweise
auth_sourcestring default: "local"
created_at *string (date-time)
id *string (uuid)
last_login_at *string (date-time) | null
role *string
totp_enabledboolean default: false
username *string

POST /api/users/{user_id}/reset-password#

Reset Password

Berechtigung users.manage (verwalten)

Parameter

user_id *pathstring (uuid)

Anfrage-Body UserPasswordReset

1 Felder anzeigen
FeldTypHinweise
new_password *stringminLength 10, maxLength 1024

Antwort 200 UserRead

7 Felder anzeigen
FeldTypHinweise
auth_sourcestring default: "local"
created_at *string (date-time)
id *string (uuid)
last_login_at *string (date-time) | null
role *string
totp_enabledboolean default: false
username *string

PATCH /api/users/{user_id}/role#

Update Role

Berechtigung users.manage (verwalten)

Parameter

user_id *pathstring (uuid)

Anfrage-Body UserRoleUpdate

1 Felder anzeigen
FeldTypHinweise
role *stringminLength 2, maxLength 40, pattern ^[a-z0-9_-]+$

Antwort 200 UserRead

7 Felder anzeigen
FeldTypHinweise
auth_sourcestring default: "local"
created_at *string (date-time)
id *string (uuid)
last_login_at *string (date-time) | null
role *string
totp_enabledboolean default: false
username *string