Update User Roles

Replace a user’s roles.

This endpoint allows administrators to replace the roles assigned to a user.

The roles can be scoped to a specific context (e.g., dataset or system). If a context is provided, the roles will only be replaced within that context. If no context is provided, all roles (system-level and dataset-level) will be replaced.

To replace roles at the system level, use the “system” context. To replace roles at the dataset level, use the “dataset:{dataset_id}” context.

Path parameters

user_idstringRequiredformat: "^auth0\|[A-Za-z0-9]+$"
The ID of the user to update

Headers

AuthorizationstringRequired

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
roleslist of objectsRequired
New list of roles to assign to the user
roles_contextstringOptional

Context for the roles to update. This can either be ‘system’ for system-level roles or ‘dataset:{dataset_id}’ for dataset-level roles.

Response

The updated user profile with new roles
user_idstring
Unique identifier for the user
namestring
Display name of the user
created_atstringformat: "date-time"
Timestamp when the user was created
roleslist of objects
List of roles assigned to the user
emailstring or null
Email address of the user
picturestring or null
URL to the user's profile picture
last_loginstring or nullformat: "date-time"
Timestamp of the user's last login

Errors