{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zoho-forms/json-schema/zoho-forms-report-records-search-request-schema.json",
  "title": "ReportRecordsSearchRequest",
  "description": "All keys are optional. An empty object returns the first 50 records, newest first.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zoho-forms-records-api-openapi.yml#/components/schemas/ReportRecordsSearchRequest",
  "type": "object",
  "properties": {
    "search": {
      "$ref": "#/$defs/ReportSearch"
    },
    "fields": {
      "type": "array",
      "maxItems": 100,
      "description": "Fields to return.",
      "items": {
        "type": "string"
      }
    },
    "sort_by": {
      "type": "array",
      "maxItems": 3,
      "description": "Fields to sort by.",
      "items": {
        "$ref": "#/$defs/ReportSortItem"
      }
    },
    "page": {
      "type": "integer",
      "minimum": 1,
      "default": 1,
      "maximum": 10000,
      "description": "Page to return."
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 50,
      "description": "Records per page."
    }
  },
  "$defs": {
    "ReportSearch": {
      "type": "object",
      "description": "Conditions that records must match.",
      "properties": {
        "conditions": {
          "type": "array",
          "maxItems": 5,
          "items": {
            "$ref": "#/$defs/ReportSearchCondition"
          },
          "description": "Conditions to match."
        },
        "pattern": {
          "type": "string",
          "maxLength": 500,
          "pattern": "^[0-9andorANDOR() ]+$",
          "description": "How the conditions are combined, for example <code>(1 and 2) or 3</code>. Required for 2 or more conditions."
        }
      }
    },
    "ReportSearchCondition": {
      "type": "object",
      "description": "A condition on one field.",
      "required": [
        "api_name",
        "operator"
      ],
      "properties": {
        "api_name": {
          "type": "string",
          "description": "API name of the field to search."
        },
        "input_api_name": {
          "type": "string",
          "description": "API name of the sub-field to search. Required for Name and Address fields."
        },
        "operator": {
          "type": "string",
          "enum": [
            "equals",
            "not_equals",
            "contains",
            "not_contains",
            "starts_with",
            "ends_with",
            "is_empty",
            "is_not_empty",
            "less_than",
            "greater_than",
            "less_equal",
            "greater_equal"
          ],
          "description": "How the field is compared with value. The operators depend on the field type; see Operators by field type below."
        },
        "value": {
          "type": "string",
          "maxLength": 1000,
          "description": "Value to compare."
        }
      }
    },
    "ReportSortItem": {
      "type": "object",
      "required": [
        "api_name",
        "sort_order"
      ],
      "properties": {
        "api_name": {
          "type": "string",
          "description": "API name of the field to sort by."
        },
        "sort_order": {
          "type": "string",
          "enum": [
            "asc",
            "desc"
          ],
          "description": "Sort order."
        }
      }
    }
  }
}