List grouped test executions
const url = 'https://testperch.com/api/public/v1/projects/example/test-runs?first=50&sort_by=id&sort_order=asc';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://testperch.com/api/public/v1/projects/example/test-runs?first=50&sort_by=id&sort_order=asc' \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”ID of a project visible to the authenticated credential.
ID of a project visible to the authenticated credential.
Query Parameters
Section titled “Query Parameters”Opaque forward-pagination cursor containing only the active sort key and ID.
Opaque forward-pagination cursor containing only the active sort key and ID.
Number of grouped test executions to return (maximum 100).
Number of grouped test executions to return (maximum 100).
Search expression, not free text. Supports id, test_id, run_id, title, file, branch, pull_request.number, failed, status, expected_status, attempt_count, started_at, finished_at, and duration_ms. For failed tests use failed:true; for one run use run_id:“…” AND failed:true. This matches unexpected stored results, including unexpected passes, failures, timeouts, interruptions, and unreported results. Running, skipped, expected failures, and executions recovered to an expected result are excluded. Unreported means missing evidence. failed:false is the exact complement, not a passed filter; Boolean values must be unquoted and use :. Strings must be quoted; : matches exactly and ~ matches substrings (at least 3 characters). Mix AND and OR with parentheses: AND binds more tightly than OR, and whitespace means AND. Prefix a clause or group directly with - to negate it. Allow at most 10 clauses and 10 nested parentheses levels. Timestamps are integer Unix seconds. status:“failed” is a raw-result filter and includes expected failures; use status:“failed” AND expected_status:“failed” to find those. Use failed:true AND status:“passed” for unexpected passes. status:“flaky” denotes recovery to an expected result, including an expected failure. Example: (failed:true OR status:“flaky”) AND branch:“main”. Each query statement has a five-second limit; narrow run_id or started_at if query_timeout is returned.
Search expression, not free text. Supports id, test_id, run_id, title, file, branch, pull_request.number, failed, status, expected_status, attempt_count, started_at, finished_at, and duration_ms. For failed tests use failed:true; for one run use run_id:“…” AND failed:true. This matches unexpected stored results, including unexpected passes, failures, timeouts, interruptions, and unreported results. Running, skipped, expected failures, and executions recovered to an expected result are excluded. Unreported means missing evidence. failed:false is the exact complement, not a passed filter; Boolean values must be unquoted and use :. Strings must be quoted; : matches exactly and ~ matches substrings (at least 3 characters). Mix AND and OR with parentheses: AND binds more tightly than OR, and whitespace means AND. Prefix a clause or group directly with - to negate it. Allow at most 10 clauses and 10 nested parentheses levels. Timestamps are integer Unix seconds. status:“failed” is a raw-result filter and includes expected failures; use status:“failed” AND expected_status:“failed” to find those. Use failed:true AND status:“passed” for unexpected passes. status:“flaky” denotes recovery to an expected result, including an expected failure. Example: (failed:true OR status:“flaky”) AND branch:“main”. Each query statement has a five-second limit; narrow run_id or started_at if query_timeout is returned.
Stored field used to order grouped test executions: id, duration_ms, file, finished_at, started_at, or title. File and title ordering is case-insensitive. Nulls are always last.
Stored field used to order grouped test executions: id, duration_ms, file, finished_at, started_at, or title. File and title ordering is case-insensitive. Nulls are always last.
Sort direction. ID uses the same direction as the deterministic tie-breaker.
Sort direction. ID uses the same direction as the deterministic tie-breaker.
Responses
Section titled “Responses”A forward page of grouped test executions across runs.
object
object
One test execution within a run, including every recorded attempt. Timing and expected status come from the stored per-run test.
object
Run-level diagnostic retention state. Expired diagnostics are not evidence that the run reported no logs, steps, or attachments.
object
Per-run test ID (run_test_id), grouping all attempts of one test in one run and Playwright project.
Actual terminal status, with flaky for an execution that recovered from an unexpected attempt to an expected result and ended successfully. Passed excludes flaky; failed filtering uses the raw status and includes expected failures, including recovered expected failures.
Expected status stored for this test in the containing run. Compare with actual status: failed/failed met expectations; passed/failed did not.
Whether the stored execution result is unexpected: includes unexpected passes, failures, timeouts, interruptions, and unreported results. Running, skipped, expected failures, and executions recovered to an expected result are false. Unreported means missing evidence, not a confirmed assertion failure. Does not inspect attempt history.
Number of recorded attempts, including the initial attempt; matches attempts.data.length.
Maximum number of retries configured for this test in the run; 0 means no retries.
Stored per-run test start time, normalized to UTC.
Stored per-run test finish time in UTC, or null while unfinished or unreported.
Stored per-run test duration in milliseconds, or null when unavailable; not recomputed from attempts.
Playwright project recorded for this execution, or null.
Browser URL for this test within its run; may require a TestPerch user session.
Execution-wide context for the reporter run that contains the test execution.
object
Source-control branch reported for the run, or null.
CI provider’s build identifier, or null when not reported.
CI provider name reported for the run, or null.
Reported duration of the entire run in milliseconds, or null when unavailable.
Project environment matched to the run, or null when none was assigned.
object
Display label of the matched environment.
Configured name of the matched environment.
Configured environment matching type.
RFC 3339 timestamp reported when the entire run finished, normalized to UTC; null while unfinished or unreported.
Source-control commit SHA reported for the run, or null.
Reporter-run ID. The run is the execution container for many per-run tests, attempts, and shards.
Whether the reporter marked this run as partial, meaning the run may intentionally omit tests or shards.
Pull-request context reported for the run, or null.
object
Head commit SHA reported for the pull request, or null.
Pull-request number reported for the run.
Pull-request target branch, or null when not reported.
Source repository URL reported for the run, or null.
RFC 3339 timestamp reported when the entire run started, normalized to UTC.
Current or terminal aggregate outcome of the entire run, not the test execution; running is unfinished and unreported means no terminal result was reported.
Stable test identity, latest observed title and file, and current health metadata. Shared by /tests and embedded test definitions.
object
Current unresolved issue types for the test, or null when none are active. Does not determine an execution’s status.
Creation time of the active quarantine, or null when no quarantine is active. Branch allowances do not change this value.
All recorded attempts ordered by attempt number then ID, including an empty array when none were recorded. No limit or truncation.
object
object
Individual attempt ID, used as attempt_id in evidence URLs.
Zero-based attempt number; the initial attempt is 0.
Expected status for this attempt. A failed attempt is successful when failed was expected; a passed attempt is unexpected when failure was expected.
ANSI-cleaned errors reported for this attempt.
object
Forward-pagination state for the returned page.
object
Opaque cursor for the last returned edge, or null when the page is empty.
Whether another forward page is available after end_cursor.
Example
{ "edges": [ { "node": { "diagnostics": { "status": "available" }, "status": "running", "expected_status": "passed", "run": { "status": "running" }, "attempts": { "data": [ { "status": "running", "expected_status": "passed" } ] } } } ]}Invalid parameters, query, or cursor.
object
object
object
Example
{ "error": { "code": "invalid_request" }}Missing or invalid OAuth bearer token or API key.
object
object
object
Example
{ "error": { "code": "invalid_request" }}The project workspace does not have product access.
object
object
object
Example
{ "error": { "code": "invalid_request" }}The credential lacks the required permission; configuration writes require a Read + write project key.
object
object
object
Example
{ "error": { "code": "invalid_request" }}Configuration conflicts with an existing resource or integration requirements.
object
object
object
Example
{ "error": { "code": "invalid_request" }}Credential or workspace rate limit exceeded.
object
object
object
Example
{ "error": { "code": "invalid_request" }}Headers
Section titled “Headers”Seconds before retrying.
Seconds before retrying.
Internal server error.
object
object
object
Example
{ "error": { "code": "invalid_request" }}Query time limit exceeded. Narrow the run_id or started_at range and retry.
object
object
object
Example
{ "error": { "code": "invalid_request" }}