# Adding role on first login using Actions

**URL:** <https://community.auth0.com/t/adding-role-on-first-login-using-actions/111699>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [July 20, 2023, 2:47pm UTC](https://community.auth0.com/t/adding-role-on-first-login-using-actions/111699 "2023-07-20T14:47:39Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [July 31, 2023, 9:50pm UTC](https://community.auth0.com/t/adding-role-on-first-login-using-actions/111699/5 "2023-07-31T21:50:12Z")

</div>

Hi @brett2,

Unfortunately, there isn’t a direct method to assign a user to a role in an Action script.

For this to work, we recommend using the Management API in your Action script. Please follow the steps in our [How can I use the Management API in Actions?](https://community.auth0.com/t/how-can-i-use-the-management-api-in-actions/64947) FAQ on how to add roles to a user on their first log in using Actions.

And yes, calling the Management API will consume your allotted Machine-to-Machine tokens.

I have attached some useful resources below for migrating from Rules to Actions:

- [Migrate from Rules to Actions](https://auth0.com/docs/customize/actions/migrate/migrate-from-rules-to-actions)
- [Actions Limitations](https://auth0.com/docs/customize/actions/limitations)

Please let us know if you have any additional questions.

Thanks,  
Rueben

---

_[View the full topic](https://community.auth0.com/t/adding-role-on-first-login-using-actions/111699)._
