Skip to content

Get diagnostic evidence for a grouped test execution

GET
/api/public/v1/projects/{project_id}/test-runs/{run_test_id}
curl --request GET \
--url https://testperch.com/api/public/v1/projects/example/test-runs/example \
--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.

run_test_id
required

Per-run test ID returned as the grouped execution id.

string
>= 1 characters

Per-run test ID returned as the grouped execution id.

Diagnostic evidence for every attempt of one grouped test execution, fitted toward 256 KiB with a 1 MiB hard response ceiling.

Media typeapplication/json

Grouped execution with evidence for every attempt, fitted toward 256 KiB with a 1 MiB hard ceiling. Attempt entries, focus steps, and retrieval links are retained.

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
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
attachments
required
object
data
required

Up to 100 attachments ordered by sequence then ID, retaining the error-context attachment when present.

Array<object>

Artifact attached to the test execution.

object
byte_length
required

Exact artifact payload length in bytes, encoded as a decimal string so values larger than JavaScript’s safe integer remain lossless.

string
/^\d+$/u/
checksum
required

Reporter-supplied SHA-256 checksum of the artifact payload, preserved verbatim; null when none was reported.

string | null
id
required

Attachment event ID for this test attempt; distinct from run, test, per-run test, and attempt IDs.

string
mime_type
required

Reported media type of the artifact payload.

string
name
required

Reporter-provided attachment name.

string
occurred_at
required

RFC 3339 timestamp of the attachment event as reported, normalized to UTC.

string format: date-time
sequence
required

Reporter event sequence used to order attachments within the containing run.

integer
url
required

Path-signed direct artifact download URL. It does not require X-API-Key; possession grants access to that artifact, so treat the full URL as sensitive.

string format: uri
truncated
required

True when additional attachments were omitted by the per-attempt attachment limit.

boolean
error_context
required

Inline, ANSI-cleaned view of the attempt’s error-context attachment and its fetch state.

object
attachment_id
required

ID of the attempt’s attachment named error-context, or null when no such attachment exists.

string | null
status
required

Available means text was fetched; missing means no error-context attachment was reported; unavailable means an attachment exists but could not be fetched.

string
Allowed values: available missing unavailable expired
text
required

UTF-8 error-context text with ANSI escape sequences removed, or null unless status is available.

string | null
truncated
required

True when inline text was shortened by its read limit or the overall diagnostic response budget; url still addresses the complete artifact.

boolean
url
required

Path-signed direct URL for the complete error-context artifact, or null when missing. It does not require X-API-Key; possession grants artifact access, so treat it as sensitive.

string | null format: uri
logs
required

Bounded decoded and ANSI-cleaned logs for the attempt, plus a link to the raw paginated API.

object
data
required

Chronological bounded tail of decoded diagnostic output for the attempt. Older chunks can be omitted when truncated is true.

Array<object>

One decoded, ANSI-cleaned diagnostic output chunk; use raw_url when original bytes and encoding are required.

object
chunk
required

UTF-8 diagnostic text with ANSI escape sequences removed. Base64 raw chunks are decoded; malformed base64 is replaced with an explanatory placeholder.

string
attempt_id
required

ID of the attempt that owns this output chunk.

string
decode_status
required

Decoded means chunk contains decoded, ANSI-cleaned text; malformed_base64 means invalid raw base64 was replaced by a placeholder.

string
Allowed values: decoded malformed_base64
id
required

Reporter output-event ID; distinct from the owning attempt ID.

string
occurred_at
required

RFC 3339 timestamp of the output event as reported, normalized to UTC.

string format: date-time
sequence
required

Reporter event sequence used with id to order output within the containing run.

integer
stream
required

Output stream that produced this chunk: stdout or stderr.

string
Allowed values: stdout stderr
raw_url
required

Public API URL for paginating original stdout/stderr chunks with their raw encoding; null after diagnostic removal starts. Send an X-API-Key authorized for the same project.

string | null format: uri
status
required

Available means inline log storage was read successfully, even when data is empty; unavailable means authoritative storage could not be read and data is empty; expired means the workspace retention policy removed access to diagnostics.

string
Allowed values: available unavailable expired
truncated
required

True when older inline chunks were omitted by the diagnostic log limit or overall response budget; retrieve the complete paginated representation from raw_url.

boolean
steps
required

Curated, potentially non-contiguous step evidence centered on a deterministic focus selection.

object
focus_step_id
required

ID of the selected diagnostic focus node. Normally this is the earliest completed errored step, preferring the deepest step on a timestamp tie; for timeouts or no completed error it is the latest-started step. Null means no focus step is available, including after diagnostic expiration.

string | null
full_url
required

Public API URL for the complete chronological paginated step list; null after diagnostic removal starts. Send an X-API-Key authorized for the same project.

string | null format: uri
data
required

Curated chronological diagnostic subset containing the focus step, its title-path ancestors, nearby preceding context, and up to 25 following steps. The subset can be non-contiguous; use full_url for every step.

Array<object>

One Playwright step belonging to a single test attempt, ordered by started_at and then id.

object
category
required

Playwright step category as reported, or null when absent.

string | null
depth
required

Reporter-provided nesting depth; 0 denotes a top-level step.

integer
duration_ms
required

Reported step duration in milliseconds, or null when the step has not finished.

integer | null
error_message
required

ANSI-cleaned step error message, or null when no step error was reported.

string | null
finished_at
required

RFC 3339 reporter timestamp for step completion, normalized to UTC; null when no finish was reported.

string | null format: date-time
id
required

Step ID within this test attempt. It is also the value referenced by steps.focus_step_id.

string
source_location
required

Playwright-reported source location for the step, not a parsed stack-frame location; null when no file was reported.

object
column
required

Source column reported by Playwright, preserving Playwright’s coordinate semantics; null when omitted.

integer | null
file
required

Reporter-provided source-file path for the step, which may be relative to the test workspace.

string
line
required

Source line reported by Playwright, preserving Playwright’s coordinate semantics; null when omitted.

integer | null
started_at
required

RFC 3339 reporter timestamp for step start, normalized to UTC.

string format: date-time
attempt_id
required

ID of the individual test attempt that owns this step; it matches the attempt_id path parameter.

string
title
required

Reporter-provided display title for the step.

string
title_path
required

Reporter-provided hierarchical title segments from the outermost group through this step.

Array<string>
total_count
required

Total number of steps reported for the attempt before curation.

integer
truncated
required

True when data omits any reported step because of diagnostic curation or response-size fitting; data is not guaranteed to be one contiguous range.

boolean

Example

{
"diagnostics": {
"status": "available"
},
"status": "running",
"expected_status": "passed",
"run": {
"status": "running"
},
"attempts": {
"data": [
{
"status": "running",
"expected_status": "passed",
"error_context": {
"status": "available"
},
"logs": {
"data": [
{
"decode_status": "decoded",
"stream": "stdout"
}
],
"status": "available"
}
}
]
}
}

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"
}
}

The resource does not exist, belongs to a different project, or the attempt does not belong to the requested group.

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"
}
}