Reorder Assignment Rule Entries

An Assignment Rule entry is an individual condition and assignment configuration within an Assignment Rule. Each entry defines the conditions for assigning records and the user, role, group, or other assignee to whom matching records are assigned.

Purpose

To reorder the rule entries of an existing Assignment Rule.

Use the Get Assignment Rules API to retrieve the Assignment Rule ID and the IDs of its entries. 

Endpoints

  • PUT /settings/automation/assignment_rules/{assignment_rule_ID}/actions/reorder_entries

Request Details

Request URL

{api-domain}/crm/{version}/settings/automation/assignment_rules/{assignment_rule_ID}/actions/reorder_entries

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

ZohoCRM.settings.assignment_rules.UPDATE

Parameter

  • modulestring, mandatory

    Specify the module API name associated with the Assignment Rule whose entries you want to reorder. Use Get Modules Metadata API to fetch module API names.

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v8/settings/automation/assignment_rules/2276164000003550025/actions/reorder_entries?module=Leads"
-X PUT
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d "@reorderRuleEntries.json"

Input JSON

  • assignment_rulesJSON array, mandatory

    Specify the details of a rule entry from an existing Assignment rule. Use the Get Assignment Rules API to retrieve the sequence number and rule entry IDs in the Assignment Rule.

    • rule_entriesJSON array, mandatory
      Specify the Assignment Rule entries to reorder.  You do not need to specify all the rule entries in the Assignment Rule. Include only the rule entries whose sequence you want to change.
      • sequence_numberinteger, mandatory

        Specify the order in which the Assignment Rule entry should be evaluated. The rule entries are checked from the lowest sequence number to the highest. A lower value means the rule entry is evaluated earlier. Sequence numbers start from 1 and can have non-consecutive values. For example, you can specify 1, 5, or 10.

        Note: Do not specify the same sequence number for more than one rule entry.

      • idstring, mandatory

        Specify the unique ID of the rule entry whose sequence number you want to change. 

Note

Specify a new sequence number for each Assignment Rule entry based on the order in which you want the entries to be evaluated.

Sample Input

Copied{
    "assignment_rules": [
        {
            "rule_entries": [
                {
                    "sequence_number": 1,
                    "id": "2276164000003799018"
                },
                {
                    "sequence_number": 2,
                    "id": "2276164000003798007"
                }
            ]
        }
    ]
}

Possible Errors

  • INVALID_DATAHTTP 400
    • The Assignment Rule ID is invalid
    • The Rule Entry ID is invalid
    • The specified sequence number is invalid
      Resolution:  Specify valid IDs. Use the Get Assignment Rules API to fetch the assignment rule ID, rule entry IDs, available in your organization. Also, ensure the sequence numbers provided for reordering are valid and within the allowed range.
  • INVALID_MODULEHTTP 400

    The module specified in the query parameter is invalid
    Resolution: Refer to the Get Modules Metadata API to identify the correct module API name.

  • REQUIRED_PARAM_MISSINGHTTP 400

    A required parameter is missing
    Resolution: Specify the module parameter and its corresponding value. Use the Get Assignment Rules API to know the supported module API names.

  • MANDATORY_NOT_FOUNDHTTP 400

    Mandatory field is missing
    Resolution: Specify all mandatory fields to proceed with reordering the Assignment rule entries. Refer to the Input JSON section to know the required fields.

  • FEATURE_NOT_SUPPORTEDHTTP 400

    Your CRM edition does not support this feature
    Resolution: Assignment Rule is supported in Standard and above editions. Upgrade your CRM edition to use this feature.

  • NO_PERMISSIONHTTP 400

    No permission to reorder the Assignment rule
    Resolution: You do not have permission to reorder the Assignment rule entries. Contact your administrator to enable the required permissions.

  • 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 Endpoint section.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    Unauthorized
    Resolution: The client does not have a valid scope to reorder the Assignment rule entries. Create a new token with valid scope. Refer to 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.

  • INTERNAL_ERRORHTTP 500

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

Sample Response

Copied{
    "assignment_rules": [
        {
            "code": "SUCCESS",
            "details": {
                "id": "2276164000003798005"
            },
            "message": "Assignment rule ENTRIES_REORDERED successfully",
            "status": "success"
        }
    ]
}