Reorder Workflow Rules

Purpose

To update the execution order of Workflow rules in a specific module in Zoho CRM.

By default, workflow rules are executed in the order in which they are created. To view the current execution order, use the Get all Workflow Rules API. The rules are listed in the order in which they will be executed.

Endpoints

  • PUT /settings/automation/workflow_rules/actions/reorder?module={module_API_name}

Request Details

Request URL

{api-domain}/crm/{version}/settings/automation/workflow_rules/actions/reorder?module={module_API_name}

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

ZohoCRM.settings.workflow_rules.ALL
(or)
ZohoCRM.settings.workflow_rules.UPDATE

Parameters
  • modulestring, mandatory

    Specify the module's API name to update its workflow execution order.

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v8/settings/automation/workflow_rules/actions/reorder?module=Leads"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-X PUT

Input JSON

  • workflow_rulesJSON array, mandatory

    An array containing the list of Workflow rules whose execution order you want to update. Each object in this array specifies the Workflow rule ID and its new position in the execution order for the given module.

    • idstring, mandatory

      Specify the module's API name to update its workflow execution order.

    • module_specific_sequenceinteger, mandatory

      Specify the new execution order for this Workflow rule within the module. The index starts from 1.

Note:

  • If any of the specified Workflow rule IDs are invalid, the entire request fails. Partial updates are not supported.
  • If the module_specific_sequence you provide in the input exceeds the total number of Workflow rules configured for the module, the API returns an error.
  • If the specified Workflow rules are already in the given order, the API returns an empty reorder array in the response.
  • If only some Workflow rules require reordering, the API returns success responses only for those rules that were reordered.

Sample Input

Copied{
    "reorder": {
        "workflow_rules": [
            {
                "id": "4876876000011150005",
                "module_specific_sequence": 1

            },
            {
                "id": "4876876000011037080",
                "module_specific_sequence": 7
            }
        ]
    }
}

Possible Errors

  • INVALID_REQUEST_METHODHTTP 400

    The http request method type is not a valid one
    Resolution: This API supports only the PUT method. Retry the request using the PUT method.

  • REQUIRED_PARAM_MISSINGHTTP 400

    A required parameter is missing in the request. 
    Resolution: The details object in the response contains information about the missing parameter. Ensure all required and dependent parameters are included. Refer to the Parameters section for more details.

  • INVALID_DATAHTTP 400

    The request contains invalid data for one or more fields. This can occur if an invalid Workflow rule ID or an invalid execution order number is specified.
    Resolution: Check the details object in the response for the exact field that caused the error. Ensure that the Workflow rule ID is valid and that the execution order is a valid number within the allowed range. 

  • INVALID_MODULEHTTP 400

    You have specified an invalid value for the module parameter.
    Resolution: Specify a valid module API name.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    Unauthorized
    Resolution: Client does not have the required OAUTH SCOPE. Create a new token with valid scope. Refer to the Scope section for more details.

  • 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 request URL section for more details.

  • INTERNAL_ERRORHTTP 500

    Internal Server Error
    Resolution: Unexpected and unhandled exception in Server. Contact support team.

Sample Response

Copied{
    "reorder": [
        {
            "code": "SUCCESS",
            "details": {
                "id": "4876876000011037080"
            },
            "message": "rules reordered successfully",
            "status": "success"
        },
        {
            "code": "SUCCESS",
            "details": {
                "id": "4876876000011150005"
            },
            "message": "rules reordered successfully",
            "status": "success"
        }
    ]
}