Users
List, read, create, update, disable, enable, and delete the users of a tenant, and reset their passwords.
The users of BPMS are the users of BPMS 3.x: the same accounts, with the same roles and tenants. The operations below work on the users of your tenant only, and require the BPMS 3.x authorities of the user administration.
| Operation | Call | Authority |
|---|---|---|
| List the users | GET /api/v1/access/users | 6.2.2.4 (View users) |
| Read a user | GET /api/v1/access/users/{userId} | 6.2.2.4 |
| Create a user | POST /api/v1/access/users | 6.2.2.1 (Create users) and every code of the user's roles |
| Update a user | PATCH /api/v1/access/users/{userId} | 6.2.2.2 (Edit users) |
| Disable or enable a user | POST /api/v1/access/users/{userId}/disable, .../enable | 6.2.2.2 |
| Delete a user | DELETE /api/v1/access/users/{userId} | 6.2.2.3 (Delete users) |
| Reset a user's password | POST /api/v1/access/users/{userId}/password | 6.2.2.2 and every code of the user's roles |
Roles are assigned to users and removed from them on Roles and authorities.
List the users
curl -sS -H "Authorization: Bearer $TOKEN" "$BPMS_URL/api/v1/access/users?page=0&size=20&sort=userName"page starts at 0, size is 20 by default and at most 100, and sort is userName (the default) or id. Disabled users are listed; deleted users are not. The answer is one page:
{
"items": [
{"id": 7, "userName": "jdoe", "name": "Jane", "lastName": "Doe", "identification": "1020304050",
"email": "jdoe@example.com", "enabled": true, "locked": false, "passwordChangeRequired": false}
],
"page": 0, "size": 20, "totalElements": 1, "totalPages": 1
}Read a user
curl -sS -H "Authorization: Bearer $TOKEN" "$BPMS_URL/api/v1/access/users/7"It answers 200 with the same fields as an item of the list.
Create a user
Put the new user in a user.json file kept out of version control, so the password stays out of your shell history:
{"userName": "jdoe", "name": "Jane", "lastName": "Doe", "identification": "1020304050",
"email": "jdoe@example.com", "password": "<password>", "roleIds": [3]}curl -sS -X POST -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
"$BPMS_URL/api/v1/access/users" -d @user.jsonIt answers 201 with the new user and its address in the Location header.
| Field | Rule |
|---|---|
userName | Required, at most 255 characters, unique across the installation in any case. |
name, lastName | Required, at most 255 characters. |
identification | Required, at most 15 letters and digits, unique in the tenant. |
email | Optional, at most 255 characters. When the installation requires it (BPMS_ACCESS_USERS_EMAILREQUIRED=true), it is required and unique in the tenant. |
password | Required, following the password policy below. |
roleIds | At least one role of your tenant. You can only give roles whose codes you hold. |
mustChangePassword | true by default: the user must change the password at the first sign-in. |
enabled | true by default. |
locked | false by default. With true, the user is created locked and cannot sign in until unlocked. |
Unless the tenant has unlimited users, its BPMS 3.x license caps the number of enabled users. When the tenant has no free place, an enabled user is refused with access.user-capacity-reached; a user created disabled takes no place.
Update a user
curl -sS -X PATCH -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
"$BPMS_URL/api/v1/access/users/7" -d '{"lastName": "Smith"}'The body carries any of userName, name, lastName, identification, and email, with the rules of creating a user; a field left out keeps its value, and an empty email removes it unless the installation requires it. It answers 200 with the user. Roles, password, and status have their own operations. A user may update itself.
Disable, enable, and delete a user
curl -sS -X POST -H "Authorization: Bearer $TOKEN" "$BPMS_URL/api/v1/access/users/7/disable"
curl -sS -X POST -H "Authorization: Bearer $TOKEN" "$BPMS_URL/api/v1/access/users/7/enable"
curl -sS -X DELETE -H "Authorization: Bearer $TOKEN" "$BPMS_URL/api/v1/access/users/7"Each answers 204, also when nothing changes.
- Disabling and deleting close at once all the user's sessions, including those of AI agents. Enabling the user again does not reopen them.
- Enabling needs a free place in the tenant's license.
- Deleting keeps the user in the database, marked as deleted, as BPMS 3.x does; the user is no longer listed and answers
404from then on. - You cannot disable or delete yourself.
Reset a user's password
Put the new password in a password.json file kept out of version control:
{"password": "<new password>", "mustChangePassword": true}curl -sS -X POST -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
"$BPMS_URL/api/v1/access/users/7/password" -d @password.jsonIt answers 204. The administrator chooses the new password; BPMS neither generates nor returns one.
mustChangePasswordistrueby default, so the user must change the password at the next sign-in;falselets the user sign in normally.- It closes all the user's sessions, including those of AI agents.
- It does not unlock a locked user.
- You cannot reset your own password; change it as described in Authentication.
Password policy
Every new password, set when creating a user, resetting one, or changing your own, follows the installation's policy. Its defaults are the BPMS 3.x rule:
| Variable | Default | Rule |
|---|---|---|
BPMS_ACCESS_PASSWORD_MINLENGTH | 8 | The minimum number of characters. |
BPMS_ACCESS_PASSWORD_MAXLENGTH | 100 | The maximum number of characters, between the minimum and 1024. |
BPMS_ACCESS_PASSWORD_REQUIRELOWER | true | A lowercase letter. |
BPMS_ACCESS_PASSWORD_REQUIREUPPER | true | An uppercase letter. |
BPMS_ACCESS_PASSWORD_REQUIREDIGIT | true | A digit. |
BPMS_ACCESS_PASSWORD_REQUIRESYMBOL | true | One of - + _ ! @ # $ % ^ & * . , ? or a space. |
A line break is always refused. A password that breaks the policy answers 400 with one error per broken rule.
Rules and errors
Every change, and every refusal for a missing authority, is recorded in the audit log. A refused request changes nothing.
| Status | code | When |
|---|---|---|
400 | core.validation-failed | A field or parameter is missing or invalid, or the password breaks the policy; errors lists each one. |
401 | core.authentication-required | The call has no valid token. |
403 | core.authority-required | The caller lacks the authority the operation requires, or a code of the roles involved. |
404 | access.user-not-found | The user does not exist in your tenant or is deleted. |
409 | access.username-taken | Another user of the installation has this username, in any case. |
409 | access.identification-taken | Another user of the tenant has this identification. |
409 | access.email-taken | Another user of the tenant has this email, while the email is required. |
409 | access.user-capacity-reached | The tenant has no free place for another enabled user. |
409 | access.user-self-change | You tried to disable, delete, or reset the password of yourself. |
409 | access.user-changed | The user's roles changed during a password reset; try again. |
In the OpenAPI document, the operations are listUsers, getUser, createUser, updateUser, disableUser, enableUser, deleteUser, and resetUserPassword, under the access tag.