Important Notes

  • For now, setting a users permission requires the permission flag ADMINISTRATOR on the caller.
  • An organization owner can not have their permissions modified. Any permissions assigned to the owner are overridden.

What is the difference between Organization and Property Permissions?

  • Organization permissions govern tasks that affect other users, as well as potentially other properties and the organization itself.

  • Property permissions allow you to give Users isolated access to specific Properties instead of granting them Organizations permissions.

  • To ensure Organization permissions are not given instead of Property permissions. All Property permissions are prefixed with: P_, while all Organization permissions are not.

  • A complete list of all Permissions is available here.

Setting Permissions at the Organization Level

curl --location --request PATCH 'https://sux.chatsight.ai/api/users' \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "patches":[
        {
            "key":"@user/permissions",
            "target":"[email protected]",
            "value":{
                "scope":"ORG",
                "operation":"add",
                "permissions":["VIEW_USERS"]
            }
        }
    ]
}'
The above example shows a user being granted the ability to view all users in the organization.
KeyTypeValue
patchesArrayArray of Patch Objects.
patches[n].keyStringThe type of setting to update, in this case, user permissions.
patches[n].targetStringThe User ID or Email of the targeted User.
patches[n].valueObjectThe Permission Update Object
patches[n].value.scopeStringThe scope for this permission update.

When scope is ORG this will apply at the organization level. Any other value will be interpreted as a property_id.
patches[n].value.operationStringThe operation to perform. Possible values: add , delete.
patches[n].value.permissionsArrayThe permission flags to apply or remove. Only organization flags can be used.

Setting Permissions at the Property Level

curl --location --request PATCH 'https://sux.chatsight.ai/api/users' \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "patches":[
        {
            "key":"@user/permissions",
            "target":"[email protected]",
            "value":{
                "scope":"D#1234567003789492274",
                "operation":"add",
                "permissions":["P_VIEW_USERS"]
            }
        }
    ]
}'
The above example shows a user being granted the ability to view a specific property.
KeyTypeValue
patchesArrayArray of Patch Objects.
patches[n].keyStringThe type of setting to update, in this case, user permissions.
patches[n].targetStringThe User ID or Email of the targeted User.
patches[n].valueObjectThe Permission Update Object
patches[n].value.scopeStringThe scope for this permission update.

When scope is not ORG, it will be interpreted as a property_id.
patches[n].value.operationStringThe operation to perform. Possible values: add , delete.
patches[n].value.permissionsArrayThe permission flags to apply or remove. Only property flags can be used. Denoted by the prefix P_.