Batch create or update
This endpoint creates or updates multiple users in one call. A user whose user_name does not match an existing user is created with all the fields given. If the user_name already exists in the portal, that user is updated with only the fields that are given. To clear an optional field, send an empty string, eg "manager_email": "".
Each user object accepts the same fields as Create a new user, plus the enrolment fields below. user_name matching is case-insensitive. New users need user_name, first_name, last_name and email.
In the response, created, updated and unchanged count users the batch attempted to create or update, including users that then failed with an error. A failed user is listed in error_list and is not saved. enrolled counts enrolments successfully made, and invitations_sent and invitations_failed count invitation emails. errors is the number of entries in error_list, which includes enrolment errors as well as users with errors.
Errors
If there are no errors, the errors count in the response will be 0. If there are errors in the batch run, there will be an error count above 0. The batch run will execute all the rows that do not have any errors, and those that do have errors it will return a list of who the user was (user_name and email), and the error reason. Enrolment errors are also added to error_list, with only an error_reason. You will only need to fix those records with errors, and run in a batch again, but you can run the whole list again.
A request without a people array, or with more than 100 people, returns 400 and nothing is saved.
Enrolment fields
Each user object can also enrol that user in up to 5 topics or pathways, using the enrolment_code_N fields where N is from 1..5. See How can I enrol people or import enrolments via a spreadsheet (CSV) for an explanation of enrolment codes.
Authorizations
Your organisation's API key, sent as Authorization: my_api_key. The key can also be passed as an api_key query parameter. See Authentication.
Body
An array of user objects whereby each user must include a user_name attribute denoting the unique id of the user to be created or updated.
100Show child attributes
Show child attributes
Whether to send invitation emails. "new" sends them only to newly created people, "all" sends them to everyone in the batch, and "no" (or leaving out this field) sends none.
new, all, no Response
Batch results
Number of users created
Number of users updated
Number of users unchanged
Number of enrolments made
Number of invitation emails sent
Number of invitation emails that failed
Number of errors. 0 if there are no errors
One entry per error. Enrolment errors have only an error_reason
Show child attributes
Show child attributes

