Management API
TypeScript
import { ManagementClient } from "auth0"; async function main() { const client = new ManagementClient({ token: "<token>", }); await client.roles.users.assign("id", { users: [ "users", ], }); } main();
Assign one or more users to an existing user role. To learn more, review Role-Based Access Control.
Note: New roles cannot be created through this action.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
ID of the role to assign users to.
user_id's of the users to assign the role to.
Role users successfully updated.