Skip to content
Products

Users API

Users are the accounts that can sign in to the web interface and use the API. Read more about roles in Users and Roles.

{
"enable": true,
"role": "observer"
}
  • enable: Allows the user to sign in. A user with false cannot get a token.
  • role: admin or observer. Read more in Roles.
Terminal window
POST /api/user

Available to admin. The body has the id (login), the password, and the fields of the user.

Terminal window
curl -sS -X POST -H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
'http://alta.example.com:8100/api/user' \
-d '{"id": "monitoring", "password": "PASSWORD", "enable": true, "role": "observer"}'

Returns 204, 400 if the id or the password is empty, or 409 if the user exists.

Terminal window
GET /api/user?id=<user_id>

Returns the user object, or 404. The admin and observer roles can read any user. Other users can read only themselves. The response never has the password.

Terminal window
PUT /api/user?id=<user_id>

Available to admin. Send the complete object. An administrator cannot change their own role or status: the request returns 422. Ask another administrator to do it.

Terminal window
DELETE /api/user?id=<user_id>

Available to admin. An administrator cannot delete themselves: the request returns 422.

Terminal window
POST /api/user/reset-password?id=<user_id>

An administrator can change the password of any user. Any other user can change only their own password.

Terminal window
curl -sS -X POST -H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
'http://alta.example.com:8100/api/user/reset-password?id=monitoring' \
-d '{"password": "NEW-PASSWORD"}'

Returns 204, or 404 if the user does not exist. If nobody can sign in as an administrator, read Change Password.