# Create new user and add to Authorization Extension V2 groups with api?

**URL:** <https://community.auth0.com/t/create-new-user-and-add-to-authorization-extension-v2-groups-with-api/6854>\
**Category:** Get Help\
**Tags:** authorization-extens\
**Created:** [June 1, 2017, 7:43pm UTC](https://community.auth0.com/t/create-new-user-and-add-to-authorization-extension-v2-groups-with-api/6854 "2017-06-01T19:43:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaron.jj.sims](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@aaron.jj.sims](https://community.auth0.com/u/aaron.jj.sims)\
**Post date:** [June 1, 2017, 7:43pm UTC](https://community.auth0.com/t/create-new-user-and-add-to-authorization-extension-v2-groups-with-api/6854/1 "2017-06-01T19:43:58Z")

</div>

Hi, I am new to Auth0, I’m a Stormpath user looking to migrate to Auth0

I am starting to create a user creation/update details scripts using nodejs using the “node-auth0” library.  
It’s a standalone CSV to new users script and working quite well so far.

For my web app I need to have different groups/roles and I have added “Authorization Extension v2”.

What’s the best way to script assigning users to groups/roles and maybe changing these memberships?

Cheers  
Aaron

---

<div class="post-metadata">

**Author:** ![aaron.jj.sims](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@aaron.jj.sims](https://community.auth0.com/u/aaron.jj.sims)\
**Post date:** [June 2, 2017, 2:14pm UTC](https://community.auth0.com/t/create-new-user-and-add-to-authorization-extension-v2-groups-with-api/6854/2 "2017-06-02T14:14:25Z")

</div>

OK i think I have worked out how to do it.

\*\*doesn’t seem to be too much validation, i was able to break groups by adding invalid users.

For nodejs:

```
var request = require("request");
var options = {
    method: '{GET|POST|DELETE|PATCH}',
    url: 'https://{authorization extension url }/api/{api call}',
    headers: {
        authorization: 'Bearer {api_key}'
    },
    body: {json_data}, //optional 
    json: true //optional 
};

request(options, function(error, response, body) {
    if (error) throw new Error(error);
    console.log(response);
    console.log(body);
});

```

---

<div class="post-metadata">

**Author:** ![gerald.bauer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.bauer/32/8610_2.png) [@gerald.bauer](https://community.auth0.com/u/gerald.bauer)\
**Post date:** [June 9, 2017, 6:57pm UTC](https://community.auth0.com/t/create-new-user-and-add-to-authorization-extension-v2-groups-with-api/6854/3 "2017-06-09T18:57:43Z")

</div>

Does this exist within the either .NET SDKs?

---

<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 2, 2018, 5:54am UTC](https://community.auth0.com/t/create-new-user-and-add-to-authorization-extension-v2-groups-with-api/6854/4 "2018-03-02T05:54:17Z")

</div>


