rest/user
URL |
|
|---|---|
Method | POST |
Description | Create a new user. First user can be created by everyone and will have |
Required Role | Administrator (first user is allowed for all) |
Request | {
"role": "administrator|user",
"password": "<password>"
} |
Response | HTTP201 when successful |
Possible Errors | HTTP401 when valid JWT was needed but not supplied HTTP409 if user already exists HTTP400 when request was invalid {
"message": «human readable error»
} |
Status | Added in 2.5.0 |
URL |
|
|---|---|
Method | DELETE |
Description | Delete an existing user. You cannot delete yourself, unless you are the last user in the system. |
Required Role | Administrator |
Response | HTTP204 when successful |
Possible Errors | HTTP401 when valid JWT was needed but not supplied HTTP409 when trying to delete yourself, while there are still other users |
Status | Added in 2.5.0 |
URL |
|
|---|---|
Method | GET |
Description | Get a list of all users |
Required Role | Administrator |
Response | [
{
"username": "<<username>>",
"role": "administrator|user"
},
...
] |
Possible Errors | HTTP401 when valid JWT was needed but not supplied, or user does not have required role. |
Status | Added in 2.5.0 |