{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pathbound-ai/json-schema/pathbound-ai-post-v1-aggregate-request-schema.json",
  "title": "PostV1AggregateRequest",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_ae-authored/pathbound-ai-openapi-generated.yml#/components/schemas/PostV1AggregateRequest",
  "type": "object",
  "properties": {
    "entity": {
      "type": "string",
      "description": "contacts , companies , deals , or events ."
    },
    "group_by": {
      "type": "string",
      "description": "Field to group on (e.g. lifecycle_stage , industry , country , stage , event_type , day )."
    },
    "filters": {
      "type": "object",
      "description": "Entity-specific filters applied before grouping."
    },
    "field_filters": {
      "type": "array",
      "description": "Typed filters on canonical or materialized source fields."
    },
    "segment": {
      "type": "string",
      "description": "Scope to a saved segment (id or handle)."
    },
    "metric": {
      "type": "string",
      "description": "count (default), avg , sum , min , max ."
    },
    "metric_field": {
      "type": "string",
      "description": "Required for non- count metrics — the field to aggregate."
    },
    "limit": {
      "type": "number",
      "description": "Max buckets returned (1–50, default 25)."
    }
  },
  "required": [
    "entity",
    "group_by"
  ]
}