{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coralogix/json-schema/coralogix-case-filters-schema.json",
  "title": "Case filters",
  "description": "Filters applied when querying cases, including statuses, priorities, categories, groupings, and labels.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coralogix-cases-service-api-openapi.yml#/components/schemas/CaseFilters",
  "type": "object",
  "properties": {
    "alertFilters": {
      "allOf": [
        {
          "$ref": "#/$defs/AlertFilters"
        }
      ],
      "description": "Alert-based filters applied to cases. When absent, alert ID aggregations are not computed."
    },
    "assignees": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/AssigneeOption"
      },
      "description": "List of case assignees to filter on"
    },
    "breached": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/KPIFilter"
      },
      "description": "KPI-based filters applied to cases. When absent, KPI filter is not applied at all."
    },
    "caseLabelsFilter": {
      "allOf": [
        {
          "$ref": "#/$defs/CaseLabelsFilter"
        }
      ],
      "description": "Filter based on entity labels associated with cases"
    },
    "categories": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/CaseCategory"
      },
      "description": "List of case categories to filter on"
    },
    "connectorTypeFilters": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/ConnectorTypeFilter"
      },
      "description": "Connector type filters applied to cases, including cases with no connector linked."
    },
    "dateRange": {
      "allOf": [
        {
          "$ref": "#/$defs/DateRangeFilter"
        }
      ],
      "description": "Date range filter applied to case active time"
    },
    "groupings": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/FilterGroup"
      },
      "description": "Grouping-based filters (e.g., service, subsystem)"
    },
    "impactedEntities": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/ImpactedEntityFilter"
      },
      "description": "Impacted APM entity filters. A case is returned if it impacts ANY of these entities (OR logic). An empty list applies no filtering."
    },
    "indicatorTypes": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/IndicatorType"
      },
      "description": "List of indicator types to filter on"
    },
    "labels": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/FilterGroup"
      },
      "description": "Label-based filters applied to cases"
    },
    "priorities": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/CasePriority"
      },
      "description": "List of case priorities to filter on"
    },
    "statuses": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/CaseStatus"
      },
      "description": "List of case statuses to filter on"
    },
    "textSearch": {
      "description": "Test search query applied to case titles",
      "maxLength": 4096,
      "minLength": 1,
      "pattern": "^[\\s\\S]*$",
      "type": "string",
      "x-coralogix-presence": true
    }
  },
  "$defs": {
    "AlertFilters": {
      "title": "Alert filters",
      "type": "object",
      "properties": {
        "alertIds": {
          "maxItems": 1000,
          "minItems": 0,
          "type": "array",
          "items": {
            "maxLength": 36,
            "minLength": 36,
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
            "type": "string",
            "description": "List of alert IDs to filter on. Cases containing any of these alert IDs will be returned (OR logic)."
          },
          "description": "List of alert IDs to filter on. Cases containing any of these alert IDs will be returned (OR logic)."
        },
        "alertVersions": {
          "maxItems": 1000,
          "minItems": 0,
          "type": "array",
          "items": {
            "maxLength": 64,
            "minLength": 1,
            "pattern": "^[\\s\\S]*$",
            "type": "string",
            "description": "List of alert version IDs to filter on. Cases containing indicators with any of these alert version IDs will be returned (OR logic)."
          },
          "description": "List of alert version IDs to filter on. Cases containing indicators with any of these alert version IDs will be returned (OR logic)."
        }
      },
      "description": "Filters applied to cases based on alert properties."
    },
    "ApmDatabaseEntityFilter": {
      "title": "APM database entity filter",
      "required": [
        "name"
      ],
      "type": "object",
      "properties": {
        "name": {
          "maxLength": 4096,
          "minLength": 1,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Name of the impacted database to filter on"
        }
      },
      "description": "Selects cases impacting the APM database with this name (matched case-insensitively)."
    },
    "ApmServiceEntityFilter": {
      "title": "APM service entity filter",
      "required": [
        "name"
      ],
      "type": "object",
      "properties": {
        "name": {
          "maxLength": 4096,
          "minLength": 1,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Name of the impacted APM service to filter on"
        }
      },
      "description": "Selects cases impacting the APM service with this name (matched case-insensitively)."
    },
    "AssigneeOption": {
      "title": "Assignee option",
      "type": "object",
      "oneOf": [
        {
          "required": [
            "assignee"
          ],
          "type": "object"
        },
        {
          "required": [
            "unassigned"
          ],
          "type": "object"
        },
        {
          "type": "object",
          "not": {
            "anyOf": [
              {
                "required": [
                  "assignee"
                ],
                "type": "object"
              },
              {
                "required": [
                  "unassigned"
                ],
                "type": "object"
              }
            ]
          }
        }
      ],
      "properties": {
        "assignee": {
          "maxLength": 256,
          "minLength": 1,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "User identifier of the assignee to filter by"
        },
        "unassigned": {
          "allOf": [
            {
              "$ref": "#/$defs/Unassigned"
            }
          ],
          "description": "Selects cases that have no assignee"
        }
      },
      "description": "Assignee filter option representing either a specific assignee or unassigned cases."
    },
    "CaseCategory": {
      "title": "Case category",
      "enum": [
        "CASE_CATEGORY_UNSPECIFIED",
        "CASE_CATEGORY_SECURITY",
        "CASE_CATEGORY_AVAILABILITY"
      ],
      "type": "string",
      "description": "Broad category of the case (e.g., security, availability)."
    },
    "CaseLabelsFilter": {
      "title": "Case Labels Filter",
      "type": "object",
      "properties": {
        "flatLabels": {
          "maxItems": 1000,
          "minItems": 0,
          "type": "array",
          "items": {
            "$ref": "#/$defs/v1.KeyValue"
          },
          "description": "List of case key:value labels to filter on"
        }
      },
      "description": "Filters applied against Case's labels when queries/filters counted"
    },
    "CasePriority": {
      "enum": [
        "CASE_PRIORITY_UNSPECIFIED",
        "CASE_PRIORITY_P1",
        "CASE_PRIORITY_P2",
        "CASE_PRIORITY_P3",
        "CASE_PRIORITY_P4",
        "CASE_PRIORITY_P5"
      ],
      "type": "string",
      "description": "Case priority."
    },
    "CaseStatus": {
      "enum": [
        "CASE_STATUS_UNSPECIFIED",
        "CASE_STATUS_PENDING_ACTIVATION",
        "CASE_STATUS_ACTIVE",
        "CASE_STATUS_ACKNOWLEDGED",
        "CASE_STATUS_RESOLVED",
        "CASE_STATUS_CLOSED"
      ],
      "type": "string",
      "description": "Case status."
    },
    "ConnectorTypeFilter": {
      "title": "Connector type filters",
      "type": "object",
      "oneOf": [
        {
          "required": [
            "connectorType"
          ],
          "type": "object"
        },
        {
          "required": [
            "noConnector"
          ],
          "type": "object"
        },
        {
          "type": "object",
          "not": {
            "anyOf": [
              {
                "required": [
                  "connectorType"
                ],
                "type": "object"
              },
              {
                "required": [
                  "noConnector"
                ],
                "type": "object"
              }
            ]
          }
        }
      ],
      "properties": {
        "connectorType": {
          "$ref": "#/$defs/v1.ConnectorType"
        },
        "noConnector": {
          "$ref": "#/$defs/NoConnector"
        }
      },
      "description": "Filters applied to cases based on connector types."
    },
    "DateRangeFilter": {
      "title": "Date Range Filter",
      "required": [
        "from",
        "to"
      ],
      "type": "object",
      "properties": {
        "from": {
          "description": "Timestamp marking the start of the date range",
          "format": "date-time",
          "maxLength": 30,
          "minLength": 20,
          "type": "string",
          "x-coralogix-presence": true
        },
        "mode": {
          "allOf": [
            {
              "$ref": "#/$defs/DateRangeMode"
            }
          ],
          "description": "Determines how the date range is applied. ACTIVE_WINDOW (default) returns cases active during the range. CREATED_AT returns cases created within the range."
        },
        "to": {
          "description": "Timestamp marking the end of the date range",
          "format": "date-time",
          "maxLength": 30,
          "minLength": 20,
          "type": "string",
          "x-coralogix-presence": true
        }
      },
      "description": "A filter defining a date range with 'from' and 'to' timestamps."
    },
    "DateRangeMode": {
      "title": "Date range mode",
      "enum": [
        "DATE_RANGE_MODE_UNSPECIFIED",
        "DATE_RANGE_MODE_ACTIVE_WINDOW",
        "DATE_RANGE_MODE_CREATED_AT"
      ],
      "type": "string",
      "description": "Determines how the date range is applied to cases (active window vs creation time)."
    },
    "FilterGroup": {
      "title": "Filter group",
      "required": [
        "key",
        "values"
      ],
      "type": "object",
      "properties": {
        "key": {
          "maxLength": 4096,
          "minLength": 1,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Key of the filter group (e.g., service, environment)"
        },
        "values": {
          "maxItems": 1000,
          "minItems": 0,
          "type": "array",
          "items": {
            "maxLength": 4096,
            "minLength": 1,
            "pattern": "^[\\s\\S]*$",
            "type": "string",
            "description": "Values associated with the filter group key"
          },
          "description": "Values associated with the filter group key"
        }
      },
      "description": "A filter group containing a key and its possible values."
    },
    "ImpactedEntityFilter": {
      "title": "Impacted entity filter",
      "type": "object",
      "oneOf": [
        {
          "required": [
            "apmService"
          ],
          "type": "object"
        },
        {
          "required": [
            "apmDatabase"
          ],
          "type": "object"
        }
      ],
      "properties": {
        "apmDatabase": {
          "$ref": "#/$defs/ApmDatabaseEntityFilter"
        },
        "apmService": {
          "$ref": "#/$defs/ApmServiceEntityFilter"
        }
      },
      "description": "Selects cases by an impacted APM entity (service or database)."
    },
    "IndicatorType": {
      "enum": [
        "INDICATOR_TYPE_UNSPECIFIED",
        "INDICATOR_TYPE_ALERT",
        "INDICATOR_TYPE_PROMETHEUS_ALERTMANAGER",
        "INDICATOR_TYPE_ERROR_TRACKING"
      ],
      "type": "string"
    },
    "KPIFilter": {
      "enum": [
        "KPI_FILTER_UNSPECIFIED",
        "KPI_FILTER_TIME_TO_ACKNOWLEDGE_BREACHED",
        "KPI_FILTER_TIME_TO_RESOLVE_BREACHED",
        "KPI_FILTER_NOT_BREACHED",
        "KPI_FILTER_TIME_TO_UPDATE_BREACHED"
      ],
      "type": "string"
    },
    "NoConnector": {
      "type": "object",
      "additionalProperties": false,
      "description": "No connector."
    },
    "Unassigned": {
      "title": "Unassigned",
      "type": "object",
      "additionalProperties": false,
      "description": "Marker selecting cases that have no assignee."
    },
    "v1.ConnectorType": {
      "enum": [
        "CONNECTOR_TYPE_UNSPECIFIED",
        "CONNECTOR_TYPE_SLACK",
        "CONNECTOR_TYPE_SERVICE_NOW",
        "CONNECTOR_TYPE_PAGER_DUTY",
        "CONNECTOR_TYPE_EMAIL",
        "CONNECTOR_TYPE_GENERIC_HTTPS",
        "CONNECTOR_TYPE_MICROSOFT_TEAMS"
      ],
      "type": "string",
      "description": "Connector type."
    },
    "v1.KeyValue": {
      "title": "Key-value pair",
      "required": [
        "key",
        "value"
      ],
      "type": "object",
      "properties": {
        "key": {
          "maxLength": 4096,
          "minLength": 1,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Key of the pair (e.g., label or grouping name)"
        },
        "value": {
          "maxLength": 4096,
          "minLength": 1,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Value associated with the key"
        }
      },
      "description": "Represents a simple key-value pair, often used for labels or groupings in cases."
    }
  }
}