A project's failed runs, grouped by cause and version
const url = 'https://example.com/v1/runs/failures?projectId=example&from=2026-04-15T12%3A00%3A00Z&to=2026-04-15T12%3A00%3A00Z';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/v1/runs/failures?projectId=example&from=2026-04-15T12%3A00%3A00Z&to=2026-04-15T12%3A00%3A00Z' \ --header 'Authorization: Bearer <token>'Counts from the server, never from a page: per group, how many runs failed, when the first and the latest failed in the window, and the latest run. People’s decisions (hitl-*: an approval rejected, cancelled or timed out) come apart as outcomes, never as failures. Runs that failed before their cause was recorded come apart as unrecorded, by subject and version only. Replays, eval runs’ runs and dry runs aren’t counted; a child run counts under its own agent or flow. Failed runs go with their retention, so a window can hold fewer than happened. Needs read on the project.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”The project whose runs are counted.
Runs that failed at or after this time (ISO 8601).
Runs that failed before this time (ISO 8601). At most 90 days after from.
Only this agent’s turns. Not with flowId.
Only this flow’s runs. Not with agentId.
What failures are grouped by: code, version, or code,version (the default).
The most groups in each list, the most failures first: 1 to 200, 50 by default.
Responses
Section titled “Responses”The groups.
object
The failures, the most first.
One group of failed runs: the same cause, subject and version.
object
The failure’s code (Run.failure.code). Absent when not grouped by code, and in unrecorded.
The failure’s reason (Run.failure.reason), when it gives one: a hitl-* outcome’s, e.g. timeout.
Whose runs a failure group counts: an agent’s turns, or a flow’s runs.
object
The agent’s or flow’s version. Absent when not grouped by version, or not recorded for the run.
When the first of them failed, in the window.
When the latest of them failed, in the window.
The group’s most recent run.
People’s decisions, never errors: hitl-* codes (an approval rejected, cancelled or timed out), the most first.
One group of failed runs: the same cause, subject and version.
object
The failure’s code (Run.failure.code). Absent when not grouped by code, and in unrecorded.
The failure’s reason (Run.failure.reason), when it gives one: a hitl-* outcome’s, e.g. timeout.
Whose runs a failure group counts: an agent’s turns, or a flow’s runs.
object
The agent’s or flow’s version. Absent when not grouped by version, or not recorded for the run.
When the first of them failed, in the window.
When the latest of them failed, in the window.
The group’s most recent run.
Runs that failed before their cause was recorded (a runtime from before this): by subject and version only, never by code.
One group of failed runs: the same cause, subject and version.
object
The failure’s code (Run.failure.code). Absent when not grouped by code, and in unrecorded.
The failure’s reason (Run.failure.reason), when it gives one: a hitl-* outcome’s, e.g. timeout.
Whose runs a failure group counts: an agent’s turns, or a flow’s runs.
object
The agent’s or flow’s version. Absent when not grouped by version, or not recorded for the run.
When the first of them failed, in the window.
When the latest of them failed, in the window.
The group’s most recent run.
Every failed run in the window, across the three lists.
Example
{ "groups": [ { "subject": { "kind": "agent" } } ], "outcomes": [ { "subject": { "kind": "agent" } } ], "unrecorded": [ { "subject": { "kind": "agent" } } ]}A missing or malformed projectId, from, to, groupBy or limit; a window over 90 days; both agentId and flowId.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}run-failures-not-supported: this deployment cannot group failed runs by cause.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}