2. Users

2.1. Get Users

Endpoint: /users/users
Method: GET
Request header: Authorization: Bearer <access_token>
Description: Get the list of users
Permission required: Administrator
Response data:
Field Type
message string
message_type string
result
list of objects:
- id: string
- username: string
- admin: boolean
- enabled: boolean
- name: string (optional)
- email: string (optional)
- created: string
- last_modified: string
Request example:
curl -X 'GET' '{{ host_url }}users/users' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access_token>'

2.2. Get User

Endpoint: /users/user/<user_id>
Method: GET
Request header: Authorization: Bearer <access_token>
Description: Get a user
Permission required: Administrator if the user to get is other than the user that makes the request
Response data:
Field Type
message string
message_type string
result
object:
- id: string
- username: string
- admin: boolean
- enabled: boolean
- name: string (optional)
- email: string (optional)
- created: string
- last_modified: string
Request example:
curl -X 'GET' '{{ host_url }}users/user/<user_id>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access_token>'

2.3. Create User

Endpoint: /users/user
Methods: POST, PUT
Request header: Authorization: Bearer <access_token>
Description: Create a user
Permission required: Administrator
Request data:
Field Type Required Default value
username string Yes
password string Yes
admin boolean No false
enabled boolean No false
name string No
email string No
Response data:
Field Type
message string
message_type string
result
object
- user_id: string
Request example:
curl -X 'POST' '{{ host_url }}users/user' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access_token>' \
-d '{"username": "exampleusername", "password": "examplepassword", "admin": false, "enabled": true}'

2.4. Update User

Endpoint: /users/user/<user_id>
Method: PUT
Request header: Authorization: Bearer <access_token>
Description: Update some or all fields of a user
Permission required: Administrator if the user to update is other than the user that makes the request or if the fields to update include username, admin or enabled
Request data:
Field Type Required Default value
username string Yes
password string Yes
admin boolean No false
enabled boolean No false
name string No
email string No
Response data:
Field Type
message string
message_type string
Request example:
curl -X 'PUT' '{{ host_url }}users/user/<user_id>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access_token>' \
-d '{"username": "exampleusername", "password": "examplepassword", "admin": false, "enabled": true}'

2.5. Delete User

Endpoint: /users/user/<user_id>
Method: DELETE
Request header: Authorization: Bearer <access_token>
Description: Delete a user
Fresh access token required: Yes
Permission required: Administrator
Response data:
Field Type
message string
message_type string
Request example:
curl -X 'DELETE' '{{ host_url }}users/user/<user_id>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access_token>'