Rerun Data Sharing Rules
Purpose
To rerun all data sharing rules in a module.
Request Details
Request URL
{api-domain}/crm/{version}/settings/data_sharing/rules/actions/run
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
ZohoCRM.settings.data_sharing.UPDATE
(or)
ZohoCRM.settings.data_sharing.ALL
Parameter
- modulestring, mandatory
Specify the API name of the module for which you want to rerun all the rules. Use the GET - Modules Metadata API to retrieve all module API names, such as Leads and Contacts.
Note
When you rerun data sharing rules for a specific module, the system initiates a scheduler process to execute them. If you make the same API call before the scheduler process is complete, the system will return a "CANNOT_PROCESS" error. Use the Data Sharing Rules Summary API to check the status of the scheduled data sharing rules.
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/data_sharing/rules/actions/run?module=Leads"
-X POST
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
Possible Errors
- CANNOT_PROCESSHTTP 400
The scheduler is currently running
Resolution: The data sharing rule you are trying to rerun is currently in the scheduler process. The API will work for other rules only after the scheduler completes its execution. Please try again later or Try again later to rerun other rules. - INVALID_REQUEST_METHODHTTP 400
The http request method type is not a valid one
Resolution: You have specified an invalid HTTP method to access the API URL.
Specify a valid request method. Refer to the Endpoints section. - OAUTH_SCOPE_MISMATCHHTTP 401
Unauthorized
Resolution: The client does not have a valid scope to rerun the data sharing rules. Create a new token with valid scope. Refer to the Scope section. - AUTHENTICATION_FAILUREHTTP 401
Authentication failed
Resolution: Pass the access token in the request header of the API call. - INVALID_URL_PATTERNHTTP 404
Please check if the URL trying to access is a correct one
Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to the Request URL section for details.Refer to the Request URL section. - INTERNAL_ERRORHTTP 500
Internal Server Error
Resolution: Unexpected and unhandled exception in the server. Contact support team.
Sample Response
Copied{
"sharing_rules": [
{
"code": "SCHEDULED",
"details": {},
"message": "Rerun successfully scheduled",
"status": "success"
}
]
}