You can now query and evaluate human-generated feedback with the feedback API endpoint. Using HTTP endpoints and standard query parameters, you can filter by region, environment, thread, source, trace, entity, or experiment.
Human feedback comes in many forms — a thumbs up / thumbs down, a star rating, or a detailed comment. The feedback API gives you the parameters to construct powerful, fine-grained queries to see how well your agents are performing in the real world.
We shipped the TypeScript API in @mastra/core@1.18.0 (PR #14842). The new feedback API endpoint is language-agnostic and can be called from other services.
As of today, the feedback API endpoint is read-only. For writes, review-status updates, and deletes, use the TS API.
Get started
Each request needs two headers, a region-specific endpoint, and a project ID. Mastra platform currently supports two regions:
export MASTRA_PLATFORM_ACCESS_TOKEN=/* ... */
export MASTRA_PROJECT_ID=/* ... */curl -H "Authorization: Bearer $MASTRA_PLATFORM_ACCESS_TOKEN" \
-H "X-Mastra-Project-Id: $MASTRA_PROJECT_ID" \
<endpoint>/feedbackThe examples below use <endpoint> as shorthand for the region endpoint:
- EU:
https://observability.eu.mastra.ai/api/observability - US:
https://observability.mastra.ai/api/observability
Query parameters
Both feedback and OLAP queries accept the same set of parameters. Use one, or combine several, to fine-tune your queries:
- Environment:
environment,serviceName - Identity:
threadId,resourceId,userId,sessionId,feedbackUserId - Trace:
traceId,spanId,runId,requestId - Entity:
entityName,entityType,entityVersionId,parentEntityName,parentEntityType,rootEntityName,rootEntityType - Content:
feedbackType,feedbackSource,reviewStatus(needs-review|reviewed),tags,source - Experiment:
experimentId,executionSource
See the types reference for full details.
List feedback
Example: A query for rating feedback in production:
curl -H "Authorization: Bearer $MASTRA_PLATFORM_ACCESS_TOKEN" \
-H "X-Mastra-Project-Id: $MASTRA_PROJECT_ID" \
"<endpoint>/feedback?environment=production&feedbackType=rating"OLAP queries
Each OLAP endpoint is a POST request with a JSON body. The body has two parts: a filters object that accepts any of the query parameters mentioned above, and operation params specific to each endpoint (covered below).
Aggregate
Example: A query for the average rating in production from user-submitted feedback:
Body params:
aggregation—avg|sum|min|max|count.
curl -X POST
-H // ...
-H // ...
-d '{
"filters": { "environment": "production" },
"feedbackType": "rating",
"feedbackSource": "user",
"aggregation": "avg"
}' \
<endpoint>/feedback/aggregateBreakdown
Example: A query for the average rating in production, grouped by feedback source:
Body params:
aggregation— same options as Aggregate.groupBy— array of grouping keys (feedbackSource,feedbackType,entityName,entityType,environment, etc.).
curl -X POST
-H // ...
-H // ...
-d '{
"filters": { "environment": "production" },
"feedbackType": "rating",
"aggregation": "avg",
"groupBy": ["feedbackSource"]
}' \
<endpoint>/feedback/breakdownTimeseries
Example: A query for the average rating in production, bucketed by day:
Body params:
aggregation— same options as Aggregate.interval—1m|5m|15m|1h|1d.
curl -X POST
-H // ...
-H // ...
-d '{
"filters": { "environment": "production" },
"feedbackType": "rating",
"aggregation": "avg",
"interval": "1d"
}' \
<endpoint>/feedback/timeseriesPercentiles
Example: A query for the p50, p90, p95, and p99 rating in production, bucketed by day:
Body params:
percentiles— array in[0, 1], e.g.[0.5, 0.9, 0.95, 0.99].interval— same options as Timeseries.
curl -X POST
-H // ...
-H // ...
-d '{
"filters": { "environment": "production" },
"feedbackType": "rating",
"percentiles": [0.5, 0.9, 0.95, 0.99],
"interval": "1d"
}' \
<endpoint>/feedback/percentilesFor more information and full configuration options, see:
