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 namesPossible 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

AttributeData TypeMandatoryDescription
share Show propertiesJSON arrayYesThe JSON object represents the set of users with whom you want to share the record. Each object in the array represents a user.

Possible Errors

HTTP StatusError CodeMessageReason
401OAUTH_SCOPE_MISMATCHinvalid oauth scope to access this URLThe 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.
404INVALID_URL_PATTERNPlease check if the URL trying to access is a correct one.The URL given has syntactical errors.
403INVALID_DATAENTITY_ID_INVALIDThe record ID given in the URL is either invalid
(or)
does not belong to the module mentioned.
200INVALID_DATAPermission is invalidThe 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.
200INVALID_DATArecord 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.
403SHARE_LIMIT_EXCEEDEDCannot 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"
        }
    ]
}