---
title: "Feedback Stats"
method: POST
path: "/feedback/stats"
tags: ["Feedback"]
---

# Feedback Stats

`POST /feedback/stats`

Return aggregated feedback statistics over time buckets.

## Request body

- FeedbackStatsReq — Request for aggregated feedback statistics over time buckets.
  - `project_id` string, required
  - `start` string, date-time, required — Inclusive start time (UTC, ISO 8601).
  - `end` string, date-time, nullable — Exclusive end time (UTC, ISO 8601). Defaults to now if omitted.
  - `feedback_type` string, nullable — Filter by feedback_type.
  - `trigger_ref` string, nullable — Filter by trigger_ref (exact or prefix match for all-versions).
  - `granularity` integer, nullable — Bucket size in seconds. If omitted, auto-selected based on time range.
  - `timezone` string — IANA timezone for bucket alignment.
  - `metrics` FeedbackMetricSpec[] — Metrics to aggregate from payload_dump.
    - `json_path` string, required — Dot path into payload_dump (e.g. 'output', 'output.score').
    - `value_type` 'numeric' | 'boolean' | 'categorical' — Type of value at path. numeric: avg/min/max; boolean: count_true/count_false.
    - `aggregations` AggregationType[] — Aggregation functions to compute. If empty, defaults are chosen based on value_type: numeric->avg/min/max, boolean->count_true/count_false.
    - `percentiles` number[] — Percentile values to compute (0–100), e.g. [5, 50, 95]. Only applicable for numeric value_type fields; ignored for boolean/categorical.

## Response `200`

Successful Response

- FeedbackStatsRes — Response with time-series feedback statistics.
  - `start` string, date-time, required — Resolved start time (always UTC, regardless of the requested timezone).
  - `end` string, date-time, required — Resolved end time (always UTC, regardless of the requested timezone).
  - `granularity` integer, required — Bucket size used (in seconds)
  - `timezone` string, required — Timezone used for bucket alignment
  - `buckets` object[] — Time-bucketed aggregations. Each dict has 'timestamp' (ISO string), 'count' (int), and '{agg}_{slug}' keys for each requested metric+aggregation.
  - `window_stats` object, nullable — Aggregations over the full query window, keyed by metric slug (e.g. 'output_score'). Each value maps agg name to result.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/wandb/apis/serverless-training.md) · [All operations](https://skmtc.net/wandb/apis/serverless-training/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wandb/serverless-training/revisions/8d8d96fc0fd3/schema)
