# Api/v2/users?page help

**URL:** <https://community.auth0.com/t/api-v2-users-page-help/183868>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [March 13, 2025, 7:46pm UTC](https://community.auth0.com/t/api-v2-users-page-help/183868 "2025-03-13T19:46:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![imntest111](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/imntest111/32/73628_2.png) [@imntest111](https://community.auth0.com/u/imntest111)\
**Post date:** [March 13, 2025, 7:46pm UTC](https://community.auth0.com/t/api-v2-users-page-help/183868/1 "2025-03-13T19:46:27Z")

</div>

Ready to post? 🔍 First, try searching for your answer.  
Hi

I am unable to get the paging to work to get all by users, i bulk imported users using import/export extension , now i want to get those users and assign roles to them using v2/roles api , but the paging parameter does not work , only first 2 pages return users after that it keeps giving my empty json , I have some 120 users thats all , also is there a way to assign roles in bulk itself

Thanks

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [March 13, 2025, 8:32pm UTC](https://community.auth0.com/t/api-v2-users-page-help/183868/3 "2025-03-13T20:32:39Z")

</div>

Hi @imntest111

Welcome to the Auth0 Community!

The `page` parameter will return 50 users, it does not resemble the exact page within the Auth0 Dashboard. Since the parameter starts at **0** , by page 3 it will return empty JSON since there are no users on that page. This being said, if you query the page using:

- https://{{Auth0\_domain}}/api/v2/users?page=0
- https://{{Auth0\_domain}}/api/v2/users?page=1
- https://{{Auth0\_domain}}/api/v2/users?page=2

These queries should return all of your users since you mentioned that you have around 120.

To answer your second question, unfortunately, you cannot assign roles in a bulk, by using the Management API endpoint, you can assign them only one at a time.

If you have any other questions, feel free to leave a reply!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![imntest111](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/imntest111/32/73628_2.png) [@imntest111](https://community.auth0.com/u/imntest111)\
**Post date:** [March 13, 2025, 9:24pm UTC](https://community.auth0.com/t/api-v2-users-page-help/183868/4 "2025-03-13T21:24:44Z")

</div>

Ok thanks , also i was using the import / export extension to import users , but i also see management/v2/jobs/post-users-imports where u can upload a json , but for me the test endpoint button is disabled and i cannot change the domain also in the curl , how do i use that interface , thanks

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [March 13, 2025, 10:48pm UTC](https://community.auth0.com/t/api-v2-users-page-help/183868/5 "2025-03-13T22:48:41Z")

</div>

I see.

Please double check if you have set the Management API key or if it is the correct one. Otherwise, you can attempt to log out and back in since it might be a display bug.

Otherwise, you can attempt to use the cURL request from this [documentation](https://auth0.com/docs/manage-users/user-migration/bulk-user-imports):

```auto
curl --request POST \
  --url 'https://{{AUTH0_Domain}}/api/v2/jobs/users-imports' \
  --header 'authorization: Bearer MGMT_API_ACCESS_TOKEN' \
  --form users=@USERS_IMPORT_FILE.json \
  --form connection_id=CONNECTION_ID \
  --form external_id=EXTERNAL_ID

```

Let me know if that helps!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![imntest111](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/imntest111/32/73628_2.png) [@imntest111](https://community.auth0.com/u/imntest111)\
**Post date:** [March 14, 2025, 5:15pm UTC](https://community.auth0.com/t/api-v2-users-page-help/183868/6 "2025-03-14T17:15:38Z")

</div>

thanks that worked , is there a recommend way to migrate aws cognito users to auth0 , i want to map the aws groups also to the auth0 roles , i see that Automatic migrations or lazy migration is also an option

thanks

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [March 14, 2025, 7:33pm UTC](https://community.auth0.com/t/api-v2-users-page-help/183868/7 "2025-03-14T19:33:23Z")

</div>

Hi again @imntest111

In order to be able to do Automatic Migration on your Auth0 Tenant, you will need to be under a Professional subscription which allows you to create a Database with a connection to your own custom one. For the recommended approach, any option is suitable, it just depends to your own use case and necessities regarding the matter.

Otherwise, regarding importing their roles, if the user’s roles are mapped inside their profile, you will need to write additional code when using a custom database or create a Post Login Action which will assign the roles inside the user mapping to actual roles created within the Dashboard. You can review our documentation regarding [assigning a role to a user](https://auth0.com/docs/api/management/v2/users/post-user-roles) using the Management API.

Let me know if you need anything else!

Kind Regards,  
Nik

---

<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:** [March 28, 2025, 7:34pm UTC](https://community.auth0.com/t/api-v2-users-page-help/183868/8 "2025-03-28T19:34:08Z")

</div>

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