Skip to content

List test definitions

GET
/api/public/v1/projects/{project_id}/tests
curl --request GET \
--url 'https://testperch.com/api/public/v1/projects/example/tests?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 tests to return (maximum 100).

integer
default: 50 > 0 <= 100

Number of tests to return (maximum 100).

query

Search expression over id, title, file, created_at, archived_at, quarantined_at, active_issue_types, and success_rate. 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. Supports field-specific operators, at most 10 clauses in total, and 10 nested parentheses levels. Archived tests are excluded unless archived_at appears anywhere in the expression, including in a negated group. Use -quarantined_at:null for currently quarantined tests or quarantined_at:null for tests without active quarantine. Example: (title~“checkout” OR file~“checkout”) AND -(quarantined_at:null OR success_rate:null). Timestamps are integer Unix seconds.

string
>= 1 characters

Search expression over id, title, file, created_at, archived_at, quarantined_at, active_issue_types, and success_rate. 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. Supports field-specific operators, at most 10 clauses in total, and 10 nested parentheses levels. Archived tests are excluded unless archived_at appears anywhere in the expression, including in a negated group. Use -quarantined_at:null for currently quarantined tests or quarantined_at:null for tests without active quarantine. Example: (title~“checkout” OR file~“checkout”) AND -(quarantined_at:null OR success_rate:null). Timestamps are integer Unix seconds.

sort_by

Field used to order tests.

string
default: created_at
Allowed values: id archived_at created_at title file success_rate

Field used to order tests.

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 test definitions.

Media typeapplication/json
object
edges
required
Array<object>
object
cursor
required
string
node
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
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 generated

{
"edges": [
{
"cursor": "example",
"node": {
"active_issue_types": [
"example"
],
"quarantined_at": "2026-04-15T12:00:00Z",
"archived_at": "2026-04-15T12:00:00Z",
"created_at": "2026-04-15T12:00:00Z",
"file": "example",
"id": "example",
"success_rate": 1,
"title": "example",
"web_url": "https://example.com"
}
}
],
"page_info": {
"end_cursor": "example",
"has_next_page": true
}
}

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