# Auth(0) Authorization Extension bulk add users to groups

**URL:** <https://community.auth0.com/t/auth-0-authorization-extension-bulk-add-users-to-groups/17678>\
**Category:** Get Help\
**Tags:** authorization-extens, auth0\
**Created:** [November 7, 2018, 5:01pm UTC](https://community.auth0.com/t/auth-0-authorization-extension-bulk-add-users-to-groups/17678 "2018-11-07T17:01:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![evanna.mcmahon](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evanna.mcmahon/32/9586_2.png) [@evanna.mcmahon](https://community.auth0.com/u/evanna.mcmahon)\
**Post date:** [November 7, 2018, 5:01pm UTC](https://community.auth0.com/t/auth-0-authorization-extension-bulk-add-users-to-groups/17678/1 "2018-11-07T17:01:30Z")

</div>

Hi,  
I have setup groups and roles in authorization-extension but I have over 1000 users that I need to assign to the groups/roles. Is there any way I can bulk update the users to assign them to the groups ?

Thanks  
Evanna

---

<div class="post-metadata">

**Author:** ![thameera](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thameera/32/13430_2.png) [@thameera](https://community.auth0.com/u/thameera)\
**Post date:** [November 8, 2018, 9:41am UTC](https://community.auth0.com/t/auth-0-authorization-extension-bulk-add-users-to-groups/17678/3 "2018-11-08T09:41:17Z")

</div>

If you have enabled the extension’s [API](https://auth0.com/docs/extensions/authorization-extension/v2/api-access), you can use the add group members endpoint to add users to a group: [Authorization Extension API Explorer](https://auth0.com/docs/api/authorization-extension#add-group-members)

In the request body, you can pass an array of user IDs, so they will be bulk added.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [November 8, 2018, 9:53am UTC](https://community.auth0.com/t/auth-0-authorization-extension-bulk-add-users-to-groups/17678/4 "2018-11-08T09:53:41Z")

</div>

Hey @evanna.mcmahon!

As @thameera mentioned, the easiest way to achieve that would be by using our Authorization Extensions API.

Hope it helps!

---

<div class="post-metadata">

**Author:** ![evanna.mcmahon](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evanna.mcmahon/32/9586_2.png) [@evanna.mcmahon](https://community.auth0.com/u/evanna.mcmahon)\
**Post date:** [November 8, 2018, 11:00am UTC](https://community.auth0.com/t/auth-0-authorization-extension-bulk-add-users-to-groups/17678/5 "2018-11-08T11:00:22Z")

</div>

Thanks I’ll try that

---

<div class="post-metadata">

**Author:** ![evanna.mcmahon](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evanna.mcmahon/32/9586_2.png) [@evanna.mcmahon](https://community.auth0.com/u/evanna.mcmahon)\
**Post date:** [November 8, 2018, 12:06pm UTC](https://community.auth0.com/t/auth-0-authorization-extension-bulk-add-users-to-groups/17678/6 "2018-11-08T12:06:54Z")

</div>

Thanks Thameera,

Sorry I am new to auth(0). I have the extensions API enabled but I don’t know how to access the API Extension. Do I use the API Extension URL ? This is just displaying a blank page. Where do I update the request body ? and how do I pass an array of user ids ?

Thanks  
Evanna

---

<div class="post-metadata">

**Author:** ![thameera](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thameera/32/13430_2.png) [@thameera](https://community.auth0.com/u/thameera)\
**Post date:** [November 8, 2018, 1:07pm UTC](https://community.auth0.com/t/auth-0-authorization-extension-bulk-add-users-to-groups/17678/7 "2018-11-08T13:07:08Z")

</div>

You can call the API via a tool like [Postman](https://www.getpostman.com/) or a command line utility like cURL. A cURL request might be similar to this:

```auto
curl -X PATCH \
 https://TENANT.us.webtask.io/adf6e2f2b84784b57522e3b19dfc9201/api/groups/GROUP_ID/members \
  -H 'Authorization: Bearer API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '["auth0|5a86c5d2a350a48bf2024576", "auth0|57a96fe8e618d33da2f90891"]'

```

The API\_TOKEN can be generated from the Auth0 dashboard. I highly recommend going through this document first: [https://auth0.com/docs/extensions/authorization-extension/v2/api-access](https://auth0.com/docs/extensions/authorization-extension/v2/api-access)

To break this down:

- It will be a PATCH request
- The API endpoint will be of the format in the example above. The exact API URL prefix can be found in the API section in the extension.
- An API token needs to be passed, and this can be generated by going to Auth0 dashboard → auth0-authorization-extension-api → Test tab
- In the body of the request, send an array of user IDs you want to add to the group.

Does that help?

---

<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:** [December 8, 2018, 1:11pm UTC](https://community.auth0.com/t/auth-0-authorization-extension-bulk-add-users-to-groups/17678/8 "2018-12-08T13:11:40Z")

</div>

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