Insights API
Every figure on the Insights page is read
through these endpoints, but for the Candidates section of the Stations tab,
which is read through the
Replayed candidates API, the
Patterns tab, which is read through the
Maintenance API, and the runs on the live
config on a station's page, which are read through the station's own
endpoints. All are GET, under /api/teams/{teamId}/insights,
and answer JSON.
Endpoints
| Endpoint | Returns |
|---|---|
/overview | The headline figures against the period before, spend and merged pull requests per day, config changes, and the stations worth improving. |
/flow | Where tasks wait at each station, queued, running or in the inbox, and the time to pull request, first review and merge. |
/pull-requests | Spotlight's share of merged pull requests by week and repository, Spotlight's against people's, types, and review depth. |
/pull-requests/list | Every pull request opened or closed in the period, or still open, the latest first, a page at a time. |
/shipping | How fast Spotlight's pull requests ship against people's alone: time to merge by day and by type, review depth by week, time to first review, review bots, and how long merged pull requests spent at each stage. See /shipping. |
/stations | Each station's tally, per day and against the period before, with its task failures apart from its run failures. |
/changes | Every station config change in the period, with how the station's runs went before and after it. |
/config-change-outcomes | The outcome verdict of each station config change in the period. See /config-change-outcomes. |
/agent-configs | How runs went against what they cost on each agent config (harness, model, effort and harness profile), with the frontier marked for each outcome. |
/people | What the team's work asks of people, and who is active: new, weekly and monthly. |
/cost | Spend by harness, model, station and repository, from model to station to repository. meteredSpend is the part of spend that tools reported for the models they called, with usage; null without one. |
/tools | Which skills were enabled for the runs and which they read, week by week, and how each MCP server they called behaved. |
/memory | The team's active memories, how many runs were briefed with or recalled them, which were flagged wrong, and runs with memories against runs without. |
/traces | Each task with a run in the range as one trace, with its runs that match the filters. See /traces. |
/alerts/{alertId} | A station alert that fired: the rule that fired, the run that fired it, and the measure run by run around it. |
Parameters
Every endpoint but /alerts/{alertId} and /traces takes period: 7d, 30d or 90d, whole UTC days up to and
including today. Default: 30d. Every answer also covers the period before,
as long.
/traces takes range in place of period: 30m, 1h, 6h, 1d, 3d,
7d, 14d, 30d or 90d. Default: 30d. The range ends now. 7d, 30d
and 90d start where the period of that name starts; the others count back
from now. /traces also takes:
| Parameter | Narrows to runs |
|---|---|
lineId | On this line. |
stationId | At this station. |
outcome | That ended this way: completed, failed, stopped, exhausted, cancelled or superseded. See Run endings. |
harness | On this harness. |
model | With this model; ~default for runs that named none. |
repository | That worked this repository; none for runs that worked none. |
fingerprint | With this config fingerprint. |
taskId | Of this task. |
taskIds | Of these tasks, comma-separated, at most 200. |
personId | Of tasks this person opened. |
day | That ended on this UTC day of the range, as YYYY-MM-DD. |
pullRequestState | Of tasks whose pull requests are now, together, open (one is open), merged (all merged) or closed (the rest). |
humanAction | Whose human action was started, parked, accepted, answered, sent-back or held-as-wrong. |
resolution | That ran and whose resolution is accepted, sent-back, moved-on, failed or other. |
asked | true: of tasks that asked a person in the inbox during the range. false narrows nothing. |
week | That ended in the week starting this UTC Monday, as YYYY-MM-DD. |
skillEnabled | Whose station config enabled this skill. |
skillUsed | That read this skill. |
server | That called this MCP server. |
serverFailed | With a call to this MCP server that failed. |
failedAfter | That failed where the run's last call to this MCP server failed. |
dismissedTool | Where a person dismissed an approval of this tool. |
dismissedServer | Where a person dismissed an approval of a tool of this MCP server; none for dismissals of a tool with no server. |
/agent-configs also takes:
| Parameter | Narrows to runs |
|---|---|
stationId | At this station. |
size | Of this size: small, medium or large. See Harness, model, effort and profile. |
/pull-requests/list also takes:
| Parameter | Narrows to pull requests |
|---|---|
repository | In these repositories, comma-separated or repeated, at most 50. |
author | Written by spotlight, reviewed, people or bots. |
type | Of type feature, fix, refactor, tests, chore or other. |
state | merged or closed in the period, or still open. |
week | Closed in the week starting this UTC day, as YYYY-MM-DD. |
reverted | true: reverted by another merged pull request. |
compared | true: in the repositories Spotlight merged into in the period. |
rounds | That needed 0, 1, 2 or 3+ review rounds. |
page | Which page, from 1. A value that is not a whole number above 0 is read as 1. A page past the last is empty. |
size | Pull requests per page. Default: 50. At most 200; a larger number is read as 200. |
With both taskId and taskIds, only that task's runs are listed, and only if
it is among taskIds.
/alerts/{alertId} reads the station's latest 500 runs.
/traces
GET /api/teams/{teamId}/insights/traces lists a trace for each task with a
run that matches the filters: one that ended in the range, cancelled runs
included, or one that is queued, in progress or stopping. Only the filters
lineId, stationId, harness, taskId, taskIds and personId can match
an unfinished run. It reads the newest 5,000 runs that match. Times are in
milliseconds. See Traces.
| Field | Type | Description |
|---|---|---|
range, from, to | string | The range and where it starts and ends. |
volume[] | object | The range cut into evenly long bars, empty ones included: from, to, count, the traces whose latest run is in the bar, and errors, their errors. |
traces[] | object | Tasks with an unfinished run first, then the task whose latest run ended or started last. |
matched | number | How many runs match: those that ended in the range, and those that are unfinished. |
truncated | boolean | true when more runs match than the 5,000 read. |
people[] | object | personId and name, or null, for everyone in openedBy. |
Each trace:
| Field | Type | Description |
|---|---|---|
taskId, title | string | The task. |
input | string or null | What the task asks for, at most 300 characters. |
output | string or null | The newest note of the listed runs, at most 300 characters. |
station | station or null | Where the task is now. |
stations[] | station | The stations of the listed runs and station, in the line's order. |
startedAt | string | When the first listed run was queued. |
ms | number or null | From startedAt to when the last listed run ended; null while a run is unfinished. |
errors | number | The errors of the listed runs. |
cost | money or null | What the listed runs cost; null with none priced, or prices in more than one currency. |
total | number | How many runs the task had in the range, the filters not applied, unfinished ones included. |
runs[] | object | The runs that match, unfinished first, then the newest first. |
Each run: runId; station; progress, queued, in-progress or
stopping, or null once it ended; ending, or null until it ends (see
Run endings);
failure; openedBy, who opened the task; harness; model, or null
where the run named none; startedAt, when a runner claimed it or else when it
was queued; endedAt; and ms, errors and cost, each null until its
usage is recorded. A station is stationId, name, color, position and
count, the number of stations on its line.
/shipping
GET /api/teams/{teamId}/insights/shipping takes period alone. It sets
Spotlight's pull requests against people's alone, those people opened with no
Spotlight review task, in the repositories Spotlight merged into in the
period. Times are in milliseconds. See
What the agents ship and
Review and approval for
how each is measured.
| Field | Type | Description |
|---|---|---|
period | object | name, from, to, previousFrom, previousTo and days, every UTC day in the period, oldest first. |
toMerge | by-author | Opened to merged, for pull requests merged in the period. |
toMergeChanges | object | spotlight and people, each with p50, p75, p90 and p95: a delta against the period before, or null. |
mergeDays[] | object | For each day of the period: day, daily (by-author, for pull requests merged that day) and rolling (by-author, merged in the 7 days ending that day). |
types[] | object | For each type with a pull request merged: type, merged (Spotlight's and people's alone) and toMerge (by-author). |
slowestFirst | object | p50, p75, p90 and p95: the types in types, slowest first by Spotlight's time at that percentile, those with none last. |
depth[] | object | For each week, from its UTC Monday: week, merged, and rounds[], a rounds count for each of 0, 1, 2 and 3+. |
depthTotals[] | rounds count | The weeks in depth summed, for each number of review rounds. |
reviewDays[] | object | For each day of the period: toFirstReviewDaily and toFirstReviewRolling (percentiles, for pull requests first reviewed that day, or in the 7 days ending that day), awaiting (pull requests ready and not yet reviewed as the day ended) and humanReviews (reviews people submitted that day). |
bots[] | object | Each review bot, the most comments first: login, comments, reviews and resolvedRate, from 0 to 1, or null where it started no thread. |
pipeline | object | merged (Spotlight's pull requests merged in the period whose task opened in the period, the period before, or the last 30 days where that reaches further), types[] (type and merged) and layouts: stations (a stage for each station the tasks ran at, in order of first use, then the review stages) and stages (coding as one stage, then the review stages). |
shippedAny | boolean | Whether pipeline.merged is above 0, types is not empty, or any day of reviewDays has awaiting or humanReviews above 0. Pull requests written by bots or reviewed never count for the first two, and people's count only in the repositories Spotlight merged into. |
A percentiles object has p50Ms, p75Ms, p90Ms and p95Ms, each null
when nothing was measured, and count. A by-author object has spotlight and
people, each a percentiles object. A rounds count has rounds, merged and
rate, from 0 to 1, or null where nothing merged. A delta has unit
(percent or points), by (null when it rose from 0), fromZero,
direction (up, down or same) and tone (good, bad or flat).
A stage in layouts has kind (coding, station, awaitingReview,
inReview or awaitingMerge), lineId and stationId (null but for a
station), and times: all, and types[] with type and times for each
type that went through it. Each times object has:
| Field | Description |
|---|---|
total | Percentiles of the stage's time. |
parts | At a station, queued, running and inbox, each percentiles; otherwise null. |
bottleneckRatio | p50, p75, p90 and p95: the stage's time over the longest stage's in the same layout, for the same type, from 0 to 1. |
worst | p50, p75, p90 and p95: whether this is the longest stage in the layout for the same type; the first on a tie. |
longestPart | At a station, p50, p75, p90 and p95: the part that took longest, queued first on a tie, or null where no part took any time. Otherwise null. |
/config-change-outcomes
GET /api/teams/{teamId}/insights/config-change-outcomes gives the
outcome verdict
of each station config change that took effect in the period, newest first.
It takes period. See
Config changes.
| Field | Type | Description |
|---|---|---|
period | object | The period read. |
outcomes[] | object | One for each config change, newest first. |
Each outcome:
| Field | Type | Description |
|---|---|---|
id | string | The outcome's id. |
lineId, stationId | string | The station whose config changed. |
runId | string | The first run on the new config. |
tookEffectAt | string | When that run began. |
pullRequest | string or null | The config pull request of the change, when Spotlight found one. |
window | string | collecting until 10 runs on the new config have people's verdict, then closed. superseded when a newer config change took effect before the window was full. A closed or superseded outcome does not change. |
collected | number | Runs on the new config with people's verdict, up to windowRuns. |
windowRuns | number | The runs the window closes at: 10. |
closedAt | string or null | When the window closed or was superseded. |
measures[] | object | One for each measure once the window is closed or superseded. Empty while it collects. |
Each measure:
| Field | Type | Description |
|---|---|---|
measure | string | follow-ups-per-run, sent-back-or-held-rate or cost-per-accepted-run. Lower is better for each. |
before, after | number or null | The measure over the runs before and after the change, or null where no run counts for it. |
difference | object or null | estimate, after less before, with low and high, the 95% bootstrap interval. null below 10 counted runs on either side, where the costs are in different currencies, or when the outcome is superseded. |
verdict | string or null | better when high is below 0, worse when low is above 0, else no-clear-difference. null when the measure was not compared: a side has fewer than 10 runs, the costs are in more than one currency, or the outcome is superseded. |
currency | string or null | The currency of a cost; null for the other measures. |
runsBefore | number | Runs before the change that count for the measure, at most the last 30. |
runsAfter | number | Runs after the change that count for the measure. |
likeWithLike | boolean | true when runs are compared by size, small with small and large with large. |
Who may read
A person on the team or an owner or admin of its workspace, signed in, or a
workspace token of the team's workspace
with the read scope, sent as Authorization: Bearer <token>. Anyone else
is answered 404. See
Team outcomes.
Errors
| Status | Cause |
|---|---|
401 | No session or token, or an unknown, expired or revoked token. |
404 | There is no such team, the team is not in the caller's workspace, the caller is a token without the read scope, or the caller is a person neither on the team nor an owner or admin of the workspace: Team <teamId> not found. For /alerts/{alertId}, also an alert of another team or none: Alert <alertId> not found. |
422 | On every endpoint but /alerts/{alertId} and /traces, period is not 7d, 30d or 90d, or is sent twice: Period must be 7d, 30d or 90d. On /traces, range is not one it takes, or is sent twice: Range must be one of 30m, 1h, 6h, 1d, 3d, 7d, 14d, 30d, 90d. See below for the filters. |
On /traces, where <filter> names the parameter as line, station,
outcome, harness, model, repository, station config, task,
person, day, week, skill enabled, skill used, server,
server that failed, server failed after, dismissed tool,
dismissed server, pull request state, human action or
answer to whether the task asked:
| Cause | Message |
|---|---|
taskIds names more than 200 tasks. | Run filter takes at most 200 tasks. |
outcome, pullRequestState, humanAction, resolution or asked names a value it does not take. | Run filter <filter> must be one of <values>, not <value>., as in Run filter human action must be one of started, parked, accepted, sent-back, held-as-wrong, answered, not approved. |
| A filter that takes one value is given more than once. | Run filter takes one <filter>, not <count>. |
day is not a day of the range written YYYY-MM-DD. | Run filter day must be a date in the period, in the form YYYY-MM-DD, not <value>. |
week is not a Monday written YYYY-MM-DD. | Run filter week must be a Monday in the form YYYY-MM-DD, not <value>. |
A filter value other than a taskIds entry is longer than 200 characters. | Run filter <filter> must be at most 200 characters. |
On /pull-requests/list, where <filter> names the parameter as author,
type, state, week, reverted, count of review rounds or compared:
| Cause | Message |
|---|---|
repository names more than 50 repositories. | Pull request filter takes at most 50 repositories. |
author, type, state, reverted, rounds or compared names a value it does not take. | Pull request filter <filter> must be one of <values>, not <value>. |
| A filter that takes one value is given more than once. | Pull request filter takes one <filter>, not <count>. |
week does not match YYYY-MM-DD, or cannot be read as a date. A day past the end of its month, as in 2026-02-31, is read as a day of the next month. | Pull request filter week must be a date in the form YYYY-MM-DD, not <value>. |
On /agent-configs, a size other than small, medium or large:
Agent config filter size must be one of small, medium, large, not <value>.