Assigning Users to Roles and Getting a Role’s Users

Learn how to assign a role to a user and get all the users assigned to the role.

In this lesson, we'll see how we can assign users to a role and get a list of our role's users by using an API call. We'll use the https://{{DOMAIN}}/api/v2/roles/{id}/users endpoint to achieve these tasks. Assigning a role to a user is a POST request, while getting a role’s users is a GET request.

Get hands-on with 1200+ tech skills courses.