You can create roles using Auth0’s Dashboard or the . The 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.
  • Set up an API in the .
  • Permissions are selected from predefined values. If your list of permissions is blank, you need to add permissions to your API.

Dashboard

  1. Go to Dashboard > User Management > Roles and click Create Role.
  2. Name the role and add a description, then click Create.

Management API

Make a POST call to the Create Role endpoint. Be sure to replace MGMT_API_ACCESS_TOKEN, ROLE_NAME, and ROLE_DESC placeholder values with your Management API , role name, and role description, respectively.
curl --request POST \
  --url 'https://{yourDomain}/api/v2/roles' \
  --header 'authorization: Bearer MGMT_API_ACCESS_TOKEN' \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/json' \
  --data '{ "name": "ROLE_NAME", "description": "ROLE_DESC" }'
ValueDescription
MGMT_API_ACCESS_TOKENAccess Token for the Management API with the scope create:roles.
ROLE_NAMEName of the role you would like to create.
ROLE_DESCUser-friendly description of the role.

Learn more