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 giveUsers
isolated access to specificProperties
instead of granting themOrganizations
permissions. -
To ensure
Organization
permissions are not given instead ofProperty
permissions. AllProperty
permissions are prefixed with:P_
, while allOrganization
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.
Key | Type | Value |
---|---|---|
patches | Array | Array of Patch Objects. |
patches[n].key | String | The type of setting to update, in this case, user permissions. |
patches[n].target | String | The User ID or Email of the targeted User. |
patches[n].value | Object | The Permission Update Object |
patches[n].value.scope | String | The 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.operation | String | The operation to perform. Possible values: add , delete . |
patches[n].value.permissions | Array | The 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.
Key | Type | Value |
---|---|---|
patches | Array | Array of Patch Objects. |
patches[n].key | String | The type of setting to update, in this case, user permissions. |
patches[n].target | String | The User ID or Email of the targeted User. |
patches[n].value | Object | The Permission Update Object |
patches[n].value.scope | String | The scope for this permission update. When scope is not ORG , it will be interpreted as a property_id . |
patches[n].value.operation | String | The operation to perform. Possible values: add , delete . |
patches[n].value.permissions | Array | The permission flags to apply or remove. Only property flags can be used. Denoted by the prefix P_ . |