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

EndpointReturns
/overviewThe headline figures against the period before, spend and merged pull requests per day, config changes, and the stations worth improving.
/flowWhere tasks wait at each station, queued, running or in the inbox, and the time to pull request, first review and merge.
/pull-requestsSpotlight's share of merged pull requests by week and repository, Spotlight's against people's, types, and review depth.
/pull-requests/listEvery pull request opened or closed in the period, or still open, the latest first, a page at a time.
/shippingHow 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.
/stationsEach station's tally, per day and against the period before, with its task failures apart from its run failures.
/changesEvery station config change in the period, with how the station's runs went before and after it.
/config-change-outcomesThe outcome verdict of each station config change in the period. See /config-change-outcomes.
/agent-configsHow runs went against what they cost on each agent config (harness, model, effort and harness profile), with the frontier marked for each outcome.
/peopleWhat the team's work asks of people, and who is active: new, weekly and monthly.
/costSpend 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.
/toolsWhich skills were enabled for the runs and which they read, week by week, and how each MCP server they called behaved.
/memoryThe team's active memories, how many runs were briefed with or recalled them, which were flagged wrong, and runs with memories against runs without.
/tracesEach 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:

ParameterNarrows to runs
lineIdOn this line.
stationIdAt this station.
outcomeThat ended this way: completed, failed, stopped, exhausted, cancelled or superseded. See Run endings.
harnessOn this harness.
modelWith this model; ~default for runs that named none.
repositoryThat worked this repository; none for runs that worked none.
fingerprintWith this config fingerprint.
taskIdOf this task.
taskIdsOf these tasks, comma-separated, at most 200.
personIdOf tasks this person opened.
dayThat ended on this UTC day of the range, as YYYY-MM-DD.
pullRequestStateOf tasks whose pull requests are now, together, open (one is open), merged (all merged) or closed (the rest).
humanActionWhose human action was started, parked, accepted, answered, sent-back or held-as-wrong.
resolutionThat ran and whose resolution is accepted, sent-back, moved-on, failed or other.
askedtrue: of tasks that asked a person in the inbox during the range. false narrows nothing.
weekThat ended in the week starting this UTC Monday, as YYYY-MM-DD.
skillEnabledWhose station config enabled this skill.
skillUsedThat read this skill.
serverThat called this MCP server.
serverFailedWith a call to this MCP server that failed.
failedAfterThat failed where the run's last call to this MCP server failed.
dismissedToolWhere a person dismissed an approval of this tool.
dismissedServerWhere 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:

ParameterNarrows to runs
stationIdAt this station.
sizeOf this size: small, medium or large. See Harness, model, effort and profile.

/pull-requests/list also takes:

ParameterNarrows to pull requests
repositoryIn these repositories, comma-separated or repeated, at most 50.
authorWritten by spotlight, reviewed, people or bots.
typeOf type feature, fix, refactor, tests, chore or other.
statemerged or closed in the period, or still open.
weekClosed in the week starting this UTC day, as YYYY-MM-DD.
revertedtrue: reverted by another merged pull request.
comparedtrue: in the repositories Spotlight merged into in the period.
roundsThat needed 0, 1, 2 or 3+ review rounds.
pageWhich page, from 1. A value that is not a whole number above 0 is read as 1. A page past the last is empty.
sizePull 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.

FieldTypeDescription
range, from, tostringThe range and where it starts and ends.
volume[]objectThe 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[]objectTasks with an unfinished run first, then the task whose latest run ended or started last.
matchednumberHow many runs match: those that ended in the range, and those that are unfinished.
truncatedbooleantrue when more runs match than the 5,000 read.
people[]objectpersonId and name, or null, for everyone in openedBy.

Each trace:

FieldTypeDescription
taskId, titlestringThe task.
inputstring or nullWhat the task asks for, at most 300 characters.
outputstring or nullThe newest note of the listed runs, at most 300 characters.
stationstation or nullWhere the task is now.
stations[]stationThe stations of the listed runs and station, in the line's order.
startedAtstringWhen the first listed run was queued.
msnumber or nullFrom startedAt to when the last listed run ended; null while a run is unfinished.
errorsnumberThe errors of the listed runs.
costmoney or nullWhat the listed runs cost; null with none priced, or prices in more than one currency.
totalnumberHow many runs the task had in the range, the filters not applied, unfinished ones included.
runs[]objectThe 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.

FieldTypeDescription
periodobjectname, from, to, previousFrom, previousTo and days, every UTC day in the period, oldest first.
toMergeby-authorOpened to merged, for pull requests merged in the period.
toMergeChangesobjectspotlight and people, each with p50, p75, p90 and p95: a delta against the period before, or null.
mergeDays[]objectFor 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[]objectFor each type with a pull request merged: type, merged (Spotlight's and people's alone) and toMerge (by-author).
slowestFirstobjectp50, p75, p90 and p95: the types in types, slowest first by Spotlight's time at that percentile, those with none last.
depth[]objectFor each week, from its UTC Monday: week, merged, and rounds[], a rounds count for each of 0, 1, 2 and 3+.
depthTotals[]rounds countThe weeks in depth summed, for each number of review rounds.
reviewDays[]objectFor 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[]objectEach review bot, the most comments first: login, comments, reviews and resolvedRate, from 0 to 1, or null where it started no thread.
pipelineobjectmerged (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).
shippedAnybooleanWhether 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:

FieldDescription
totalPercentiles of the stage's time.
partsAt a station, queued, running and inbox, each percentiles; otherwise null.
bottleneckRatiop50, 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.
worstp50, p75, p90 and p95: whether this is the longest stage in the layout for the same type; the first on a tie.
longestPartAt 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.

FieldTypeDescription
periodobjectThe period read.
outcomes[]objectOne for each config change, newest first.

Each outcome:

FieldTypeDescription
idstringThe outcome's id.
lineId, stationIdstringThe station whose config changed.
runIdstringThe first run on the new config.
tookEffectAtstringWhen that run began.
pullRequeststring or nullThe config pull request of the change, when Spotlight found one.
windowstringcollecting 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.
collectednumberRuns on the new config with people's verdict, up to windowRuns.
windowRunsnumberThe runs the window closes at: 10.
closedAtstring or nullWhen the window closed or was superseded.
measures[]objectOne for each measure once the window is closed or superseded. Empty while it collects.

Each measure:

FieldTypeDescription
measurestringfollow-ups-per-run, sent-back-or-held-rate or cost-per-accepted-run. Lower is better for each.
before, afternumber or nullThe measure over the runs before and after the change, or null where no run counts for it.
differenceobject or nullestimate, 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.
verdictstring or nullbetter 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.
currencystring or nullThe currency of a cost; null for the other measures.
runsBeforenumberRuns before the change that count for the measure, at most the last 30.
runsAfternumberRuns after the change that count for the measure.
likeWithLikebooleantrue 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

StatusCause
401No session or token, or an unknown, expired or revoked token.
404There 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.
422On 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:

CauseMessage
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:

CauseMessage
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>.

On this page