Appearance
Users
User management. Only root users can create, delete, and fully manage users. admin users can list users. Regular user accounts can only view and update their own profile.
Routes
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/users | JWT (admin/root) | List users |
| GET | /api/user/:id | JWT (admin/root/user) | Get single user (users can only see self) |
| PUT | /api/user | JWT (root) | Create a user |
| POST | /api/user/:id | JWT (root) | Create or update a user |
| PATCH | /api/user/:id | JWT (root/admin/user) | Update user (users/admins can only update self) |
| DELETE | /api/user/:id | JWT (root) | Delete single user |
| DELETE | /api/users | JWT (root) | Bulk delete users |
List Users
GET /api/users?query=<JSON>Filterable fields: id (numeric), username (string), email (string), usergroup (string).
Create User (PUT)
PUT /api/userBody
| Field | Type | Required | Description |
|---|---|---|---|
id | number | No | Entity ID |
username | string | Yes | Login username |
password | string | Yes | Password |
passwordrepeat | string | No | Password confirmation |
usergroup | enum: root, admin, user | Yes | User role |
email | string | Yes | Email address |
roapikey | string | No | Read-only API key |
rwapikey | string | No | Read-write API key |
ip | string | No | IP restriction |
config | object | No | Configuration object |
rights | array | No | Rights assignments |
Username and email must be unique.
Update User (POST)
POST /api/user/:idBody
| Field | Type | Required | Description |
|---|---|---|---|
id | number | No | Entity ID |
username | string | Yes | Login username |
password | string | No | Password |
passwordrepeat | string | No | Password confirmation |
usergroup | enum: root, admin, user | Yes | User role |
email | string | Yes | Email address |
roapikey | string | Yes | Read-only API key |
rwapikey | string | Yes | Read-write API key |
ip | string | Yes | IP restriction |
config | object | Yes | Configuration object |
rights | array | No | Rights assignments |
Partial Update (PATCH)
PATCH /api/user/:idBody
| Field | Type | Required | Description |
|---|---|---|---|
id | number | No | Entity ID |
username | string | No | Login username |
password | string | No | Password |
passwordrepeat | string | No | Password confirmation |
usergroup | enum: root, admin, user | No | User role |
email | string | No | Email address |
roapikey | string | No | Read-only API key |
rwapikey | string | No | Read-write API key |
ip | string | No | IP restriction |
config | object | No | Configuration object |
rights | array | No | Rights assignments |
Non-root users can only PATCH their own account.
Delete
Single: DELETE /api/user/:id (root only)
Bulk: DELETE /api/users with body {"where": {"id": {"$in": [1, 2, 3]}}} (root only)