Auth0 User Export Job returning empty file

I am trying to retrieve all of the users in our Auth0 system, we have over 1000 and so am required to use the export user job API.

I am creating a connection with:

url = "<BASE_URL>/api/v2/connections" 
body = {
        "name": "<connection-name>",
        "strategy": "auth0"
}

I am then using this connection to create a job to export users again using the API:

body = {
  "connection_id": "<connection_id>",
  "format": "json"
}

Finally I am getting the location of this job output using the API:

url = "<BASE_URL>/api/v2/jobs/<job_id>"

The response location works and I can retrieve a .gz file, however once opened the resulting file is empty.

All requests succeed and there are no errors shown. Can someone please help me explain why the result is empty? I am happy to give more information is required. Thanks.

Hey @marshalld,

Ideally the api “/api/v2/jobs/users-exports” , should provide you the exported copy of the users in your existing auth0 database. In your steps you mentioned you are creating a new connection but Just to clarify the “connection_id” field in the “/api/v2/jobs/users-exports” api body, should be the id of your existing auth0 database which contains 1000 plus users, instead of a new connection. You can get the list of your connection id’s from “/api/v2/connections” Api call.

1 Like

Thanks a lot for sharing that knowledge @sidharth.chaudhary!

1 Like

This was the issue thanks, it worked once I gave it the proper connection id.

2 Likes

Perfect glad to hear that!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.