Problem statement:
Bulk export user details in CSV format using the Auth0 Management API UI and from Postman.
Solution:
- Get the connection_id and domain of the tenant from the Auth0 dashboard
- Put them in the body script. Here is a short sample.
{
"connection_id": "connection_id",
"format": "csv",
"limit": 20,
"fields": [{
"name": "user_id"
},
{
"name": "email"
},
{
"name": "user_metadata.country"
} ]
}
- Open Auth0 Management API https://auth0.com/docs/api/management/v2 UI or Postman
- Get the bear token from Auth0 Dashboard and add them to the Auth0 Management API
- Create a Post request with the /api/v2/jobs/users-exports endpoint.
- Add the scripts in step 2 to the body and click on Try or Send.
- Get the job id from the response
- Create a Get request with the /api/v2/jobs/{id} endpoint and click on Try or Send
- In the response, the location parameter has the link to the export file.
- Click on the link to download the {tenant}.csv.gz file
- Unzip the file to get the export csv file.
Note:
- If user export is slow for some reason, try restarting the request. Most likely it will go through fine.
Recording: