You can use the POST /api/v2/jobs/users-exports endpoint to create a job that exports all users associated with a connection, or all users in the tenant.For a list of user profile fields that can be exported, read User Profile Structure.When you create your job, you’ll need to provide:
If you export user data in CSV format and want to include metadata information, specify each metadata field that you want to export. You can export up to 30 fields.
You cannot export the entirety of app_metadata or user_metadata in CSV. You must specify fields of metadata objects explicitly.To export app_metadata or user_metadata as single objects, use the JSON-compatible format and include the desired field in the fields parameter of the request body. For example:{"name":"app_metadata"}As you can only export up to 30 fields, using the JSON format is recommended if the user data has many fields.
If you export the data in JSON-compatible format, you only need to provide the root property; you do not need to name each individual inner property since they will be included automatically.Auth0’s export files use the NDJSON format due to the large size of the export files, while the import functionality expects a JSON file.Before you can import users using an export generated by Auth0, you’ll need to convert the file from NDJSON to JSON using the library of your choice (such as jq).In this case, for the same example we used before, the request would look like this:
Once you’ve created your job to export your users, you can check on its status using the Get a Job endpoint.Provide the ID of the job (which you received in the response when creating the job). If you’re using the sample request below, replace the placeholder {yourJobId} with the value of the ID.Require Scopes: create:users, read:users, create:passwords_checking_job
You can access your export files using the URL provided as the value for the location parameter. The name of your tenant is also the name of your file. For example, if your tenant name is auth0docs, then your file will be auth0docs.csv or auth0docs.json. When you navigate to the URL, you will automatically begin downloading the file.The download link is valid for 60 seconds. If this time period expires, you have 24 hours to call it again before the job expires.
All of your job-related data is automatically deleted after 24 hours and cannot be accessed afterward. As such, we strongly recommend storing the job results using the storage mechanism of your choice.