Roles and groups
Roles describe what someone is allowed to do, such as admin or billing. Groups collect people together, such as support-team, and can have roles of their own.
You create roles and groups under Roles and Groups. Each has a name and a key, and the key can’t be changed later. You can give them to someone on their page in the portal, through the Admin API (PUT /users/{id}/access), or from a sign-in flow or a blocking hook.
A person’s effective roles are the roles they’ve been given directly, plus the roles of every group they belong to.
Roles in tokens
Section titled “Roles in tokens”Access tokens and ID tokens list the person’s effective roles in a roles claim:
{ "sub": "…", "roles": ["admin", "billing"] }Your API can check roles to decide what a request is allowed to do. Sign-in flows can also check roles, for example to require two-step verification for administrators.