Create or update many users, contacts, news items, events or products in one request, processed by a background job.
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.
Create products in a batch
- The body is a JSON array of products; an empty body returns 400. The products 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/products/{job-queue-id}, which lists the rejected elements. - Each element is validated as in
POST /products. - 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.
- Requires the Products module to be enabled and accessible to the user, otherwise 403.
- Requires the
products_modifyorproducts_deletepermission or membership in group 1, otherwise 403. (products_import, which is enough forPOST /products, is not enough here.)
Create products in a batch › Request Body
Product name per language, keyed by language code. On input every key must be a language of the site (case-insensitive) and every value a string, otherwise 400.
categoriesCategory ids. Every id must be a category the user may use (400). On update the list replaces the current categories. In responses to GET only the categories the user may view are listed; the list is null when there are none.
commentingownerUser id of the owner. Must be an existing user (400). Defaults to the token's user on create.
valid_fromISO 8601. Must not be later than valid_to (400). null clears it on update.
valid_toISO 8601. null clears it on update.
visibilityOn update, each element replaces the values of that property in that language and null deletes all properties of the product.
Create products in a batch › Responses
Accepted. The job was started; href is the job queue URL to poll.
Update products in a batch
- The body is a JSON array of products; an empty body returns 400. The products 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/products/{job-queue-id}, which lists the rejected elements. - Each element needs
idand is validated as inPATCH /products/{product-id}. An id that does not exist, a product in a category the user may not use, or an id 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.
- Requires the Products module to be enabled and accessible to the user, otherwise 403.
- Requires the
products_modifyorproducts_deletepermission or membership in group 1, otherwise 403. (products_import, which is enough forPOST /products, is not enough here.)
Update products in a batch › Request Body
idProduct name per language, keyed by language code. On input every key must be a language of the site (case-insensitive) and every value a string, otherwise 400.
commentingownerUser id of the owner. Must be an existing user (400). Defaults to the token's user on create.
valid_fromISO 8601. Must not be later than valid_to (400). null clears it on update.
valid_toISO 8601. null clears it on update.
visibilitycategoriesCategory ids. Every id must be a category the user may use (400). On update the list replaces the current categories. In responses to GET only the categories the user may view are listed; the list is null when there are none.
On update, each element replaces the values of that property in that language and null deletes all properties of the product.
Update products in a batch › Responses
Accepted. The job was started; href is the job queue URL to poll.
Get the result of a products batch job
Returns the outcome of a batch job started with POST or PATCH /batch/products, 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. - Requires the Products module to be enabled and accessible to the user, otherwise 403. 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 products 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.
Create contacts in a batch
- The body is a JSON array of contacts; an empty body returns 400. The contacts 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/contacts/{job-queue-id}, which lists the rejected elements. - Each element is validated as in
POST /contacts. - 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.
- Requires the Contacts module to be enabled, otherwise 403.
- Requires the
contacts_modifyorcontacts_importpermission or membership in group 1, otherwise 403.
Create contacts in a batch › Request Body
Decision Table
| Variant | Matching Criteria |
|---|---|
| type = object · requires: firstname, lastname, categories | |
| type = object · requires: type, names, categories |
firstnamePerson contacts only; ignored for organizations.
lastnamePerson contacts only; ignored for organizations.
categoriesIds of contact categories (under the contacts root category) on which the caller's group has admin rights, with the categories right. Any other id returns 400. In PATCH the list replaces the categories and the property values of removed categories are deleted; an empty list is ignored.
typeownerId of an existing user who is not deleted. Defaults to the caller when a contact is created.
valid_fromISO 8601. Must not be later than valid_to when both are given.
valid_toISO 8601.
visibilityProperty values to set. Each entry replaces the values of that property in that language. The property must belong to a category of the contact. In PATCH null deletes every property value of the contact. Values of keyvalue properties cannot be written.
Create contacts in a batch › Responses
Accepted. The job was started; href is the job queue URL to poll.
Update contacts in a batch
- The body is a JSON array of contacts; an empty body returns 400. The contacts 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/contacts/{job-queue-id}, which lists the rejected elements. - Each element needs
idand is validated as inPATCH /contacts/{contact-id}. An id that does not exist, a contact the user has no rights to, or an id 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.
- Requires the Contacts module to be enabled, otherwise 403.
- Requires the
contacts_modifyorcontacts_importpermission or membership in group 1, otherwise 403.
Update contacts in a batch › Request Body
idDecision Table
| Variant | Matching Criteria |
|---|---|
| type = object | |
| type = object |
firstnamePerson contacts only; ignored for organizations.
lastnamePerson contacts only; ignored for organizations.
typeownerId of an existing user who is not deleted. Defaults to the caller when a contact is created.
valid_fromISO 8601. Must not be later than valid_to when both are given.
valid_toISO 8601.
visibilitycategoriesIds of contact categories (under the contacts root category) on which the caller's group has admin rights, with the categories right. Any other id returns 400. In PATCH the list replaces the categories and the property values of removed categories are deleted; an empty list is ignored.
Property values to set. Each entry replaces the values of that property in that language. The property must belong to a category of the contact. In PATCH null deletes every property value of the contact. Values of keyvalue properties cannot be written.
Update contacts in a batch › Responses
Accepted. The job was started; href is the job queue URL to poll.
Get the result of a contacts batch job
Returns the outcome of a batch job started with POST or PATCH /batch/contacts, 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. - Requires the Contacts module to be enabled, otherwise 403. 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 contacts 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.
Create news items in a batch
- The body is a JSON array of news items; an empty body returns 400. The news items 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/news/{job-queue-id}, which lists the rejected elements. - Each element is validated as in
POST /news. - 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.
- Requires the News module to be enabled and accessible to the user, otherwise 403.
- Requires the
sitenews_modifypermission or membership in group 1, otherwise 403.
Create news items in a batch › Request Body
Title per language; at least one.
Category ids per language. Every language of translations needs at least one category that has a name
in that language; categories without a name in the language are not linked to that version. Every id
must be a news category the user can administer.
Commenting per language; public when not given.
Owner user id per language, as a JSON integer; the current user when not given. The user must exist and not be deleted.
Start of validity per language (ISO 8601).
End of validity per language (ISO 8601); must not be before valid_froms of the same language.
Visibility per language; public when not given.
Create news items in a batch › Responses
Accepted. The job was started; href is the job queue URL to poll.
Update news items in a batch
- The body is a JSON array of news items; an empty body returns 400. The news items 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/news/{job-queue-id}, which lists the rejected elements. - Each element needs
idand is validated as inPATCH /news/{news-id}. An id that does not exist, a news item the user has no rights to, or an id 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.
- Requires the News module to be enabled and accessible to the user, otherwise 403.
- Requires the
sitenews_modifypermission or membership in group 1, otherwise 403.
Update news items in a batch › Request Body
idtranslationTitle.
introbodycommentingownerOwner user id as a JSON string (an integer is refused). The user must exist and not be deleted.
valid_fromvalid_tovisibilitycategoriesThe complete new set of category ids; each must be a news category the user can administer. Values of properties that belong to removed categories are deleted.
Property values to replace. null deletes all property values of the item.
Update news items in a batch › Responses
Accepted. The job was started; href is the job queue URL to poll.
Get the result of a news batch job
Returns the outcome of a batch job started with POST or PATCH /batch/news, 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. - Requires the News module to be enabled and accessible to the user, otherwise 403. 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 news 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.
Create events in a batch
- The body is a JSON array of events; an empty body returns 400. The events 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/events/{job-queue-id}, which lists the rejected elements. - Each element is validated as in
POST /events. - 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.
- Requires the Calendar module to be enabled and accessible to the user, otherwise 403.
- Requires the
events_modifypermission or membership in group 1, otherwise 403.
Create events in a batch › Request Body
Title per language; at least one.
Category ids per language. Every language of translations needs at least one category that has a name
in that language; categories without a name in the language are not linked to that version. Every id
must be an event category the user can administer.
Commenting per language; public when not given.
Owner user id per language, as a JSON integer; the current user when not given. The user must exist and not be deleted.
Start of validity per language (ISO 8601).
End of validity per language (ISO 8601); must not be before valid_froms of the same language.
Visibility per language; public when not given.
Create events in a batch › Responses
Accepted. The job was started; href is the job queue URL to poll.
Update events in a batch
- The body is a JSON array of events; an empty body returns 400. The events 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/events/{job-queue-id}, which lists the rejected elements. - Each element needs
idand is validated as inPATCH /events/{event-id}. An id that does not exist, an event the user has no rights to, or an id 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.
- Requires the Calendar module to be enabled and accessible to the user, otherwise 403.
- Requires the
events_modifypermission or membership in group 1, otherwise 403.
Update events in a batch › Request Body
idtranslationTitle.
introbodycommentingownerOwner user id as a JSON string (an integer is refused). The user must exist and not be deleted.
valid_fromvalid_tovisibilitycategoriesThe complete new set of category ids; each must be an event category the user can administer. Values of properties that belong to removed categories are deleted.
Property values to replace. null deletes all property values of the item.
Update events in a batch › Responses
Accepted. The job was started; href is the job queue URL to poll.
Get the result of an events batch job
Returns the outcome of a batch job started with POST or PATCH /batch/events, 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. - Requires the Calendar module to be enabled and accessible to the user, otherwise 403. 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 an events 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.