How to do a Bulk User Import

Overview

This article describes how to do a Bulk User Import using the Management API and the User Import / Export extension.

Solution

Prerequisites

  • Create a database connection and make sure the “Import users to Auth0” is turned ON. The connection must be enabled for one of your applications.
  • Create a JSON file that contains an array of objects, each representing a user. Check the Database Schema. NOTE: Check that every user property is written correctly, using lowercase, uppercase, underscores, etc. Writing the properties badly will lead to errors in the import, saying the JSON file is invalid, as in the following screenshot.

image

  • If password hashes are imported, make sure the algorithm is supported. Users with passwords hashed by unsupported algorithms will need to reset their password when they log in for the first time after the bulk import. Password hashes must be requested through the Support Center.
  • If importing with the Management API, Get a Management API token for job endpoint requests.

The Auth0 import job allows the import of the user ID. In this step, it is important to point out that every user ID in the tenant must be unique .

Imagine the following scenario: Users are being imported with user_id included, but another database in the tenant already has the same user_id for one of the users. This is a known scenario where the user needs to be updated, but since the Update a User endpoint only asks for the user_id, the update will apply to the first user the call finds, and it may not be the intended user for the update.