Skip to content

List grouped test executions

GET
/api/public/v1/projects/{project_id}/test-runs
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>'
project_id
required

ID of a project visible to the authenticated credential.

string
>= 1 characters

ID of a project visible to the authenticated credential.

after

Opaque forward-pagination cursor containing only the active sort key and ID.

string
>= 1 characters

Opaque forward-pagination cursor containing only the active sort key and ID.

first

Number of grouped test executions to return (maximum 100).

integer
default: 50 > 0 <= 100

Number of grouped test executions to return (maximum 100).

query

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.

string
>= 1 characters

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.

sort_by

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.

string
default: started_at
Allowed values: id duration_ms file finished_at started_at title

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_order

Sort direction. ID uses the same direction as the deterministic tie-breaker.

string
default: desc
Allowed values: asc desc

Sort direction. ID uses the same direction as the deterministic tie-breaker.

A forward page of grouped test executions across runs.

Media typeapplication/json
object
edges
required
Array<object>
object
cursor
required
string
node
required

One test execution within a run, including every recorded attempt. Timing and expected status come from the stored per-run test.

object
diagnostics
required

Run-level diagnostic retention state. Expired diagnostics are not evidence that the run reported no logs, steps, or attachments.

object
status
required
string
Allowed values: available pruning pruned
removedAt
required
string | null format: date-time
retentionMonths
required
integer | null
hadDiagnostics
required
boolean
id
required

Per-run test ID (run_test_id), grouping all attempts of one test in one run and Playwright project.

string
status
required

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.

string
Allowed values: running passed failed timed_out skipped interrupted unreported flaky
expected_status
required

Expected status stored for this test in the containing run. Compare with actual status: failed/failed met expectations; passed/failed did not.

string
Allowed values: passed failed skipped
failed
required

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.

boolean
attempt_count
required

Number of recorded attempts, including the initial attempt; matches attempts.data.length.

integer
max_retries
required

Maximum number of retries configured for this test in the run; 0 means no retries.

integer
started_at
required

Stored per-run test start time, normalized to UTC.

string format: date-time
finished_at
required

Stored per-run test finish time in UTC, or null while unfinished or unreported.

string | null format: date-time
duration_ms
required

Stored per-run test duration in milliseconds, or null when unavailable; not recomputed from attempts.

integer | null
playwright_project
required

Playwright project recorded for this execution, or null.

string | null
web_url
required

Browser URL for this test within its run; may require a TestPerch user session.

string format: uri
run
required

Execution-wide context for the reporter run that contains the test execution.

object
branch
required

Source-control branch reported for the run, or null.

string | null
ci_build_id
required

CI provider’s build identifier, or null when not reported.

string | null
ci_provider
required

CI provider name reported for the run, or null.

string | null
duration_ms
required

Reported duration of the entire run in milliseconds, or null when unavailable.

integer | null
environment
required

Project environment matched to the run, or null when none was assigned.

object
label
required

Display label of the matched environment.

string
name
required

Configured name of the matched environment.

string
type
required

Configured environment matching type.

string
finished_at
required

RFC 3339 timestamp reported when the entire run finished, normalized to UTC; null while unfinished or unreported.

string | null format: date-time
git_sha
required

Source-control commit SHA reported for the run, or null.

string | null
id
required

Reporter-run ID. The run is the execution container for many per-run tests, attempts, and shards.

string
partial
required

Whether the reporter marked this run as partial, meaning the run may intentionally omit tests or shards.

boolean
pull_request
required

Pull-request context reported for the run, or null.

object
head_sha
required

Head commit SHA reported for the pull request, or null.

string | null
number
required

Pull-request number reported for the run.

integer
> 0
target_branch
required

Pull-request target branch, or null when not reported.

string | null
repository_url
required

Source repository URL reported for the run, or null.

string | null
started_at
required

RFC 3339 timestamp reported when the entire run started, normalized to UTC.

string format: date-time
status
required

Current or terminal aggregate outcome of the entire run, not the test execution; running is unfinished and unreported means no terminal result was reported.

string
Allowed values: running passed failed timed_out cancelled interrupted unreported
test_definition
required

Stable test identity, latest observed title and file, and current health metadata. Shared by /tests and embedded test definitions.

object
active_issue_types
required

Current unresolved issue types for the test, or null when none are active. Does not determine an execution’s status.

array | null
quarantined_at
required

Creation time of the active quarantine, or null when no quarantine is active. Branch allowances do not change this value.

string | null format: date-time
archived_at
required
string | null format: date-time
created_at
required
string format: date-time
file
required
string
id
required
string
success_rate
required
number | null
<= 100
title
required
string
web_url
required
string format: uri
attempts
required

All recorded attempts ordered by attempt number then ID, including an empty array when none were recorded. No limit or truncation.

object
data
required
Array<object>
object
id
required

Individual attempt ID, used as attempt_id in evidence URLs.

string
attempt
required

Zero-based attempt number; the initial attempt is 0.

integer
status
required
string
Allowed values: running passed failed timed_out skipped interrupted unreported
expected_status
required

Expected status for this attempt. A failed attempt is successful when failed was expected; a passed attempt is unexpected when failure was expected.

string
Allowed values: passed failed skipped
started_at
required
string format: date-time
finished_at
required
string | null format: date-time
duration_ms
required
integer | null
error_messages
required

ANSI-cleaned errors reported for this attempt.

Array<string>
worker_index
required
integer | null
shard
required
object
index
required
integer
> 0
total
required
integer
> 0
page_info
required

Forward-pagination state for the returned page.

object
end_cursor
required

Opaque cursor for the last returned edge, or null when the page is empty.

string | null
has_next_page
required

Whether another forward page is available after end_cursor.

boolean

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.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request conflict diagnostics_expired insufficient_scope unauthorized subscription_required not_found rate_limited query_timeout internal_error onboarding_closed
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid

Example

{
"error": {
"code": "invalid_request"
}
}

Missing or invalid OAuth bearer token or API key.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request conflict diagnostics_expired insufficient_scope unauthorized subscription_required not_found rate_limited query_timeout internal_error onboarding_closed
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid

Example

{
"error": {
"code": "invalid_request"
}
}

The project workspace does not have product access.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request conflict diagnostics_expired insufficient_scope unauthorized subscription_required not_found rate_limited query_timeout internal_error onboarding_closed
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid

Example

{
"error": {
"code": "invalid_request"
}
}

The credential lacks the required permission; configuration writes require a Read + write project key.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request conflict diagnostics_expired insufficient_scope unauthorized subscription_required not_found rate_limited query_timeout internal_error onboarding_closed
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid

Example

{
"error": {
"code": "invalid_request"
}
}

Configuration conflicts with an existing resource or integration requirements.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request conflict diagnostics_expired insufficient_scope unauthorized subscription_required not_found rate_limited query_timeout internal_error onboarding_closed
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid

Example

{
"error": {
"code": "invalid_request"
}
}

Credential or workspace rate limit exceeded.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request conflict diagnostics_expired insufficient_scope unauthorized subscription_required not_found rate_limited query_timeout internal_error onboarding_closed
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid

Example

{
"error": {
"code": "invalid_request"
}
}
Retry-After
required

Seconds before retrying.

integer
> 0

Seconds before retrying.

Internal server error.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request conflict diagnostics_expired insufficient_scope unauthorized subscription_required not_found rate_limited query_timeout internal_error onboarding_closed
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid

Example

{
"error": {
"code": "invalid_request"
}
}

Query time limit exceeded. Narrow the run_id or started_at range and retry.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request conflict diagnostics_expired insufficient_scope unauthorized subscription_required not_found rate_limited query_timeout internal_error onboarding_closed
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid

Example

{
"error": {
"code": "invalid_request"
}
}