# Assigning a large number of users to a role using the management API

**URL:** <https://community.auth0.com/t/assigning-a-large-number-of-users-to-a-role-using-the-management-api/58377>\
**Category:** Get Help\
**Tags:** limits, management-api, roles\
**Created:** [February 23, 2021, 10:19pm UTC](https://community.auth0.com/t/assigning-a-large-number-of-users-to-a-role-using-the-management-api/58377 "2021-02-23T22:19:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tucker.yates](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tucker.yates/32/13243_2.png) [@tucker.yates](https://community.auth0.com/u/tucker.yates)\
**Post date:** [February 23, 2021, 10:19pm UTC](https://community.auth0.com/t/assigning-a-large-number-of-users-to-a-role-using-the-management-api/58377/1 "2021-02-23T22:19:25Z")

</div>

When calling the endpoint for Assigning Users to a Role ([Auth0 Management API v2](https://auth0.com/docs/api/management/v2/#!/Roles/post_role_users)), is there any limit to the number of users we can assign in a single API call? I am designing an API that may have to assign several hundred users to a roll at a given time and want to make sure that I don’t get unexpected errors if the user count gets too big.

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [February 24, 2021, 8:16pm UTC](https://community.auth0.com/t/assigning-a-large-number-of-users-to-a-role-using-the-management-api/58377/3 "2021-02-24T20:16:47Z")

</div>

Unfortunately, it looks like you can only assign a role to 100 users at a time (I just tried assigning 500 users):

```auto
"Payload validation error: 'Array is too long (500), maximum 100' on property users (user_id's of the users to assign the role to).",

```

---

<div class="post-metadata">

**Author:** ![tucker.yates](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tucker.yates/32/13243_2.png) [@tucker.yates](https://community.auth0.com/u/tucker.yates)\
**Post date:** [February 24, 2021, 8:33pm UTC](https://community.auth0.com/t/assigning-a-large-number-of-users-to-a-role-using-the-management-api/58377/4 "2021-02-24T20:33:36Z")

</div>

Thank you for the quick response! I imagine we will need to split this into chunks of 100 when we process it

---

<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 11, 2021, 8:34pm UTC](https://community.auth0.com/t/assigning-a-large-number-of-users-to-a-role-using-the-management-api/58377/5 "2021-03-11T20:34:10Z")

</div>

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