You can assign roles to a user using the or the . The assigned roles can be used with the API Authorization Core feature set.

Prerequisites

  • For role-based access control (RBAC) to work properly, you must enable it for your API using either the Dashboard or the Management API. The Authorization Core functionality is different from the Authorization Extension. For a comparison, read Authorization Core vs. Authorization Extension.
  • Roles are selected from pre-defined values. If your list of roles is blank, make sure you create roles first.

Dashboard

There are two ways to assign a role to a user. You can choose a user from the Users list and then assign a role or you can go to the User Details (user profile) page for an individual user and choose a role to assign in the Roles tab. If you have more than 50 roles, only the first 50 are shown in the Roles tab. Other roles may be assigned via the Management API.

Assign roles in user list

  1. Go to Dashboard > User Management > Users.
  2. Click ... next to the user you want to modify, and select Assign Roles.
  3. Choose the role(s) you wish to assign, then click Assign.

Assign roles in user profile

You can also assign roles to users from their individual profile page.
  1. Go to Dashboard > User Management > Users and click the name of the user.
  2. Click the Roles view, and click Assign Role.
  3. Choose the role you wish to assign and click Assign.

Management API

Make a POST call to the Assign User Roles endpoint. Be sure to replace USER_ID, MGMT_API_ACCESS_TOKEN, and ROLE_ID placeholder values with your user ID, Management API , and role ID(s), respectively.
curl --request POST \
  --url 'https://{yourDomain}/api/v2/users/USER_ID/roles' \
  --header 'authorization: Bearer MGMT_API_ACCESS_TOKEN' \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/json' \
  --data '{ "roles": [ "ROLE_ID", "ROLE_ID" ] }'
ValueDescription
USER_IDΤhe ID of the user to be updated.
MGMT_API_ACCESS_TOKENAccess Token for the Management API with the scopes read:roles and update:users.
ROLE_IDID(s) of the role(s) you would like to add for the specified user.

Learn more