Update Share Permissions
Purpose
Using this API, you can:
- Update the sharing permissions of a record granted to users as Read-Write, Read-only, or grant full access.
- Revoke access given to users to a shared record.
- Update the access permission to the related lists of the record that was shared with the user.
Request URL
https://www.zohoapis.com/crm/v2/{module_api_name}/{record_id}/actions/share
Request Method
PUT
Scope
scope=ZohoCRM.share.{module_name}.{operation_type}
Possible module names | Possible operation types |
---|---|
leads, accounts, contacts, deals, campaigns, cases, solutions, products, vendors, pricebooks, quotes, salesorders, purchaseorders, invoices, and custom. | ALL - Full access to the record UPDATE- Update the sharing permission |
Note
The system automatically revokes access to the record for the users who are not mentioned in the JSON request body. Therefore, give the ID of all the users with whom the record was shared, unless you want to revoke share permissions for them.
Request JSON
Attribute | Data Type | Mandatory | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
share Show properties | JSON array | Yes | The JSON object represents the set of users with whom you want to share the record. Each object in the array represents a user. | ||||||||||||||||
share Properties
|
Possible Errors
HTTP Status | Error Code | Message | Reason |
---|---|---|---|
401 | OAUTH_SCOPE_MISMATCH | invalid oauth scope to access this URL | The client does not have the scope to ZohoCRM.share.{module_name}.CREATE (or) The module name given in the URL is either Events, Calls, Tasks or any Linking module. (or) The module name given in the URL is invalid. |
404 | INVALID_URL_PATTERN | Please check if the URL trying to access is a correct one. | The URL given has syntactical errors. |
403 | INVALID_DATA | ENTITY_ID_INVALID | The record ID given in the URL is either invalid (or) does not belong to the module mentioned. |
200 | INVALID_DATA | Permission is invalid | The value given in permission must be: full_access, read_only, or read_write. (or) The user does not have permission to access that particular module. |
200 | INVALID_DATA | record is already visible to the user. | The record is already accessible to the user. You can share the record only if the user cannot access it. |
403 | SHARE_LIMIT_EXCEEDED | Cannot share a record to more than 10 users. | The record you are trying to share has already been shared with 10 users. |
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v2/Contacts/4150868000001148347/actions/share"
-X PUT
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d "@input.json"
Sample Input
Copied{
"share": [
{
"user": {
"id": "4150868000001199001"
},
"share_related_records": true,
"permission": "read_only"
},
{
"user": {
"id": "4150868000001174048"
},
"share_related_records": false,
"permission": "full_access"
}
]
}
Sample Response
Copied{
"share": [
{
"code": "SUCCESS",
"details": {},
"message": "record will be shared successfully",
"status": "success"
},
{
"code": "SUCCESS",
"details": {},
"message": "record will be shared successfully",
"status": "success"
}
]
}