Update Share Permissions
Purpose
Update the share permissions of a record in Zoho CRM 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.
- Share the record privately or publicly. When you share a record publicly, all the users in the org will have access to the shared record.
Endpoints
- PUT /{module_API_name}/{record_ID}/actions/share
Request Details
Request URL
{api-domain}/crm/{version}/{module_api_name}/{record_id}/actions/share
Supported modules
Leads, Accounts, Contacts, Deals, Campaigns, Cases, Solutions, Products, Vendors, Price Books, Quotes, Sales Orders, Purchase Orders, Invoices, and Custom.
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
ZohoCRM.share.{module_name}.{operation_type}
Possible module names
leads, accounts, contacts, deals, campaigns, cases, solutions, products, vendors, pricebooks, quotes, salesorders, purchaseorders, invoices, and custom.
Possible operation types
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.
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v8/Contacts/4150868000001148347/actions/share"
-X PUT
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d "@input.json"
Copieduser1 = Map();
user1.put("user", {"id":"4150868000001174048"});
user1.put("share_related_records", true);
user1.put("permission", "full_access");
user1.put("type", "private");
user2 = Map();
user2.put("user", {"id":"4150868000001199001"});
user2.put("share_related_records", true);
user2.put("permission", "read_only");
user2.put("type", "private");
usersList = List();
usersList.add(user1);
usersList.add(user2);
params = Map();
params.put("share", usersList);
response = invokeurl
[
url :"https://www.zohoapis.com/crm/v8/Leads/692969000000981055/actions/share"
type :PUT
parameters: params.toString()
connection:"crm_oauth_connection"
];
info response;
In the request, "@input.json" contains the sample input data.
Request JSON
- shareJSON array, mandatory
Each JSON object represents the set of users, roles, or groups with whom you want to share the record.
share Properties
- shared_withJSON object, mandatory
- type string, mandatory
Represents whether you want to share the record with users, groups, or roles.
Possible values:users, groups, roles. - id string, mandatory
The ID of the user, group, or role you want to share the record with.
- type string, mandatory
- share_related_records Boolean, optional
Represents if you want to share the related records also with the user.
Possible values:
false - Do not share related records. This is the default value.
true - Share related records along with the record. - permissionstring, optional
Represents the access permission you want to give the user for that record.
Possible values:
full_access- Allow the user full access to the record. This is the default value.
read_only - Allow the user to only view the record.
read_write - Allow the user to view and edit the record. - typestring, optional
Represents if the record is shared publicly (to all the users in the org) or privately (to a specific user in the org).
Possible values:
public - share to all the users in the org.
private - share to the specific user.
Note that you cannot share a record publicly to a specific user. - notify Boolean, optional
Represents whether you want to notify the user to whom you have shared the records.
Possible values:
true - notifies the user.
false - Does not notify the user. - notify_shared_members Boolean, optional
Specifies whether to send notifications to all members with whom the record is shared.
Possible values:
false - Does not notify the user. This is the default value.
true - Notifies the user. - notify_on_completion Boolean, optional
Indicates if an email notification should be sent to the owner once the record share action is completed..
Possible values:
true - Notifies the owner. This is the default value.
false - Does not notify the owner.
Sample Input
Copied{
"share": [
{
"shared_with": {
"id": "4876876000001073045",
"type": "roles"
},
"share_related_records": true,
"permission": "full_access",
"type": "private"
}
],
"notify_shared_members": false,
"notify_on_completion": true
}
Possible Errors
- INVALID_DATAHTTP 400
- The record ID given in the URL is either invalid or does not belong to the module mentioned.
Resolution: Specify a valid record ID. - Permission is invalid.
Resolution: The value given in permission is not one of: full_access, read_only, or read_write. (or) The user does not have permission to access that particular module. Specify a valid value. - The module name given seems to be invalid.
Resolution: You have specified an invalid or unsupported module name or there is no tab permission, or the module could have been removed from the available modules. Specify a valid module API name. Refer to the list of Supported Modules for more details.
- The record ID given in the URL is either invalid or does not belong to the module mentioned.
- INVALID_REQUEST_METHODHTTP 400
The request method is incorrect.
Resolution: Use the HTTP PUT method to make this API call. Any other request method will result in this error. - AUTHORIZATION_FAILEDHTTP 400
User does not have sufficient privilege to update records.
Resolution: Contact your system administrator. - OAUTH_SCOPE_MISMATCHHTTP 401
invalid oauth scope to access this URL
Resolution: The client does not have the scope to ZohoCRM.share.{module_name}.UPDATE
(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. Generate a new access token with the required scopes for this API and try again. - SHARE_LIMIT_EXCEEDEDHTTP 403
Cannot share a record to more than 10 users.
Resolution: The record you are trying to share has already been shared with 10 users. - NO_PERMISSIONHTTP 403
Permission denied to update records
Resolution: Contact your system administrator. - INVALID_URL_PATTERNHTTP 404
The request URL is incorrect.
Resolution: Specify a valid request URL. Refer to the request URL section at the beginning of this page for more details. - INTERNAL_ERRORHTTP 500
Unexpected and unhandled exception in the server.
Resolution: Contact the support team at support@zohocrm.com.
Sample Response
Copied{
"share": [
{
"code": "SUCCESS",
"details": {},
"message": "record will be shared successfully",
"status": "success"
}
]
}