I have a scenario where I need to fetch the last login data for all users in Auth0, based on email addresses stored in MongoDB. Currently, I am using the following approach:
However, with 10K users, I need to retrieve the last login data for each email address efficiently. What is the best optimized and scalable solution for this scenario, considering the need to handle a large number of users? Ideally, the solution should support pagination with a minimum limit of 500.
Thank you for posting your question, we have an endpoint to retrieve users in bulk → Retrieve Users with the Get Users Endpoint the only issue with that is the limitations. The GET /api/v2/usersendpoint allows 50 users per page and up to 1000 users per search criteria.
Depending on your use case for this issue, you could consider exporting users via job → Auth0 Management API v2 or user import/export extension → User Import / Export Extension and run custom webhook to update fields in your database.