Skip to Content

Documentation

Risk Cloud API: Update Users and Permission Sets on Role

Updating users and permission sets on a role can be a common task in the Risk Cloud, and with Risk Cloud’s Roles API, you can achieve that as well.

Prerequisites

Update Role Endpoint Request

This endpoint has the following parameters:

Query ParameterRequiredDescription
roleYesThe role ID you want to update.

Case #1 Update Users on Role

This endpoint has the following request body properties when adding / removing users:

{
    "usersToAdd": [
        {
            "status": <string: user status ex Active>,
            "id": <string: user ID>
        }
    ],
    "usersToRemove": [
        {
            "status": <string: user status ex Active>,
            "id": <string: user ID>
        }
    ],
    "name": <string: user name>
}

Case #2 Update Permission Sets on Role

This endpoint has the following request body properties when adding / removing permission sets:

{
    "permissionSetsToAdd": [
        {
            "id": <string: permission set ID>   
        }
    ],
    "permissionSetsToRemove": [
        {
            "id": <string: permission set ID>   
        }
    ], 
    "name": <string: role name>   
}

Note

You can combine the request body properties above if you need to add/remove users and permission sets simultaneously.

Update Role Endpoint Response

This endpoint has the following response body properties (returns a Role obj):

{
    "id": <string: role id >,
    "active": <bool: role active status >,
    "created": <date: role created date time in epoch millis >,
    "updated": <date: role updated date time in epoch millis >,
    "name": <string: role name >,
    "locked": <bool: role locked status >,
    "superAdmin": <bool: role super admin status >,
    "defaultRoleForNewUsers": <bool: role default status >,
    "autoprovisioned": <bool: role autoprovisioned status >,
    "externalId": <String: role external ID>,
    "stepPermissionSets": [ <role list of step permission set: will be empty on response> ],
    "moduleEntitlements": [ <role list of module entitlement: will be present on response> ],
    "users": [ <role list of user: will be empty on response> ],
    "userCount": <int: role user count>,
    "moduleCount": <int: role module count>
}