Create or update users in an Anaplan tenant by uploading a CSV file. Users are matched by username (email address).
Each line should contain the full definition of the user, along with one or more licenses for the user. Licenses should be passed inside double quotes and be separated by commas.
Method and endpoint
/admin/1/0/users/import
Parameters
| Header | Required | Description |
Authorization: AnaplanAuthToken {anaplan_auth_token} | Yes | The Anaplan authentication token. |
Content-Type: multipart/form-data | Yes | The format of the request. Only multipart/form-data is supported |
Curl example
CURL -X PUT 'https://api.anaplan.com/admin/1/0/users/import' \
-H 'Authorization: AnaplanAuthToken {anaplan_auth_token}' \
-H "Content-Type: multipart/form-data" \
-F "file=@users_chunk1.csv"
Response
Success
If the request is successful, the API returns an HTTP 207 multi-status code.
| Success code | Response | Description |
207 | accepted | Number of records found in the uploaded file. |
created | Number of records that resulted in users being created. | |
updated | Number of records that resulted in users being updated. | |
errors | An object with the list of errors, with reference to the line number and the reason for the error.
|
Failure
If the request is unsuccessful, the API returns an error code.
| Error code | Error message | Description |
400 | INVALID_PAYLOAD | Expected payload format is a binary representation of a CSV file. |
INVALID_PAYLOAD | Missing headers in CSV file. | |
INVALID_PAYLOAD | Missing headers in CSV file. Expected headers: username,first_name,last_name,licenses | |
INVALID_PAYLOAD | CSV must contain at least one data row. | |
INVALID_PAYLOAD | Invalid CSV Resource. Maximum number of rows allowed is 500. | |
INVALID_PAYLOAD | Invalid CSV resource. Error in row number. | |
INVALID_PAYLOAD | Invalid CSV resource. Empty cell in row number. | |
INVALID_PAYLOAD | Invalid CSV resource. Duplicate email address in row number. | |
401 | UNAUTHORIZED | Authorization token is missing or invalid. |
403 | FORBIDDEN | User is not allowed to perform this operation. |
Related content
Read about the export endpoint.