DUPLICATED_USER
error. This error indicates that the user exists in Auth0’s internal user store but not in your tenant. To correct this error, delete the user with the Auth0 Management API Delete a Connection User endpoint and then re-attempt the import.email
, phone
, or totp
.ndjson
to JSON. To keep the same user IDs, you must remove the auth0| prefix
from all imported user IDs.The import process automatically adds the auth0| prefix
to the imported user IDs. If you do not remove the auth0|
prefix before importing, the user IDs return as auth0|auth0|...
fs.readFileSync
, it requires fs.createReadStream
. The endpoint expects a piped read stream instead of the whole JSON file.
To learn more about the JSON file schema and see examples, read Bulk Import Database Schema and Examples.
POST
request to the Create Import Users Job endpoint. Be sure to replace the MGMT_API_ACCESS_TOKEN
, USERS_IMPORT_FILE.json
, CONNECTION_ID
, and EXTERNAL_ID
placeholder values with your Management API , users JSON file, database connection ID, and external ID, respectively.
Parameter | Description |
---|---|
users | File in JSON format that contains the users to import. |
connection_id | ID of the connection to which users will be inserted. You can retrieve the ID using the GET /api/v2/connections endpoint. |
upsert | Boolean value; false by default. When set to false , pre-existing users that match on email address, user ID, phone, or username will fail. When set to true, pre-existing users that match on email address will be updated, but only with upsertable attributes. For a list of user profile fields that can be upserted during import, see User Profile Structure: User profile attributes. Note: Providing a duplicated user entry in the import file will cause an error. In this case, Auth0 will not do an insert followed by an update. |
external_id | Optional user-defined string that can be used to correlate multiple jobs. Returned as part of the job status response. |
send_completion_email | Boolean value; true by default. When set to true , sends a completion email to all tenant owners when the import job is finished. If you do not want emails sent, you must explicitly set this parameter to false . |
send_completion_email
was set to true
, the tenant administrator(s) will get an email notifying them that job either failed or succeeded. An email for a job that failed might notify the administrator(s) that it failed to parse the users JSON file when importing users.
429 Too Many Requests
response:
GET
request to the Get a Job endpoint. Be sure to replace the MGMT_API_ACCESS_TOKEN
and JOB_ID
placeholder values with your Management API Access Token and user import job ID.
GET
request to the Get Job Error Details endpoint. Be sure to replace the MGMT_API_ACCESS_TOKEN
and JOB_ID
placeholder values with your Management API Access Token and user import job ID.
hash.value
will be redacted in the response.