{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coralogix/json-schema/coralogix-cases-v1-get-filter-values-response-schema.json",
  "title": "Get case filter values response",
  "description": "Aggregated counts for building filters in the UI",
  "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/cases.v1.GetFilterValuesResponse",
  "required": [
    "priorityAggregations",
    "categoryAggregations",
    "groupingAggregations",
    "labelAggregations",
    "statusAggregations",
    "flatLabelsAggregation",
    "alertIdAggregations"
  ],
  "type": "object",
  "properties": {
    "alertIdAggregations": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/AlertIdAggregation"
      },
      "description": "Aggregated case counts per alert definition ID. Only populated when alert_filters is provided in the request."
    },
    "assigneeAggregations": {
      "allOf": [
        {
          "$ref": "#/$defs/AssigneeAggregation"
        }
      ],
      "description": "Aggregated case counts grouped by assignee."
    },
    "categoryAggregations": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/CategoryAggregation"
      },
      "description": "Aggregated case counts grouped by category."
    },
    "flatLabelsAggregation": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/FilterAggregation"
      },
      "description": "Aggregated case counts grouped by individual flat label key/value pairs."
    },
    "groupingAggregations": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/FilterGroupAggregation"
      },
      "description": "Aggregated case counts grouped by grouping key/value pairs."
    },
    "labelAggregations": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/FilterGroupAggregation"
      },
      "description": "Aggregated case counts grouped by label key/value pairs."
    },
    "priorityAggregations": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/PriorityAggregation"
      },
      "description": "Aggregated case counts grouped by priority."
    },
    "statusAggregations": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/StatusAggregation"
      },
      "description": "Aggregated case counts grouped by status."
    }
  },
  "$defs": {
    "AlertIdAggregation": {
      "title": "Alert ID aggregation",
      "type": "object",
      "properties": {
        "alertId": {
          "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": "Alert definition ID"
        },
        "count": {
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer",
          "description": "Number of cases associated with this alert ID",
          "format": "int64"
        }
      },
      "description": "Count of cases associated with a single alert definition ID."
    },
    "AssigneeAggregation": {
      "title": "Assignee aggregation",
      "required": [
        "assignedCounts"
      ],
      "type": "object",
      "properties": {
        "assignedCounts": {
          "maxItems": 1000,
          "minItems": 0,
          "type": "array",
          "items": {
            "$ref": "#/$defs/AssigneeCount"
          },
          "description": "Counts of cases grouped by assignee"
        },
        "unassignedCount": {
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer",
          "description": "Number of cases without an assignee",
          "format": "int64"
        }
      },
      "description": "Case counts broken down by assignee plus the count of unassigned cases."
    },
    "AssigneeCount": {
      "title": "Assignee count",
      "type": "object",
      "properties": {
        "assignee": {
          "maxLength": 256,
          "minLength": 1,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Identifier of the assignee"
        },
        "count": {
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer",
          "description": "Number of cases assigned to this assignee",
          "format": "int64"
        }
      },
      "description": "Count of cases for a single assignee."
    },
    "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)."
    },
    "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."
    },
    "CategoryAggregation": {
      "title": "Category aggregation",
      "type": "object",
      "properties": {
        "category": {
          "allOf": [
            {
              "$ref": "#/$defs/CaseCategory"
            }
          ],
          "description": "Case category"
        },
        "count": {
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer",
          "description": "Number of cases in this category",
          "format": "int64"
        }
      },
      "description": "Count of cases grouped by case category."
    },
    "FilterAggregation": {
      "title": "Filter aggregation",
      "type": "object",
      "properties": {
        "count": {
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer",
          "description": "Number of cases matching this filter",
          "format": "int64"
        },
        "filter": {
          "allOf": [
            {
              "$ref": "#/$defs/v1.KeyValue"
            }
          ],
          "description": "Key/value filter that this count corresponds to"
        }
      },
      "description": "Count of cases matching a single key/value filter combination."
    },
    "FilterGroupAggregation": {
      "title": "Filter group aggregation",
      "required": [
        "valueCounts"
      ],
      "type": "object",
      "properties": {
        "key": {
          "maxLength": 4096,
          "minLength": 1,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Filter group key"
        },
        "valueCounts": {
          "maxItems": 1000,
          "minItems": 0,
          "type": "array",
          "items": {
            "$ref": "#/$defs/ValueCount"
          },
          "description": "Aggregations per value"
        }
      },
      "description": "Aggregated case counts for a single filter group key, with one entry per observed value."
    },
    "PriorityAggregation": {
      "title": "Priority aggregation",
      "type": "object",
      "properties": {
        "count": {
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer",
          "description": "Number of cases with this priority",
          "format": "int64"
        },
        "priority": {
          "allOf": [
            {
              "$ref": "#/$defs/CasePriority"
            }
          ],
          "description": "Case priority"
        }
      },
      "description": "Count of cases grouped by case priority."
    },
    "StatusAggregation": {
      "title": "Status aggregation",
      "type": "object",
      "properties": {
        "count": {
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer",
          "description": "Number of cases with this status",
          "format": "int64"
        },
        "status": {
          "allOf": [
            {
              "$ref": "#/$defs/CaseStatus"
            }
          ],
          "description": "Case status"
        }
      },
      "description": "Count of cases grouped by case status."
    },
    "ValueCount": {
      "title": "Filter value count",
      "type": "object",
      "properties": {
        "count": {
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer",
          "description": "Count of cases for this value",
          "format": "int64"
        },
        "value": {
          "maxLength": 4096,
          "minLength": 1,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Filter value"
        }
      },
      "description": "Number of cases that share a single filter group value."
    },
    "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."
    }
  }
}