---
title: "Batch Metrics"
method: POST
path: "/v1/metrics/batch"
---

# Batch Metrics

`POST /v1/metrics/batch`

Execute multiple metric queries in a single request.

Scalar aggregations are combined into a single SQL query with multiple
aggregation expressions, except DISTINCT aggregates (unique_viewers),
which run in a separate SELECT to avoid poisoning the combined query's
plan (see _DISTINCT_METRICS). Special metrics like avg_session_duration
fall back to individual queries. total_views is computed at most once
per request.

## Request body

- MetricsBatchRequest — POST /v1/metrics/batch request body.
  - `queries` MetricQuery[], required
    - `metric` string, required
    - `measurement` string, nullable
  - `timeframe` string[]
  - `filters` string[]

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/shortkit/apis/shortkit-api.md) · [All operations](https://skmtc.net/shortkit/apis/shortkit-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/shortkit/shortkit-api/revisions/801982ed74cd/schema)
