# Auth0 get multiple user data from a single request

**URL:** <https://community.auth0.com/t/auth0-get-multiple-user-data-from-a-single-request/168706>\
**Category:** Get Help\
**Tags:** users-by-email, management-api\
**Created:** [January 15, 2025, 6:35am UTC](https://community.auth0.com/t/auth0-get-multiple-user-data-from-a-single-request/168706 "2025-01-15T06:35:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![swasthiksuvarna2001](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/swasthiksuvarna2001/32/70554_2.png) [@swasthiksuvarna2001](https://community.auth0.com/u/swasthiksuvarna2001)\
**Post date:** [January 15, 2025, 6:35am UTC](https://community.auth0.com/t/auth0-get-multiple-user-data-from-a-single-request/168706/1 "2025-01-15T06:35:26Z")

</div>

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:

```auto
await axios.request({
  method: 'GET',
  url: `https://${process.env.AUTH0_DOMAIN}/api/v2/users-by-email`,
  params: { email: user.email },
  headers: { authorization: `Bearer ${accessToken}` }
});

```

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.

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [January 15, 2025, 12:39pm UTC](https://community.auth0.com/t/auth0-get-multiple-user-data-from-a-single-request/168706/3 "2025-01-15T12:39:20Z")

</div>

Hi @swasthiksuvarna2001

Welcome to the Auth0 Community!

Thank you for posting your question, we have an endpoint to retrieve users in bulk → [Retrieve Users with the Get Users Endpoint](https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint) the only issue with that is the limitations. The [`GET /api/v2/users`endpoint](https://auth0.com/docs/api/management/v2#!/Users/get_users) 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](https://auth0.com/docs/api/management/v2/jobs/post-users-exports) or user import/export extension → [User Import / Export Extension](https://auth0.com/docs/customize/extensions/user-import-export-extension) and run custom webhook to update fields in your database.

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 29, 2025, 12:39pm UTC](https://community.auth0.com/t/auth0-get-multiple-user-data-from-a-single-request/168706/4 "2025-01-29T12:39:32Z")

</div>

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