Appearance
Set User Primary Role
Designate one of a user's assigned roles as their primary role. The primary role is used as the default context for the user. Requires ADMIN or MANAGE_PEOPLE permissions and the PEOPLE_MANAGEMENT feature flag.
Parameters
| name * are required parameters | data type | description |
|---|---|---|
userId* | string | The unique identifier of the user |
body.roleId* | string | The role identifier to set as the primary role |
Return Value
json
{
"statusCode": 201,
"data": true,
"message": "Successfully set primary role for the user"
}Error Codes
400 Bad Request: Returned when the specified role is not assigned to the user.401 Unauthorized: Returned when permissions are insufficient.
Examples
bash
curl -X POST "https://app.wombat.software/api/{targetPath}/user/:userId/set-primary-role" \
-H "Content-Type: application/json" \
-H "Authentication: Bearer ..." \
-d '{"roleId": "role-abc123"}'ENDPOINTS
post
/api/{targetPath}/user/:userId/set-primary-role