Auth0 Home Blog Docs

How to assign roles to multiple users?



I have a csv file in which there are around 1000 users and I want to assign them roles through Authorization extention. So is there anyway to do it automatically via some sdk? Like for management api and authentication api we have a sdk but for Authorization extension I couldn’t find any sdk. I could only find this link
So is there anywau to achieve this functionality other than manually add roles for each user.


Hello @jah,

I’m fairly certain the only way to do this would be REST calls to the authz API endpoints, per the documentation you linked, specifically:


Hi @markd,
Yes, I have done the same. Called authz api endpoint “Add User to Roles” (/users/{user_id/roles). The only issue was role_id. I couldn’t find role_id so I assigned role to one user manually and inspect the http call for role_id and then created a small utility that did the rest.