Query Metric Aggregates
documentedCompute aggregates for a metric.
POST /api/metrics/{metric_id}/queryMetricsno implementation yet0 runsNo implementation yet. Run it to have the agent write one, or open a pull request with your own.
Seed example (keychains curl)
npx -y keychains@latest curl "https://a.klaviyo.com/api/metric-aggregates" \
-X POST \
-H "Authorization: Klaviyo-API-Key {{KLAVIYO_API_KEY}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "revision: 2026-01-15" \
-d '{"data": {"type": "metric-aggregate", "attributes": {"measurements": ["{{$measurement}}"], "by": ["{{$by_dimension}}"], "filter": ["greater-or-equal(datetime,{{$start_datetime}})", "less-than(datetime,{{$end_datetime}})"], "metric_id": "{{$metric_id}}", "interval": "{{$interval}}", "timezone": "{{$timezone}}"}}}'