Assign a role to a user
POST
/roles/assign
Assigns a role to a user within an optional context. Requires the manage_users permission. Returns 409 if the assignment already exists in that context.
Authorizations
BearerAuth
Authentication is handled automatically via httpOnly session cookies after signing in at /cognito/signin or via Google SSO at /cognito/oauth/google. For Swagger UI testing, paste a JWT token from the /cognito/signin response.
Type
HTTP (bearer)
Request Body
application/json
JSON
{
"userId": "string",
"roleId": "string",
"contextType": "string",
"contextId": "string"
}
Responses
Role assigned
application/json
JSON
{
"success": true,
"message": "string"
}