Zoho CRM Scoring Rules

Scoring Rules configuration APIs. Published by Zoho in its first-party OpenAPI 3.1.0 repository github.com/zoho/crm-oas; 10 operation(s).

OpenAPI Specification

zoho-crm-scoring-rules-openapi.json Raw ↑
{
  "openapi": "3.1.0",
  "info": {
    "title": "Scoring Rules",
    "description": "Scoring Rules configuration APIs",
    "version": "8"
  },
  "servers": [
    {
      "url": "https://zohoapis.{dc}/crm/{version}",
      "description": "API Server URL",
      "variables": {
        "dc": {
          "description": "API Server URL TLD",
          "default": "com",
          "enum": [
            "com",
            "eu",
            "in",
            "cn",
            "au",
            "ca",
            "jp"
          ]
        },
        "version": {
          "description": "API Version",
          "default": "v8"
        }
      }
    }
  ],
  "paths": {
    "/settings/automation/scoring_rules": {
      "get": {
        "summary": "GET /settings/automation/scoring_rules",
        "description": "Returns the list of scoring rules configured. If params are passed, rules matched the param value will be returned.",
        "operationId": "getScoringRules",
        "parameters": [
          {
            "$ref": "#/components/parameters/ParamQueryModule"
          },
          {
            "$ref": "#/components/parameters/ParamQueryLayoutId"
          },
          {
            "$ref": "#/components/parameters/ParamQueryPage"
          },
          {
            "$ref": "#/components/parameters/ParamQueryPerPage"
          },
          {
            "$ref": "#/components/parameters/ParamQueryName"
          },
          {
            "$ref": "#/components/parameters/ParamQueryInnerDetails"
          }
        ],
        "responses": {
          "200": {
            "description": "list of configured scoring rules",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListGETResponse"
                }
              }
            }
          },
          "204": {
            "description": "No scoring rules are configured"
          },
          "400": {
            "description": "invalid module api_name is passed in module param value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseCore3"
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "settings.scoring_rules.READ"
            ]
          }
        ]
      },
      "put": {
        "summary": "PUT /settings/automation/scoring_rules",
        "description": "Update multiple scoring rules",
        "operationId": "putScoringRules",
        "requestBody": {
          "description": "Request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestBodyPUT"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rules updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedSchema"
                }
              }
            }
          },
          "207": {
            "description": "Few rule object has errors, others are updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedSchema5"
                }
              }
            }
          },
          "400": {
            "description": "Auto-generated from ApiDefinition for INVALID_DATA",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "description": "Wrapped error response with scoring_rules",
                  "properties": {
                    "scoring_rules": {
                      "type": "array",
                      "description": "Array of error objects",
                      "items": {
                        "$ref": "#/components/schemas/GeneralErrorResponse"
                      },
                      "maxItems": 25
                    }
                  },
                  "required": [
                    "scoring_rules"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "settings.scoring_rules.UPDATE"
            ]
          }
        ]
      },
      "post": {
        "summary": "POST /settings/automation/scoring_rules",
        "description": "Configure scoring rules for a module and layout.",
        "operationId": "postScoringRules",
        "requestBody": {
          "description": "Request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScoringRuleRequestBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Scoring rule is created successfully, but one or more custom fields are not created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateScoringRuleSuccessResponse"
                }
              }
            }
          },
          "207": {
            "description": "One/few of the rule object has error, others are created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartialSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Auto-generated from ApiDefinition for INVALID_DATA",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "description": "Wrapped error response with scoring_rules",
                  "properties": {
                    "scoring_rules": {
                      "type": "array",
                      "description": "Array of error objects",
                      "items": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/GeneralErrorResponse"
                          }
                        ]
                      },
                      "maxItems": 250
                    }
                  },
                  "required": [
                    "scoring_rules"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "settings.scoring_rules.CREATE"
            ]
          }
        ]
      },
      "delete": {
        "summary": "DELETE /settings/automation/scoring_rules",
        "description": "To delete multiple scoring rules",
        "operationId": "deleteScoringRules",
        "parameters": [
          {
            "$ref": "#/components/parameters/ParamQueryIds"
          }
        ],
        "responses": {
          "200": {
            "description": "All rules are deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedSchema7"
                }
              }
            }
          },
          "207": {
            "description": "few ids are invalid and others rules are deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedSchema8"
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "settings.scoring_rules.DELETE"
            ]
          }
        ]
      }
    },
    "/settings/automation/scoring_rules/{ruleId}": {
      "get": {
        "summary": "GET /settings/automation/scoring_rules/{ruleId}",
        "description": "Returns the scoring rule details",
        "operationId": "getScoringRuleById",
        "parameters": [
          {
            "$ref": "#/components/parameters/ParamPathRuleid"
          }
        ],
        "responses": {
          "200": {
            "description": "Scoring rule details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponseGET"
                }
              }
            }
          },
          "204": {
            "description": "No rule is available for the given rule id"
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "settings.scoring_rules.READ"
            ]
          }
        ]
      },
      "put": {
        "summary": "PUT /settings/automation/scoring_rules/{ruleId}",
        "description": "To update a scoring rule name, description, field_rules, touch_point_rules or custom_fields.",
        "operationId": "putScoringRuleById",
        "parameters": [
          {
            "$ref": "#/components/parameters/ParamPathRuleid"
          }
        ],
        "requestBody": {
          "description": "Request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestBodyPUT"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rule successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedSchema12"
                }
              }
            }
          },
          "400": {
            "description": "Auto-generated from ApiDefinition for INVALID_DATA",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "description": "Wrapped error response with scoring_rules",
                  "properties": {
                    "scoring_rules": {
                      "type": "array",
                      "description": "Array of error objects",
                      "items": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/GeneralErrorResponse"
                          }
                        ]
                      },
                      "maxItems": 25
                    }
                  },
                  "required": [
                    "scoring_rules"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "settings.scoring_rules.UPDATE"
            ]
          }
        ]
      },
      "delete": {
        "summary": "DELETE /settings/automation/scoring_rules/{ruleId}",
        "description": "To delete a single scoring rule",
        "operationId": "deleteScoringRuleById",
        "parameters": [
          {
            "$ref": "#/components/parameters/ParamPathRuleid"
          }
        ],
        "responses": {
          "200": {
            "description": "successful deletion of a rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedSchema4"
                }
              }
            }
          },
          "400": {
            "description": "given scoring rule id is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseCore4"
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "settings.scoring_rules.DELETE"
            ]
          }
        ]
      }
    },
    "/settings/automation/scoring_rules/{ruleId}/actions/activate": {
      "put": {
        "summary": "PUT /settings/automation/scoring_rules/{ruleId}/actions/activate",
        "description": "To activate the scoring rule",
        "operationId": "putActivate",
        "parameters": [
          {
            "$ref": "#/components/parameters/ParamPathRuleid"
          }
        ],
        "requestBody": {
          "description": "Request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeneratedSchema13"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Scoring rule successfully activated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedSchema16"
                }
              }
            }
          },
          "400": {
            "description": "given scoring rule id is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseCore4"
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "settings.scoring_rules.UPDATE"
            ]
          }
        ]
      },
      "delete": {
        "summary": "DELETE /settings/automation/scoring_rules/{ruleId}/actions/activate",
        "description": "To deactivate a scoring rule",
        "operationId": "deleteActivate",
        "parameters": [
          {
            "$ref": "#/components/parameters/ParamPathRuleid"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful deactivation of a rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedSchema1"
                }
              }
            }
          },
          "400": {
            "description": "given scoring rule id is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseCore4"
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "settings.scoring_rules.DELETE"
            ]
          }
        ]
      }
    },
    "/settings/automation/scoring_rules/{ruleId}/actions/clone": {
      "post": {
        "summary": "POST /settings/automation/scoring_rules/{ruleId}/actions/clone",
        "description": "To clone the scoring rule",
        "operationId": "postClone",
        "parameters": [
          {
            "$ref": "#/components/parameters/ParamPathRuleid"
          }
        ],
        "requestBody": {
          "description": "Request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeneratedSchema6"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful cloning of a rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedSchema15"
                }
              }
            }
          },
          "400": {
            "description": "Active rules per layout is reached.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponseCore4"
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "description": "Wrapped error response with scoring_rules",
                      "properties": {
                        "scoring_rules": {
                          "type": "array",
                          "description": "Array of error objects",
                          "items": {
                            "oneOf": [
                              {
                                "$ref": "#/components/schemas/GlobalScoringRuleLimitExceededErrorResponse"
                              },
                              {
                                "$ref": "#/components/schemas/ActiveStateLimitErrorResponse"
                              }
                            ]
                          },
                          "maxItems": 25
                        }
                      },
                      "required": [
                        "scoring_rules"
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "settings.scoring_rules.CREATE"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "GlobalScoringRuleLimitExceededErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "description": "Error message indicating that the maximum number of scoring rules for a layout has been exceeded, which is capped at 10.",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code",
            "enum": [
              "LIMIT_EXCEEDED"
            ]
          },
          "details": {
            "type": "object",
            "additionalProperties": false,
            "description": "Error details with validation information",
            "properties": {
              "api_name": {
                "type": "string",
                "description": "Detail field: api_name",
                "maxLength": 255
              },
              "limit": {
                "type": "integer",
                "format": "int32",
                "description": "Detail field: limit"
              },
              "json_path": {
                "type": "string",
                "description": "Detail field: json_path",
                "maxLength": 1000
              }
            }
          },
          "message": {
            "type": "string",
            "description": "Error message",
            "enum": [
              "More than 10 scoring rules cannot be created for a layout"
            ]
          },
          "status": {
            "type": "string",
            "description": "Error status",
            "enum": [
              "error"
            ]
          }
        },
        "required": [
          "code",
          "details",
          "message",
          "status"
        ],
        "title": "Global Scoring Rule Limit Exceeded Error Response"
      },
      "CreateScoringRuleRequestBody": {
        "type": "object",
        "additionalProperties": false,
        "description": "Schema for creating scoring rules, containing an array of scoring rule definitions.",
        "properties": {
          "scoring_rules": {
            "type": "array",
            "description": "root element (Required)",
            "items": {
              "$ref": "#/components/schemas/ScoringRulePOST"
            },
            "maxItems": 20,
            "minItems": 1
          }
        },
        "required": [
          "scoring_rules"
        ],
        "title": "Create Scoring Rule Request Body"
      },
      "GeneratedSchema": {
        "type": "object",
        "additionalProperties": false,
        "description": "Rules updated successfully",
        "properties": {
          "scoring_rules": {
            "type": "array",
            "description": "Field: scoring_rules",
            "items": {
              "$ref": "#/components/schemas/ScoringRuleResponseDetails"
            },
            "maxItems": 20
          }
        },
        "title": "Generated Schema"
      },
      "GeneralErrorResponse": {
        "type": "object",
        "additionalProperties": true,
        "description": "For the error response other than the mentioned ones",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code",
            "maxLength": 255
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "description": "Error details with validation information",
            "properties": {
              "api_name": {
                "type": "string",
                "description": "Detail field: api_name",
                "maxLength": 255
              },
              "json_path": {
                "type": "string",
                "description": "Detail field: json_path",
                "maxLength": 1000
              }
            }
          },
          "message": {
            "type": "string",
            "description": "Error message",
            "maxLength": 1000
          },
          "status": {
            "type": "string",
            "description": "Error status",
            "enum": [
              "error"
            ]
          }
        },
        "title": "General Error Response"
      },
      "ModuleDetails": {
        "type": "object",
        "additionalProperties": false,
        "description": "Provides details of a module, including API name and module ID.",
        "properties": {
          "api_name": {
            "type": "string",
            "description": "Api name of the module",
            "maxLength": 255
          },
          "id": {
            "type": "string",
            "description": "Module id",
            "maxLength": 25
          }
        },
        "title": "Module Information"
      },
      "TouchPointScoreConfiguration": {
        "type": "object",
        "additionalProperties": false,
        "description": "Configuration for applying scores based on touch points for Leads and Contacts modules.",
        "properties": {
          "group": {
            "type": "object",
            "additionalProperties": false,
            "description": "Channel (Related record) object",
            "properties": {
              "name": {
                "type": "string",
                "description": "channel name for which the touch point score are configured",
                "maxLength": 100
              },
              "display_value": {
                "type": "string",
                "description": "channel display label",
                "maxLength": 100
              }
            }
          },
          "rules": {
            "type": "array",
            "description": "score configurations in the mentioned channel",
            "items": {
              "type": "object",
              "description": "single touch point socre configuration",
              "additionalProperties": false,
              "properties": {
                "score": {
                  "type": "integer",
                  "format": "int32",
                  "description": "Points that should be added for the touch point (Required in POST)"
                },
                "id": {
                  "type": "string",
                  "description": "Touch point rule primary key",
                  "maxLength": 25
                },
                "_delete": {
                  "type": "null",
                  "description": "used to delete the TP rule"
                },
                "factors": {
                  "type": "array",
                  "description": "Touch point factor",
                  "items": {
                    "type": "object",
                    "description": "factor array",
                    "additionalProperties": false,
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Touch point factor name",
                        "maxLength": 100
                      },
                      "comparator": {
                        "type": "string",
                        "description": "Field: comparator - for field like factors",
                        "maxLength": 50
                      },
                      "values": {
                        "type": "array",
                        "description": "condition value",
                        "items": {
                          "type": [
                            "string",
                            "integer",
                            "number",
                            "boolean"
                          ]
                        },
                        "maxItems": 2
                      },
                      "unit": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "format": "int32",
                        "description": "unit if days supported factors are configured"
                      },
                      "period": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "period for unit. (days alone is supported as of now)",
                        "enum": [
                          "days",
                          null
                        ]
                      }
                    }
                  },
                  "maxItems": 1
                }
              }
            },
            "maxItems": 20
          }
        },
        "title": "Touch Point Score Configuration"
      },
      "UnsavedCustomFieldDetails": {
        "type": "object",
        "additionalProperties": false,
        "description": "Contains detailed information about custom fields that could not be saved during an operation.",
        "properties": {
          "field_label": {
            "type": "string",
            "description": "Field: field_label",
            "maxLength": 50
          }
        },
        "title": "Unsaved Custom Field Details"
      },
      "ActiveStateLimitErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "description": "Error indicating that the maximum number of active scoring rules per layout has been exceeded.",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code",
            "enum": [
              "ACTIVE_STATE_LIMIT_EXCEEDED"
            ]
          },
          "details": {
            "type": "object",
            "additionalProperties": false,
            "description": "Error details with validation information",
            "properties": {
              "api_name": {
                "type": "string",
                "description": "Detail field: api_name",
                "maxLength": 255
              },
              "limit": {
                "type": "integer",
                "format": "int32",
                "description": "Detail field: limit"
              },
              "json_path": {
                "type": "string",
                "description": "Detail field: json_path",
                "maxLength": 1000
              }
            }
          },
          "message": {
            "type": "string",
            "description": "Error message",
            "enum": [
              "More than 5 active scoring rules cannot be created for a layout"
            ]
          },
          "status": {
            "type": "string",
            "description": "Error status",
            "enum": [
              "error"
            ]
          }
        },
        "required": [
          "code",
          "details",
          "message",
          "status"
        ],
        "title": "Active State Limit Exceeded Error Response"
      },
      "SuccessResponseDetails": {
        "type": "object",
        "additionalProperties": true,
        "description": "Details of an operation, including the identifier of affected fields.",
        "properties": {
          "unsaved_custom_fields": {
            "type": "array",
            "description": "Field: unsaved_custom_fields",
            "items": {
              "$ref": "#/components/schemas/UnsavedCustomFieldDetails"
            },
            "maxItems": 6
          },
          "id": {
            "type": "string",
            "description": "Field: id",
            "maxLength": 25
          }
        },
        "title": "Success response Details"
      },
      "LayoutDetails": {
        "type": [
          "object",
          "null"
        ],
        "additionalProperties": false,
        "description": "Information about layout configuration, including display label, API name, and ID.",
        "properties": {
          "display_label": {
            "type": "string",
            "description": "layout display name",
            "maxLength": 255
          },
          "api_name": {
            "type": "string",
            "description": "Layout api name",
            "maxLength": 255
          },
          "id": {
            "type": "string",
            "description": "Layout id",
            "maxLength": 25
          }
        },
        "title": "Layout Information"
      },
      "GeneratedSchema15": {
        "type": "object",
        "additionalProperties": false,
        "description": "successful cloning of a rule",
        "properties": {
          "scoring_rules": {
            "type": "array",
            "description": "Field: scoring_rules",
            "items": {
              "$ref": "#/components/schemas/ScoringRuleResponseDetails"
            },
            "maxItems": 1
          }
        },
        "title": "Generated Schema"
      },
      "GeneratedSchema16": {
        "type": "object",
        "additionalProperties": false,
        "description": "Scoring rule successfully activated",
        "properties": {
          "scoring_rules": {
            "type": "array",
            "description": "Field: scoring_rules",
            "items": {
              "$ref": "#/components/schemas/ScoringRuleResponseDetails"
            },
            "maxItems": 1
          }
        },
        "title": "Generated Schema"
      },
      "RequestBodyPUT": {
        "type": "object",
        "additionalProperties": false,
        "description": "Request body schema",
        "properties": {
          "scoring_rules": {
            "type": "array",
            "description": "root element (Required)",
            "items": {
              "$ref": "#/components/schemas/ScoringRulePUT"
            },
            "maxItems": 10
          }
        },
        "required": [
          "scoring_rules"
        ],
        "title": "Generated Schema"
      },
      "GeneratedSchema12": {
        "type": "object",
        "additionalProperties": false,
        "description": "Rule successfully updated",
        "properties": {
          "scoring_rules": {
            "type": "array",
            "description": "Field: scoring_rules",
            "items": {
              "$ref": "#/components/schemas/ScoringRuleResponseDetails"
            },
            "maxItems": 1
          }
        },
        "title": "Generated Schema"
      },
      "FieldScoreConfiguration": {
        "type": "object",
        "additionalProperties": false,
        "description": "Defines the score configuration for module fields based on specific criteria.",
        "properties": {
          "score": {
            "type": "integer",
            "format": "int32",
            "description": "Points that should be added for the criteria (Required)"
          },
          "id": {
            "type": "string",
            "description": "Field: id",
            "maxLength": 255
          },
          "criteria": {
            "type": "object",
            "description": "Field based criteria",
            "properties": {},
            "additionalProperties": true,
            "title": "Criteria object"
          }
        },
        "title": "Field-Based Score Configuration"
      },
      "GeneratedSchema13": {
        "type": "object",
        "additionalProperties": false,
        "description": "Request body schema",
        "properties": {},
        "title": "Generated Schema"
      },
      "Gene

# --- truncated at 32 KB (64 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/zoho-crm/refs/heads/main/openapi/zoho-crm-scoring-rules-openapi.json