Bulk Users Import API
This API is used to update the existing user details and map roles to a new tenant in bulk. The user details stored in a CSV file can be uploaded to the new tenant in a single API request. If the file has new users then the users are created automatically and the welcome email is sent to them.
The records in the CSV are validated and uploaded to the S3 bucket. Schedulers read the CSV from the S3 and insert the records into the database, and then update the users in batches.
Up to 2000 records can be added at a time, and ensure the CSV file size does not exceed 5 MB.
Endpoint
URL: https://<<hostname>>/users/v1/import/uploadCsv
Method: POST
Header Parameter
Authorization - Bearer <token>
Note
To obtain an authorization token, click here.
Request Parameter
Parameter Name | Datatype | Description | Required/ Optional |
|---|---|---|---|
File | File | Browse and upload the .csv file, which contains the user information. | Required |
Note
To know how to download the template of the csv file from the Users page, click here.
Every record in the CSV is validated, and if validation fails, the file cannot be uploaded.
Sample Response
{
"importId": "9e9f9858-b89d-459a-88d4-881de762305f",
"statusCode": "200",
"message": "Importing users in progress."
}Response and Error Codes
Response Code | Condition | Message | Description |
|---|---|---|---|
200 | OK | Importing users in progress. | The user information has been validated and moved to the S3 bucket. The schedulers are updating the users in batches. |
400 | Bad Request | Empty file uploaded. File size is greater than configured threshold of 5 MB. | Check the file content. Ensure the file size does not exceed the configured limit. |
401 | Unauthorized | Unauthorized to import users | Ensure the correct token is input. |
417 | Expectation Failed | Failed to upload CSV to cloud storage. Please try again. | Retry after some time. |
500 | Internal Server Error | Error occurred while processing CSV file. | Retry after some time. |