Skip to main content

Endpoint

This is a tenant-specific API that assigns an existing role to a user.

Request Body

string
required
The ID of the user to assign the role to.
string
required
The name of the role to assign. The role must already exist. Cannot be empty or whitespace only.

Request Example

Response

Success Response

string
Returns "OK" when the role is successfully assigned
boolean
  • true if the user already had this role
  • false if the role was newly assigned

Error Response

string
Returns "UNKNOWN_ROLE_ERROR" when the specified role does not exist

Implementation Details

Source: View source
  • Role names are trimmed of leading/trailing whitespace before processing
  • The role must be created first using the Create Role endpoint
  • Role assignments are scoped to the tenant in which they are created
  • Assigning a role that a user already has is not an error - the API will return successfully with didUserAlreadyHaveRole: true

Error Responses

BadRequestException
Returned when the role field is empty or whitespace only

Role Management Overview

See all role management endpoints