CMS users. Listing and editing users needs user management rights; users outside them return 404.
List users
Returns users, highest id first. Deleted users and users signed in through secure LDAP are never listed. A caller outside group 1 sees the users that belong to at least one group its own groups manage, when its group has the users_view right and the managed group has rights to the current site; without any such group the list is empty. A member of group 1 sees every user who belongs to a group with rights to the current site. A group_id[] filter that names a group the caller may not view returns 400. Account module fields are returned when that module is enabled. Password hashes are never returned.
query Parameters
limitThe number of items to return, 0 to 200. A value outside that range returns 400.
offsetThe number of items to skip. A negative value is treated as 0. Use the next and prev links of the response to page through a list.
group_id[]Return only users who belong to at least one of these groups. Repeat the parameter for several ids, e.g. group_id[]=4&group_id[]=7; without the brackets the value is not an array and the request returns 400. A value that is not an integer, or a group the caller may not view, returns 400.
email[]Return only users with one of these email addresses (exact, case-sensitive match). Repeat the parameter for several addresses, e.g. email[]=a@example.com&email[]=b@example.com; without the brackets the request returns 400.
List users › Responses
OK
hrefFirst page.
Previous page; the offset stops at 0.
Next page. On the last page the link wraps around to offset 0.
Create a user
Creates a user and returns it in items. If the request sent no password, the response has the generated one after active; a password you send is never returned. Every group in groups must exist and be one the caller may assign: a group that the caller's groups manage, when its group has the users_modify right and the managed group has rights to the current site. Group 1 can be assigned only by a member of group 1. Returns 400 when a required field is missing, a field has the wrong type, email is not a valid address, username is taken (compared without regard to case), groups names a group that does not exist or cannot be assigned, password is shorter than 8 bytes, sex is not m or f, or a date is not ISO 8601. Unknown fields are ignored.
Create a user › Request Body
groupsIds of the groups the user is a member of. In a request every group must exist and be one the caller may assign (see Create a user). In PATCH the list replaces the memberships; an empty list is ignored. The user's primary group is set to the first group listed.
usernameUnique, compared without regard to case.
emailMust be a valid email address. Uniqueness is not checked.
nameDisplay name.
activeDefaults to true when a user is created.
valid_toExpiry time of the account. Takes ISO 8601 (a date alone is accepted). Null clears it in PATCH; POST refuses null.
passwordPlaintext password, at least 8 bytes. It is stored only as a hash and never returned. When a user is created without one, the CMS generates a random 15-character password. Changing the password ends the user's sessions.
firstnamelastnamebirthdateTakes ISO 8601 (a date alone is accepted); returned as a date-time.
cityaddress1address2address3address4postalcodedescriptionavatarextra1extra2extra3sexphonecompany_namecompany_codecompany_addresscompany_citycompany_postalcodecompany_phonecompany_wwwcompany_fieldcompany_sizecompany_statecompany_countrysome1some2some3ssnSocial security number. Deprecated and being removed; don't use it.
ibanBank account number. Deprecated and being removed; don't use it.
Create a user › Responses
OK
Get a user
Returns one user in items; the item has no href. A caller outside group 1 needs the users_view right over at least one group of the user (see List users), otherwise 404. A user that does not exist, is deleted, signs in through secure LDAP or belongs to no group also returns 404. An id that is not a positive integer returns 400. Account module fields are returned when that module is enabled.
path Parameters
user-idId of the user.
Get a user › Responses
OK
Update a user
Changes the given fields and returns the user in items. password is never returned; a password change ends the user's sessions. groups replaces the memberships. The caller needs the users_modify right over at least one group of the user (members of group 1 are exempt from this part) and must manage every group of the user, where only a member of group 1 manages group 1; the caller's own account is exempt from the second rule. Otherwise, and for the same users as in Get a user, it returns 404. The validation errors of Create a user return 400 here too, as does a body with no known field.
path Parameters
user-idId of the user.
Update a user › Request Body
groupsIds of the groups the user is a member of. In a request every group must exist and be one the caller may assign (see Create a user). In PATCH the list replaces the memberships; an empty list is ignored. The user's primary group is set to the first group listed.
usernameUnique, compared without regard to case.
emailMust be a valid email address. Uniqueness is not checked.
nameDisplay name.
activeDefaults to true when a user is created.
valid_toExpiry time of the account. Takes ISO 8601 (a date alone is accepted). Null clears it in PATCH; POST refuses null.
passwordPlaintext password, at least 8 bytes. It is stored only as a hash and never returned. When a user is created without one, the CMS generates a random 15-character password. Changing the password ends the user's sessions.
firstnamelastnamebirthdateTakes ISO 8601 (a date alone is accepted); returned as a date-time.
cityaddress1address2address3address4postalcodedescriptionavatarextra1extra2extra3sexphonecompany_namecompany_codecompany_addresscompany_citycompany_postalcodecompany_phonecompany_wwwcompany_fieldcompany_sizecompany_statecompany_countrysome1some2some3ssnSocial security number. Deprecated and being removed; don't use it.
ibanBank account number. Deprecated and being removed; don't use it.
Update a user › Responses
OK
Delete a user
Soft-deletes the user: username and email become deleted_{id}_{original value} and the user is marked deleted. The response holds the user as it was before the deletion, without password. The caller needs the users_delete right and the users_modify right over at least one group of the user (members of group 1 are exempt from the latter), must manage every group of the user, and may not delete itself or a member of group 1. Otherwise, and for the same users as in Get a user, it returns 404.
path Parameters
user-idId of the user.
Delete a user › Responses
OK
Create users in a batch
- The body is a JSON array of users; an empty body returns 400. The users are processed by a background job: the response is 202 with
hrefpointing to/job_queue/{job-queue-id}. Poll it; when the job is done it redirects to/batch/users/{job-queue-id}, which lists the rejected elements. - Each element is validated as in
POST /users;passwordis required, and a username repeated within the batch makes the later element invalid. - Unknown fields make an element invalid (the single-item endpoints ignore them). Invalid elements are skipped and the valid ones are written. If no element is valid, the whole job fails with message
Invalid request body. - The rights are checked again when the job runs; if they are missing then, the job fails.
- No limit on the number of elements is enforced.
- No module check.
- Requires the
users_modifypermission in at least one group of this site, otherwise 403.
Create users in a batch › Request Body
groupsIds of the groups the user is a member of. In a request every group must exist and be one the caller may assign (see Create a user). In PATCH the list replaces the memberships; an empty list is ignored. The user's primary group is set to the first group listed.
usernameUnique, compared without regard to case.
emailMust be a valid email address. Uniqueness is not checked.
nameDisplay name.
passwordPlaintext password, at least 8 bytes. It is stored only as a hash and never returned. When a user is created without one, the CMS generates a random 15-character password. Changing the password ends the user's sessions.
activeDefaults to true when a user is created.
valid_toExpiry time of the account. Takes ISO 8601 (a date alone is accepted). Null clears it in PATCH; POST refuses null.
firstnamelastnamebirthdateTakes ISO 8601 (a date alone is accepted); returned as a date-time.
cityaddress1address2address3address4postalcodedescriptionavatarextra1extra2extra3sexphonecompany_namecompany_codecompany_addresscompany_citycompany_postalcodecompany_phonecompany_wwwcompany_fieldcompany_sizecompany_statecompany_countrysome1some2some3ssnSocial security number. Deprecated and being removed; don't use it.
ibanBank account number. Deprecated and being removed; don't use it.
Create users in a batch › Responses
Accepted. The job was started; href is the job queue URL to poll.
Update users in a batch
- The body is a JSON array of users; an empty body returns 400. The users are processed by a background job: the response is 202 with
hrefpointing to/job_queue/{job-queue-id}. Poll it; when the job is done it redirects to/batch/users/{job-queue-id}, which lists the rejected elements. - Each element needs
idand is validated as inPATCH /users/{user-id}. An id that does not exist, a user outside the groups the token user may manage, an id repeated within the batch, or a username repeated within the batch makes the element invalid. - Unknown fields make an element invalid (the single-item endpoints ignore them). Invalid elements are skipped and the valid ones are written. If no element is valid, the whole job fails with message
Invalid request body. - The rights are checked again when the job runs; if they are missing then, the job fails.
- No limit on the number of elements is enforced.
- No module check.
- Requires the
users_modifypermission in at least one group of this site, otherwise 403.
Update users in a batch › Request Body
idgroupsIds of the groups the user is a member of. In a request every group must exist and be one the caller may assign (see Create a user). In PATCH the list replaces the memberships; an empty list is ignored. The user's primary group is set to the first group listed.
usernameUnique, compared without regard to case.
emailMust be a valid email address. Uniqueness is not checked.
nameDisplay name.
activeDefaults to true when a user is created.
valid_toExpiry time of the account. Takes ISO 8601 (a date alone is accepted). Null clears it in PATCH; POST refuses null.
passwordPlaintext password, at least 8 bytes. It is stored only as a hash and never returned. When a user is created without one, the CMS generates a random 15-character password. Changing the password ends the user's sessions.
firstnamelastnamebirthdateTakes ISO 8601 (a date alone is accepted); returned as a date-time.
cityaddress1address2address3address4postalcodedescriptionavatarextra1extra2extra3sexphonecompany_namecompany_codecompany_addresscompany_citycompany_postalcodecompany_phonecompany_wwwcompany_fieldcompany_sizecompany_statecompany_countrysome1some2some3ssnSocial security number. Deprecated and being removed; don't use it.
ibanBank account number. Deprecated and being removed; don't use it.
Update users in a batch › Responses
Accepted. The job was started; href is the job queue URL to poll.
Get the result of a users batch job
Returns the outcome of a batch job started with POST or PATCH /batch/users, always with status 200.
- When the job has completed,
itemslists the rejected elements as they were given (the fieldspassword,unhashed_password,ssnandibanare replaced with[REDACTED]) anderrorssays why each was rejected, in the same order. Both are empty arrays when every element was written. - When the whole job failed,
statusis given instead, with statefailed, the reason inmessageand the per-elementerrors. - A job with a status but not yet completed gives
statuswith stateprocessing. Batch jobs write their status only when they finish, so a running job is not found yet (404). - An id that is not 1 to 64 letters, digits,
_or-returns 400. An unknown job, one whose status is older than 24 hours, or a job of another batch resource returns 404. - No module check. No other permission is checked, and the job does not have to be the user's own.
path Parameters
job-queue-id^[A-Za-z0-9_-]{1,64}… · requiredId of the job, as given in the href of the POST or PATCH response: 1 to 64 letters, digits, _ or -. Any other id returns 400.
Get the result of a users batch job › Responses
OK
hrefWhy each rejected element was rejected, in the same order as items.
Present instead of items while the job is processing (state 'processing', without errors) or when the whole job failed (state 'failed', with message and errors). Both are returned with HTTP 200.