# Grant scopes through an API call

**URL:** <https://community.auth0.com/t/grant-scopes-through-an-api-call/87560>\
**Category:** Get Help\
**Tags:** api, management-api, auth0\
**Created:** [July 25, 2022, 5:44am UTC](https://community.auth0.com/t/grant-scopes-through-an-api-call/87560 "2022-07-25T05:44:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuv-c](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yuv-c/32/38420_2.png) [@yuv-c](https://community.auth0.com/u/yuv-c)\
**Post date:** [July 25, 2022, 5:44am UTC](https://community.auth0.com/t/grant-scopes-through-an-api-call/87560/1 "2022-07-25T05:44:34Z")

</div>

Hello.

Is it possible to add a scope to a user through an API call?

I’m expecting something like  
`PUT \<some\_url\>/oauth/add\_scopes?user\_id=\<something\_very\_unique\>&scope\_to\_add=\<some\_custome\_scope\>

Instead of doing this manually through the UI.

Thank you.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [July 25, 2022, 10:14am UTC](https://community.auth0.com/t/grant-scopes-through-an-api-call/87560/2 "2022-07-25T10:14:09Z")

</div>

You can use the Auth0 Management API to perform most of the configuration that is possible through the Dashboard UI. In this case I believe what you are looking for is the ability to configure the permissions associated with a given user ( `POST	/api/v2/users/{id}/permissions` - [Auth0 Management API v2](https://auth0.com/docs/api/management/v2#!/Users/post_permissions)).

---

<div class="post-metadata">

**Author:** ![yuv-c](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yuv-c/32/38420_2.png) [@yuv-c](https://community.auth0.com/u/yuv-c)\
**Post date:** [July 25, 2022, 10:39am UTC](https://community.auth0.com/t/grant-scopes-through-an-api-call/87560/3 "2022-07-25T10:39:42Z")

</div>

@jmangelo Thank you, but I see an option to grant permissions, not scopes, which I thought [are different things](https://auth0.com/blog/permissions-privileges-and-scopes/)

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [July 25, 2022, 11:33am UTC](https://community.auth0.com/t/grant-scopes-through-an-api-call/87560/4 "2022-07-25T11:33:53Z")

</div>

A problem with software development is that it’s common to call the same thing by different names and sometimes the same name means different things. I don’t want to start that type of discussion although I would agree it can be a source of confusion.

Initially, I assumed you had create an API entity in Auth0 to represent an API on your service. Your API would then provide different capabilities and you could possibly restrict certain capabilities to a specific set of users.

In this case you would have likely defined with the API a set of scopes (or API permissions - [Add API Permissions](https://auth0.com/docs/get-started/apis/add-api-permissions)) that represent different capabilities.

Further to that you were then looking to assign some users the possibility to perform/invoke a specific set of capabilities. In others words, you would want certain users to be granted a set of scopes so that the API could be called. In this case, assigning permissions through the endpoint I mentioned would be relevant because if you then enable RBAC for the API entity in Auth0, the permissions assigned to the users will be intersected with the API defined permissions (scopes) and the matching ones will be issued within the `scope` claim of an access token ([Enable Role-Based Access Control for APIs](https://auth0.com/docs/get-started/apis/enable-role-based-access-control-for-apis)).

---

<div class="post-metadata">

**Author:** ![yuv-c](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yuv-c/32/38420_2.png) [@yuv-c](https://community.auth0.com/u/yuv-c)\
**Post date:** [July 26, 2022, 7:09am UTC](https://community.auth0.com/t/grant-scopes-through-an-api-call/87560/5 "2022-07-26T07:09:58Z")

</div>

@jmangelo Great and detailed answer. Thank you.

---

<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:** [July 26, 2022, 9:30am UTC](https://community.auth0.com/t/grant-scopes-through-an-api-call/87560/6 "2022-07-26T09:30:35Z")

</div>

Thanks for the help on this one @jmangelo !

---

<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:** [July 28, 2022, 1:08pm UTC](https://community.auth0.com/t/grant-scopes-through-an-api-call/87560/7 "2022-07-28T13:08:50Z")

</div>


