> For the complete documentation index, see [llms.txt](https://docs.currents.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.currents.dev/api/resources/test-executions.md). Agents can also search and read this documentation through its [MCP server](https://docs.currents.dev/~gitbook/mcp).

# Test Executions

Query test executions.

A test execution is one test in one spec file execution. List them for a run or for one test across runs, or get one with its artifacts. The list for one test filters by date range, branch, tags, git author, and outcome (`status[]` values use the `RecordedTestOutcome` schema).

## List test executions of a run

> The test executions of a run, in the same shape as \`GET /projects/{projectId}/tests/{signature}/executions\`. A test appears once its result is reported, so a spec file that is still running may not list all of its tests yet. Rows are newest first. To page, pass the \`cursor\` of the last row as \`starting\_after\` for older rows, or the \`cursor\` of the first row as \`ending\_before\` for newer rows.

```json
{"openapi":"3.0.2","info":{"title":"Currents REST API","version":"1.0.0"},"tags":[{"name":"Test executions","description":"Query test executions.\n\nA test execution is one test in one spec file execution. List them for a run\nor for one test across runs, or get one with its artifacts. The list for one test\nfilters by date range, branch, tags, git author, and outcome (`status[]`\nvalues use the `RecordedTestOutcome` schema)."}],"servers":[{"url":"https://api.currents.dev/v1","description":"Production API"},{"url":"https://api-staging.currents.dev/v1","description":"Staging API"},{"url":"http://localhost:4000/v1","description":"Local development"}],"security":[{"BearerAuth":[]},{"OAuth2":["results:read"]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"An organization API key, sent as `Authorization: Bearer <key>`. A key carries one scope for the whole API: a `read` key reaches the GET endpoints, a `write` key reaches all of them. A `crnts_pat_` personal access token is accepted as a Bearer while its owner remains an eligible administrator in its active organization. Each operation requires the corresponding scope stored on that token."},"OAuth2":{"type":"oauth2","description":"An access token from the Currents authorization server, for an application acting as a user in one organization. Unlike an API key it is confined per endpoint: the operation lists the scope it needs, and a token that was not granted that scope gets 403.\n\n**The endpoints below are production's.** They are written out so this specification can be exercised against production, and they are wrong for every other deployment — a token minted by `id.currents.dev` is refused by a staging or on-premise API, whose `OAUTH_ISSUER` and `OAUTH_API_AUDIENCE` are its own. Against anything but production, and in a client generated from this document, discover them instead: `GET {api origin}/.well-known/oauth-protected-resource`, then the `authorization_servers[0]` document.\n\n**The audience named here is the REST API's.** `POST /mcp` is a second resource server on the same origin, identified by `{api origin}/mcp` and described by its own document at `/.well-known/oauth-protected-resource/mcp`. Every operation below refuses a token minted for it, and it refuses every token minted for these, so a client of this specification wants the audience above and not that one.","flows":{"authorizationCode":{"authorizationUrl":"https://id.currents.dev/api/auth/oauth2/authorize","tokenUrl":"https://id.currents.dev/api/auth/oauth2/token","refreshUrl":"https://id.currents.dev/api/auth/oauth2/token","scopes":{"projects:read":"See which projects exist and their names","projects:write":"Change project configuration, including a project's tags","results:read":"See runs, specs and failure detail — errors, stacks and artifacts","analytics:read":"See aggregate metrics: flake and failure rates, error counts, durations and trends","actions:read":"See quarantine and skip rules, and the tests they affect","actions:write":"Create, edit, enable, disable and archive quarantine and skip rules","issues:write":"Create and link issues in a connected issue tracker, and list its projects and issue types","runs:write":"Cancel and reset runs, and permanently delete runs and their artifacts","webhooks:read":"See webhook configuration, including destination URLs and headers","webhooks:write":"Create, edit and delete webhooks","shares:write":"Create public links to test results that anyone with the link can open until they expire"}}}}},"parameters":{"RunIdPath":{"name":"runId","in":"path","required":true,"description":"The run ID","schema":{"type":"string"}},"TestExecutionsLimitQuery":{"name":"limit","in":"query","required":false,"description":"Maximum number of items to return (default: 10, max: 100)","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},"StartingAfterQuery":{"name":"starting_after","in":"query","required":false,"description":"Cursor for the next page: the `cursor` of the last item on the current page. Returns the items after it in the list's sort order: older items on a list sorted newest first, newer items on a list sorted oldest first.","schema":{"type":"string"}},"EndingBeforeQuery":{"name":"ending_before","in":"query","required":false,"description":"Cursor for the previous page: the `cursor` of the first item on the current page. Returns the items before it in the list's sort order: newer items on a list sorted newest first, older items on a list sorted oldest first.","schema":{"type":"string"}},"GroupsQuery":{"name":"groups[]","in":"query","required":false,"description":"Filter by groups (can be specified multiple times using bracket notation, e.g., groups[]=group1&groups[]=group2)","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true}},"schemas":{"RecordedTestOutcome":{"type":"string","description":"Final per-test outcome stored in Currents.\n\n- **passed** — Runner reported success.\n- **failed** — Runner reported failure (assertions, errors, timeouts, etc.).\n- **pending** — Intentional skip or disabled test (e.g. `test.skip()` / `it.skip()`). In `GET /projects/{projectId}/tests` this increments `metrics.ignored` and does **not** increment `metrics.failures`.\n- **skipped** — Runner reported a skip without a normal pass/fail (often interrupted or never executed as pass/fail). In `GET /projects/{projectId}/tests` this increments `metrics.failures` together with `failed` (there is no separate `skipped` counter in that response). On **run and spec** payloads, `stats.skipped` is still reported separately from `stats.failures` and `stats.pending`.","enum":["passed","failed","pending","skipped"]},"TestExecutionListResponse":{"type":"object","required":["status","has_more","data"],"properties":{"status":{"type":"string","enum":["OK"]},"has_more":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/TestExecutionListItem"}}}},"TestExecutionListItem":{"type":"object","properties":{"cursor":{"type":"string"},"signature":{"type":"string","description":"Test signature, as returned by `POST /signature/test` and listed by `GET /projects/{projectId}/tests`."},"framework":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"projectId":{"type":"string"},"groupId":{"type":"string"},"runId":{"type":"string"},"instanceId":{"type":"string"},"spec":{"type":"string"},"specSignature":{"type":"string","description":"Signature of the spec file: the `signature` of the spec file execution, for `GET /projects/{projectId}/spec-files/{signature}/executions`."},"machineId":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"title":{"type":"array","items":{"type":"string"}},"testId":{"type":"string"},"displayError":{"type":"string","nullable":true},"commit":{"type":"object","properties":{"branch":{"type":"string"},"authorEmail":{"type":"string"},"authorName":{"type":"string"},"sha":{"type":"string"},"message":{"type":"string"}}},"duration":{"type":"integer"},"flaky":{"type":"boolean"},"expectedStatus":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/RecordedTestOutcome"},"attempts":{"type":"array","items":{"type":"object","properties":{"attemptId":{"type":"string"},"state":{"type":"string"},"error":{"type":"object","nullable":true,"properties":{"message":{"type":"string"},"stack":{"type":"string"},"location":{"type":"object"}}},"startedAt":{"type":"string","format":"date-time"},"duration":{"type":"integer"}}}},"annotations":{"type":"array","nullable":true,"items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"}}}}}},"ErrorResponse":{"type":"object","required":["status","error"],"properties":{"status":{"type":"string","enum":["FAILED"]},"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Stable machine-readable discriminator, present on refusals a client is expected to branch on (for example `AI_CONSENT_REQUIRED`). The `error` text is free-form; branch on `code`."},"candidates":{"type":"array","description":"With `code: ambiguous_target`: the runs, spec files or tests the request matched. Send one of their IDs.","items":{"type":"object","properties":{"runId":{"type":"string"},"ciBuildId":{"type":"string"},"instanceId":{"type":"string"},"groupId":{"type":"string"},"spec":{"type":"string"},"machineId":{"type":"string","nullable":true},"testId":{"type":"string"},"title":{"type":"array","items":{"type":"string"}}}}}}}},"responses":{"BadRequest":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"The credential authenticated but is not permitted to use this endpoint. Five refusals share the status: a `read` API key on an endpoint that writes, an OAuth token that was not granted the scope the endpoint needs (`insufficient_scope`), an OAuth token that was granted it but whose holder no longer has a role permitting it (`insufficient_role`), an OAuth token on an endpoint that accepts an API key and nothing else (`api_key_required`), and an API key on an endpoint that answers for a user (`user_credential_required`). Discriminate on `code` rather than on the message, which is free-form. The first refusal predates the codes and sets none. Only `insufficient_scope` carries the challenge header, because it is the only one a client can act on by re-authorizing.","headers":{"WWW-Authenticate":{"description":"Present on the `insufficient_scope` refusal only, naming the scope to re-authorize for (RFC 6750 3.1): `Bearer error=\"insufficient_scope\", scope=\"webhooks:read\"`. Absent on `insufficient_role`, where the scope is already granted, and on `api_key_required` and `user_credential_required`, where no scope would help.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"The credential or organization went over a rate limit. Limits per minute, per credential and per organization: 1,000 and 2,000 for `GET /test-results/{signature}`, `GET /projects/{projectId}/tests/{signature}/executions` and `POST /instances/{instanceId}/trace-link`; 1,000 and 2,000 for `GET /instances/{instanceId}` and `GET /projects/{projectId}/spec-files/{signature}/executions`; 3,000 and 6,000 for `POST /signature/test` and `POST /signature/spec`; 200 and 400 for `GET /projects/{projectId}/tests`, `/spec-files` and `/errors` with their `/metrics` and `/{signature}`, and `GET` on `/tests/{projectId}`, `/errors/{projectId}` and `/spec-files/{projectId}`; 600 and 1,200 for other `GET` requests on `/projects/...` and `POST /projects/{projectId}/test-issues`; 600 and 1,200 for other `GET` requests, including `GET /instances/{instanceId}/test-executions/{testId}`; 300 and 600 for other `POST` requests and for `PUT`, `PATCH` and `DELETE` requests.","headers":{"Retry-After":{"description":"Seconds until the limit resets","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/runs/{runId}/test-executions":{"get":{"summary":"List test executions of a run","description":"The test executions of a run, in the same shape as `GET /projects/{projectId}/tests/{signature}/executions`. A test appears once its result is reported, so a spec file that is still running may not list all of its tests yet. Rows are newest first. To page, pass the `cursor` of the last row as `starting_after` for older rows, or the `cursor` of the first row as `ending_before` for newer rows.","operationId":"listRunTestExecutions","tags":["Test executions"],"parameters":[{"$ref":"#/components/parameters/RunIdPath"},{"$ref":"#/components/parameters/TestExecutionsLimitQuery"},{"$ref":"#/components/parameters/StartingAfterQuery"},{"$ref":"#/components/parameters/EndingBeforeQuery"},{"name":"status[]","in":"query","required":false,"description":"Filter by outcome(s). Each value is a `RecordedTestOutcome` (see schemas). Multiple values OR together.","schema":{"type":"array","items":{"$ref":"#/components/schemas/RecordedTestOutcome"}},"style":"form","explode":true},{"name":"include_flaky","in":"query","required":false,"description":"With `status[]`, also return flaky executions whatever their status, as on `GET /context`. Has no effect without `status[]`.","schema":{"type":"boolean","default":false}},{"name":"flaky","in":"query","required":false,"description":"When true, return only flaky executions; when false, only executions that are not flaky. Combines with the other filters using AND.","schema":{"type":"boolean"}},{"name":"instance_id","in":"query","required":false,"description":"Return only the tests of one spec file execution (`instanceId`) of the run.","schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/GroupsQuery"},{"name":"spec","in":"query","required":false,"description":"Filter by spec file path (case-insensitive partial match)","schema":{"type":"string","minLength":1,"maxLength":500}},{"name":"title","in":"query","required":false,"description":"Filter by test title (case-insensitive partial match on any part of the title path: a describe block or the test name)","schema":{"type":"string","minLength":1,"maxLength":500}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestExecutionListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"413":{"description":"Payload Too Large - Response size exceeds limits. Use Accept-Encoding: gzip header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Unexpected server error, for example a database timeout. The request reads only, so it is safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Create a trace link

> Creates a link to the Playwright trace of one test attempt in the spec file execution. \`GET \<url>\` opens the trace in a player, and \`GET \<url>/digest?format=md\` returns a text summary of what the attempt did; the link also reads frames, DOM snapshots and network requests without downloading the trace zip. Anyone with the link can read the trace until \`expiresAt\`. Writes nothing to the test results.

```json
{"openapi":"3.0.2","info":{"title":"Currents REST API","version":"1.0.0"},"tags":[{"name":"Test executions","description":"Query test executions.\n\nA test execution is one test in one spec file execution. List them for a run\nor for one test across runs, or get one with its artifacts. The list for one test\nfilters by date range, branch, tags, git author, and outcome (`status[]`\nvalues use the `RecordedTestOutcome` schema)."}],"servers":[{"url":"https://api.currents.dev/v1","description":"Production API"},{"url":"https://api-staging.currents.dev/v1","description":"Staging API"},{"url":"http://localhost:4000/v1","description":"Local development"}],"security":[{"BearerAuth":[]},{"OAuth2":["results:read"]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"An organization API key, sent as `Authorization: Bearer <key>`. A key carries one scope for the whole API: a `read` key reaches the GET endpoints, a `write` key reaches all of them. A `crnts_pat_` personal access token is accepted as a Bearer while its owner remains an eligible administrator in its active organization. Each operation requires the corresponding scope stored on that token."},"OAuth2":{"type":"oauth2","description":"An access token from the Currents authorization server, for an application acting as a user in one organization. Unlike an API key it is confined per endpoint: the operation lists the scope it needs, and a token that was not granted that scope gets 403.\n\n**The endpoints below are production's.** They are written out so this specification can be exercised against production, and they are wrong for every other deployment — a token minted by `id.currents.dev` is refused by a staging or on-premise API, whose `OAUTH_ISSUER` and `OAUTH_API_AUDIENCE` are its own. Against anything but production, and in a client generated from this document, discover them instead: `GET {api origin}/.well-known/oauth-protected-resource`, then the `authorization_servers[0]` document.\n\n**The audience named here is the REST API's.** `POST /mcp` is a second resource server on the same origin, identified by `{api origin}/mcp` and described by its own document at `/.well-known/oauth-protected-resource/mcp`. Every operation below refuses a token minted for it, and it refuses every token minted for these, so a client of this specification wants the audience above and not that one.","flows":{"authorizationCode":{"authorizationUrl":"https://id.currents.dev/api/auth/oauth2/authorize","tokenUrl":"https://id.currents.dev/api/auth/oauth2/token","refreshUrl":"https://id.currents.dev/api/auth/oauth2/token","scopes":{"projects:read":"See which projects exist and their names","projects:write":"Change project configuration, including a project's tags","results:read":"See runs, specs and failure detail — errors, stacks and artifacts","analytics:read":"See aggregate metrics: flake and failure rates, error counts, durations and trends","actions:read":"See quarantine and skip rules, and the tests they affect","actions:write":"Create, edit, enable, disable and archive quarantine and skip rules","issues:write":"Create and link issues in a connected issue tracker, and list its projects and issue types","runs:write":"Cancel and reset runs, and permanently delete runs and their artifacts","webhooks:read":"See webhook configuration, including destination URLs and headers","webhooks:write":"Create, edit and delete webhooks","shares:write":"Create public links to test results that anyone with the link can open until they expire"}}}}},"parameters":{"InstanceIdPath":{"name":"instanceId","in":"path","required":true,"description":"The spec file execution ID","schema":{"type":"string"}}},"responses":{"BadRequest":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"The credential authenticated but is not permitted to use this endpoint. Five refusals share the status: a `read` API key on an endpoint that writes, an OAuth token that was not granted the scope the endpoint needs (`insufficient_scope`), an OAuth token that was granted it but whose holder no longer has a role permitting it (`insufficient_role`), an OAuth token on an endpoint that accepts an API key and nothing else (`api_key_required`), and an API key on an endpoint that answers for a user (`user_credential_required`). Discriminate on `code` rather than on the message, which is free-form. The first refusal predates the codes and sets none. Only `insufficient_scope` carries the challenge header, because it is the only one a client can act on by re-authorizing.","headers":{"WWW-Authenticate":{"description":"Present on the `insufficient_scope` refusal only, naming the scope to re-authorize for (RFC 6750 3.1): `Bearer error=\"insufficient_scope\", scope=\"webhooks:read\"`. Absent on `insufficient_role`, where the scope is already granted, and on `api_key_required` and `user_credential_required`, where no scope would help.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"The credential or organization went over a rate limit. Limits per minute, per credential and per organization: 1,000 and 2,000 for `GET /test-results/{signature}`, `GET /projects/{projectId}/tests/{signature}/executions` and `POST /instances/{instanceId}/trace-link`; 1,000 and 2,000 for `GET /instances/{instanceId}` and `GET /projects/{projectId}/spec-files/{signature}/executions`; 3,000 and 6,000 for `POST /signature/test` and `POST /signature/spec`; 200 and 400 for `GET /projects/{projectId}/tests`, `/spec-files` and `/errors` with their `/metrics` and `/{signature}`, and `GET` on `/tests/{projectId}`, `/errors/{projectId}` and `/spec-files/{projectId}`; 600 and 1,200 for other `GET` requests on `/projects/...` and `POST /projects/{projectId}/test-issues`; 600 and 1,200 for other `GET` requests, including `GET /instances/{instanceId}/test-executions/{testId}`; 300 and 600 for other `POST` requests and for `PUT`, `PATCH` and `DELETE` requests.","headers":{"Retry-After":{"description":"Seconds until the limit resets","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","required":["status","error"],"properties":{"status":{"type":"string","enum":["FAILED"]},"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Stable machine-readable discriminator, present on refusals a client is expected to branch on (for example `AI_CONSENT_REQUIRED`). The `error` text is free-form; branch on `code`."},"candidates":{"type":"array","description":"With `code: ambiguous_target`: the runs, spec files or tests the request matched. Send one of their IDs.","items":{"type":"object","properties":{"runId":{"type":"string"},"ciBuildId":{"type":"string"},"instanceId":{"type":"string"},"groupId":{"type":"string"},"spec":{"type":"string"},"machineId":{"type":"string","nullable":true},"testId":{"type":"string"},"title":{"type":"array","items":{"type":"string"}}}}}}}}},"paths":{"/instances/{instanceId}/trace-link":{"post":{"summary":"Create a trace link","description":"Creates a link to the Playwright trace of one test attempt in the spec file execution. `GET <url>` opens the trace in a player, and `GET <url>/digest?format=md` returns a text summary of what the attempt did; the link also reads frames, DOM snapshots and network requests without downloading the trace zip. Anyone with the link can read the trace until `expiresAt`. Writes nothing to the test results.","operationId":"createTraceLink","tags":["Test executions"],"parameters":[{"$ref":"#/components/parameters/InstanceIdPath"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["testId"],"properties":{"testId":{"type":"string","minLength":1,"description":"The test ID within the spec file execution"},"attemptIndex":{"type":"integer","minimum":0,"description":"The attempt, from 0. Without it, the last attempt that has a trace."},"artifactName":{"type":"string","minLength":1,"maxLength":1024,"description":"Picks one of several traces of the attempt by name. A trace uploaded as a test attachment is found only by its attachment name or file name."},"ttlSeconds":{"type":"integer","minimum":60,"maximum":604800,"default":86400,"description":"How long the link works, in seconds"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","required":["status","data"],"properties":{"status":{"type":"string","enum":["OK"]},"data":{"type":"object","required":["url","expiresAt","testId","attemptIndex"],"properties":{"url":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"},"testId":{"type":"string"},"attemptIndex":{"type":"integer","description":"The attempt the trace belongs to"}}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"The spec file execution is not in the organization, or the test attempt has no trace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Trace links are not set up on this installation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get test execution

> One test execution in a spec file execution: the fields of a \`GET /projects/{projectId}/tests/{signature}/executions\` item, plus the screenshots, videos, Playwright traces and attachments recorded for the test, with signed URLs. Cypress records one video for the whole spec file; it is \`results.videoUrl\` on \`GET /instances/{instanceId}\` and is not listed here.

```json
{"openapi":"3.0.2","info":{"title":"Currents REST API","version":"1.0.0"},"tags":[{"name":"Test executions","description":"Query test executions.\n\nA test execution is one test in one spec file execution. List them for a run\nor for one test across runs, or get one with its artifacts. The list for one test\nfilters by date range, branch, tags, git author, and outcome (`status[]`\nvalues use the `RecordedTestOutcome` schema)."}],"servers":[{"url":"https://api.currents.dev/v1","description":"Production API"},{"url":"https://api-staging.currents.dev/v1","description":"Staging API"},{"url":"http://localhost:4000/v1","description":"Local development"}],"security":[{"BearerAuth":[]},{"OAuth2":["results:read"]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"An organization API key, sent as `Authorization: Bearer <key>`. A key carries one scope for the whole API: a `read` key reaches the GET endpoints, a `write` key reaches all of them. A `crnts_pat_` personal access token is accepted as a Bearer while its owner remains an eligible administrator in its active organization. Each operation requires the corresponding scope stored on that token."},"OAuth2":{"type":"oauth2","description":"An access token from the Currents authorization server, for an application acting as a user in one organization. Unlike an API key it is confined per endpoint: the operation lists the scope it needs, and a token that was not granted that scope gets 403.\n\n**The endpoints below are production's.** They are written out so this specification can be exercised against production, and they are wrong for every other deployment — a token minted by `id.currents.dev` is refused by a staging or on-premise API, whose `OAUTH_ISSUER` and `OAUTH_API_AUDIENCE` are its own. Against anything but production, and in a client generated from this document, discover them instead: `GET {api origin}/.well-known/oauth-protected-resource`, then the `authorization_servers[0]` document.\n\n**The audience named here is the REST API's.** `POST /mcp` is a second resource server on the same origin, identified by `{api origin}/mcp` and described by its own document at `/.well-known/oauth-protected-resource/mcp`. Every operation below refuses a token minted for it, and it refuses every token minted for these, so a client of this specification wants the audience above and not that one.","flows":{"authorizationCode":{"authorizationUrl":"https://id.currents.dev/api/auth/oauth2/authorize","tokenUrl":"https://id.currents.dev/api/auth/oauth2/token","refreshUrl":"https://id.currents.dev/api/auth/oauth2/token","scopes":{"projects:read":"See which projects exist and their names","projects:write":"Change project configuration, including a project's tags","results:read":"See runs, specs and failure detail — errors, stacks and artifacts","analytics:read":"See aggregate metrics: flake and failure rates, error counts, durations and trends","actions:read":"See quarantine and skip rules, and the tests they affect","actions:write":"Create, edit, enable, disable and archive quarantine and skip rules","issues:write":"Create and link issues in a connected issue tracker, and list its projects and issue types","runs:write":"Cancel and reset runs, and permanently delete runs and their artifacts","webhooks:read":"See webhook configuration, including destination URLs and headers","webhooks:write":"Create, edit and delete webhooks","shares:write":"Create public links to test results that anyone with the link can open until they expire"}}}}},"parameters":{"InstanceIdPath":{"name":"instanceId","in":"path","required":true,"description":"The spec file execution ID","schema":{"type":"string"}}},"schemas":{"TestExecutionResponse":{"type":"object","required":["status","data"],"properties":{"status":{"type":"string","enum":["OK"]},"data":{"$ref":"#/components/schemas/TestExecution"}}},"TestExecution":{"allOf":[{"$ref":"#/components/schemas/TestExecutionListItem"},{"type":"object","required":["artifacts"],"properties":{"artifacts":{"type":"object","required":["expiresAt","screenshots","videos","traces","attachments"],"properties":{"expiresAt":{"type":"string","format":"date-time","description":"When the signed URLs below stop working"},"screenshots":{"type":"array","items":{"type":"object","properties":{"screenshotId":{"type":"string"},"name":{"type":"string","nullable":true},"testAttemptIndex":{"type":"integer"},"takenAt":{"type":"string","format":"date-time"},"screenshotURL":{"type":"string"}}}},"videos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"testAttemptIndex":{"type":"integer"},"videoUrl":{"type":"string"}}}},"traces":{"type":"array","items":{"type":"object","properties":{"traceId":{"type":"string"},"name":{"type":"string","nullable":true},"testAttemptIndex":{"type":"integer"},"traceURL":{"type":"string"}}}},"attachments":{"type":"array","description":"Files attached to the test, by the reporter (for example Playwright `testInfo.attach`) or with `POST /runs/{runId}/attachments`. A trace attached under a custom name is listed here, not in `traces`.","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"filename":{"type":"string","nullable":true},"contentType":{"type":"string"},"testAttemptIndex":{"type":"integer"},"readUrl":{"type":"string"}}}}}}}}]},"TestExecutionListItem":{"type":"object","properties":{"cursor":{"type":"string"},"signature":{"type":"string","description":"Test signature, as returned by `POST /signature/test` and listed by `GET /projects/{projectId}/tests`."},"framework":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"projectId":{"type":"string"},"groupId":{"type":"string"},"runId":{"type":"string"},"instanceId":{"type":"string"},"spec":{"type":"string"},"specSignature":{"type":"string","description":"Signature of the spec file: the `signature` of the spec file execution, for `GET /projects/{projectId}/spec-files/{signature}/executions`."},"machineId":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"title":{"type":"array","items":{"type":"string"}},"testId":{"type":"string"},"displayError":{"type":"string","nullable":true},"commit":{"type":"object","properties":{"branch":{"type":"string"},"authorEmail":{"type":"string"},"authorName":{"type":"string"},"sha":{"type":"string"},"message":{"type":"string"}}},"duration":{"type":"integer"},"flaky":{"type":"boolean"},"expectedStatus":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/RecordedTestOutcome"},"attempts":{"type":"array","items":{"type":"object","properties":{"attemptId":{"type":"string"},"state":{"type":"string"},"error":{"type":"object","nullable":true,"properties":{"message":{"type":"string"},"stack":{"type":"string"},"location":{"type":"object"}}},"startedAt":{"type":"string","format":"date-time"},"duration":{"type":"integer"}}}},"annotations":{"type":"array","nullable":true,"items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"}}}}}},"RecordedTestOutcome":{"type":"string","description":"Final per-test outcome stored in Currents.\n\n- **passed** — Runner reported success.\n- **failed** — Runner reported failure (assertions, errors, timeouts, etc.).\n- **pending** — Intentional skip or disabled test (e.g. `test.skip()` / `it.skip()`). In `GET /projects/{projectId}/tests` this increments `metrics.ignored` and does **not** increment `metrics.failures`.\n- **skipped** — Runner reported a skip without a normal pass/fail (often interrupted or never executed as pass/fail). In `GET /projects/{projectId}/tests` this increments `metrics.failures` together with `failed` (there is no separate `skipped` counter in that response). On **run and spec** payloads, `stats.skipped` is still reported separately from `stats.failures` and `stats.pending`.","enum":["passed","failed","pending","skipped"]},"ErrorResponse":{"type":"object","required":["status","error"],"properties":{"status":{"type":"string","enum":["FAILED"]},"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Stable machine-readable discriminator, present on refusals a client is expected to branch on (for example `AI_CONSENT_REQUIRED`). The `error` text is free-form; branch on `code`."},"candidates":{"type":"array","description":"With `code: ambiguous_target`: the runs, spec files or tests the request matched. Send one of their IDs.","items":{"type":"object","properties":{"runId":{"type":"string"},"ciBuildId":{"type":"string"},"instanceId":{"type":"string"},"groupId":{"type":"string"},"spec":{"type":"string"},"machineId":{"type":"string","nullable":true},"testId":{"type":"string"},"title":{"type":"array","items":{"type":"string"}}}}}}}},"responses":{"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"The credential authenticated but is not permitted to use this endpoint. Five refusals share the status: a `read` API key on an endpoint that writes, an OAuth token that was not granted the scope the endpoint needs (`insufficient_scope`), an OAuth token that was granted it but whose holder no longer has a role permitting it (`insufficient_role`), an OAuth token on an endpoint that accepts an API key and nothing else (`api_key_required`), and an API key on an endpoint that answers for a user (`user_credential_required`). Discriminate on `code` rather than on the message, which is free-form. The first refusal predates the codes and sets none. Only `insufficient_scope` carries the challenge header, because it is the only one a client can act on by re-authorizing.","headers":{"WWW-Authenticate":{"description":"Present on the `insufficient_scope` refusal only, naming the scope to re-authorize for (RFC 6750 3.1): `Bearer error=\"insufficient_scope\", scope=\"webhooks:read\"`. Absent on `insufficient_role`, where the scope is already granted, and on `api_key_required` and `user_credential_required`, where no scope would help.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"The credential or organization went over a rate limit. Limits per minute, per credential and per organization: 1,000 and 2,000 for `GET /test-results/{signature}`, `GET /projects/{projectId}/tests/{signature}/executions` and `POST /instances/{instanceId}/trace-link`; 1,000 and 2,000 for `GET /instances/{instanceId}` and `GET /projects/{projectId}/spec-files/{signature}/executions`; 3,000 and 6,000 for `POST /signature/test` and `POST /signature/spec`; 200 and 400 for `GET /projects/{projectId}/tests`, `/spec-files` and `/errors` with their `/metrics` and `/{signature}`, and `GET` on `/tests/{projectId}`, `/errors/{projectId}` and `/spec-files/{projectId}`; 600 and 1,200 for other `GET` requests on `/projects/...` and `POST /projects/{projectId}/test-issues`; 600 and 1,200 for other `GET` requests, including `GET /instances/{instanceId}/test-executions/{testId}`; 300 and 600 for other `POST` requests and for `PUT`, `PATCH` and `DELETE` requests.","headers":{"Retry-After":{"description":"Seconds until the limit resets","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/instances/{instanceId}/test-executions/{testId}":{"get":{"summary":"Get test execution","description":"One test execution in a spec file execution: the fields of a `GET /projects/{projectId}/tests/{signature}/executions` item, plus the screenshots, videos, Playwright traces and attachments recorded for the test, with signed URLs. Cypress records one video for the whole spec file; it is `results.videoUrl` on `GET /instances/{instanceId}` and is not listed here.","operationId":"getTestExecution","tags":["Test executions"],"parameters":[{"$ref":"#/components/parameters/InstanceIdPath"},{"name":"testId","in":"path","required":true,"description":"The test ID within the spec file execution","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestExecutionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"413":{"description":"Payload Too Large - Response size exceeds limits. Use Accept-Encoding: gzip header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}}}}
```

## List test executions of a test

> Deprecated. Use \`GET /projects/{projectId}/tests/{signature}/executions\` instead. It takes the same query parameters and returns the same response. The executions of one test, by test signature. Rows are newest first. To page, pass the \`cursor\` of the last row as \`starting\_after\` for older rows, or the \`cursor\` of the first row as \`ending\_before\` for newer rows.

```json
{"openapi":"3.0.2","info":{"title":"Currents REST API","version":"1.0.0"},"tags":[{"name":"Test executions","description":"Query test executions.\n\nA test execution is one test in one spec file execution. List them for a run\nor for one test across runs, or get one with its artifacts. The list for one test\nfilters by date range, branch, tags, git author, and outcome (`status[]`\nvalues use the `RecordedTestOutcome` schema)."}],"servers":[{"url":"https://api.currents.dev/v1","description":"Production API"},{"url":"https://api-staging.currents.dev/v1","description":"Staging API"},{"url":"http://localhost:4000/v1","description":"Local development"}],"security":[{"BearerAuth":[]},{"OAuth2":["results:read"]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"An organization API key, sent as `Authorization: Bearer <key>`. A key carries one scope for the whole API: a `read` key reaches the GET endpoints, a `write` key reaches all of them. A `crnts_pat_` personal access token is accepted as a Bearer while its owner remains an eligible administrator in its active organization. Each operation requires the corresponding scope stored on that token."},"OAuth2":{"type":"oauth2","description":"An access token from the Currents authorization server, for an application acting as a user in one organization. Unlike an API key it is confined per endpoint: the operation lists the scope it needs, and a token that was not granted that scope gets 403.\n\n**The endpoints below are production's.** They are written out so this specification can be exercised against production, and they are wrong for every other deployment — a token minted by `id.currents.dev` is refused by a staging or on-premise API, whose `OAUTH_ISSUER` and `OAUTH_API_AUDIENCE` are its own. Against anything but production, and in a client generated from this document, discover them instead: `GET {api origin}/.well-known/oauth-protected-resource`, then the `authorization_servers[0]` document.\n\n**The audience named here is the REST API's.** `POST /mcp` is a second resource server on the same origin, identified by `{api origin}/mcp` and described by its own document at `/.well-known/oauth-protected-resource/mcp`. Every operation below refuses a token minted for it, and it refuses every token minted for these, so a client of this specification wants the audience above and not that one.","flows":{"authorizationCode":{"authorizationUrl":"https://id.currents.dev/api/auth/oauth2/authorize","tokenUrl":"https://id.currents.dev/api/auth/oauth2/token","refreshUrl":"https://id.currents.dev/api/auth/oauth2/token","scopes":{"projects:read":"See which projects exist and their names","projects:write":"Change project configuration, including a project's tags","results:read":"See runs, specs and failure detail — errors, stacks and artifacts","analytics:read":"See aggregate metrics: flake and failure rates, error counts, durations and trends","actions:read":"See quarantine and skip rules, and the tests they affect","actions:write":"Create, edit, enable, disable and archive quarantine and skip rules","issues:write":"Create and link issues in a connected issue tracker, and list its projects and issue types","runs:write":"Cancel and reset runs, and permanently delete runs and their artifacts","webhooks:read":"See webhook configuration, including destination URLs and headers","webhooks:write":"Create, edit and delete webhooks","shares:write":"Create public links to test results that anyone with the link can open until they expire"}}}}},"parameters":{"SignaturePath":{"name":"signature","in":"path","required":true,"description":"Test signature, as returned by `POST /signature/test` and listed by `GET /projects/{projectId}/tests`.","schema":{"type":"string"}},"DateStartQuery":{"name":"date_start","in":"query","required":true,"description":"Start date in ISO 8601 format","schema":{"type":"string","format":"date-time"}},"TestExecutionsLimitQuery":{"name":"limit","in":"query","required":false,"description":"Maximum number of items to return (default: 10, max: 100)","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},"StartingAfterQuery":{"name":"starting_after","in":"query","required":false,"description":"Cursor for the next page: the `cursor` of the last item on the current page. Returns the items after it in the list's sort order: older items on a list sorted newest first, newer items on a list sorted oldest first.","schema":{"type":"string"}},"EndingBeforeQuery":{"name":"ending_before","in":"query","required":false,"description":"Cursor for the previous page: the `cursor` of the first item on the current page. Returns the items before it in the list's sort order: newer items on a list sorted newest first, older items on a list sorted oldest first.","schema":{"type":"string"}},"TagsQuery":{"name":"tags[]","in":"query","required":false,"description":"Filter by tags (can be specified multiple times using bracket notation, e.g., tags[]=value1&tags[]=value2)","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true},"BranchesQuery":{"name":"branches[]","in":"query","required":false,"description":"Filter by git branch. Use trailing `*` for prefix match (e.g. `release/*`). Max 250 characters per value.","schema":{"type":"array","items":{"$ref":"#/components/schemas/BranchFilterQueryValue"}},"style":"form","explode":true},"AuthorsQuery":{"name":"authors[]","in":"query","required":false,"description":"Filter by git authors (can be specified multiple times using bracket notation, e.g., authors[]=author1&authors[]=author2)","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true},"GroupsQuery":{"name":"groups[]","in":"query","required":false,"description":"Filter by groups (can be specified multiple times using bracket notation, e.g., groups[]=group1&groups[]=group2)","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true},"EnvironmentsQuery":{"name":"environments[]","in":"query","required":false,"description":"Filter by environment (can be specified multiple times using bracket notation, e.g., environments[]=staging&environments[]=production)","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true}},"schemas":{"BranchFilterQueryValue":{"description":"Branch filter value: an exact branch name, or a trailing `*` for prefix match (e.g. `release/*`). Max 250 characters.","oneOf":[{"type":"string","description":"Exact branch name (must not contain `*` or spaces).","pattern":"^[!-)+-~]+$","maxLength":250},{"type":"string","description":"Prefix match: branch prefix followed by `*`.","pattern":"^[!-)+-~]+\\*$","maxLength":250}]},"RecordedTestOutcome":{"type":"string","description":"Final per-test outcome stored in Currents.\n\n- **passed** — Runner reported success.\n- **failed** — Runner reported failure (assertions, errors, timeouts, etc.).\n- **pending** — Intentional skip or disabled test (e.g. `test.skip()` / `it.skip()`). In `GET /projects/{projectId}/tests` this increments `metrics.ignored` and does **not** increment `metrics.failures`.\n- **skipped** — Runner reported a skip without a normal pass/fail (often interrupted or never executed as pass/fail). In `GET /projects/{projectId}/tests` this increments `metrics.failures` together with `failed` (there is no separate `skipped` counter in that response). On **run and spec** payloads, `stats.skipped` is still reported separately from `stats.failures` and `stats.pending`.","enum":["passed","failed","pending","skipped"]},"TestExecutionListResponse":{"type":"object","required":["status","has_more","data"],"properties":{"status":{"type":"string","enum":["OK"]},"has_more":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/TestExecutionListItem"}}}},"TestExecutionListItem":{"type":"object","properties":{"cursor":{"type":"string"},"signature":{"type":"string","description":"Test signature, as returned by `POST /signature/test` and listed by `GET /projects/{projectId}/tests`."},"framework":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"projectId":{"type":"string"},"groupId":{"type":"string"},"runId":{"type":"string"},"instanceId":{"type":"string"},"spec":{"type":"string"},"specSignature":{"type":"string","description":"Signature of the spec file: the `signature` of the spec file execution, for `GET /projects/{projectId}/spec-files/{signature}/executions`."},"machineId":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"title":{"type":"array","items":{"type":"string"}},"testId":{"type":"string"},"displayError":{"type":"string","nullable":true},"commit":{"type":"object","properties":{"branch":{"type":"string"},"authorEmail":{"type":"string"},"authorName":{"type":"string"},"sha":{"type":"string"},"message":{"type":"string"}}},"duration":{"type":"integer"},"flaky":{"type":"boolean"},"expectedStatus":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/RecordedTestOutcome"},"attempts":{"type":"array","items":{"type":"object","properties":{"attemptId":{"type":"string"},"state":{"type":"string"},"error":{"type":"object","nullable":true,"properties":{"message":{"type":"string"},"stack":{"type":"string"},"location":{"type":"object"}}},"startedAt":{"type":"string","format":"date-time"},"duration":{"type":"integer"}}}},"annotations":{"type":"array","nullable":true,"items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"}}}}}},"ErrorResponse":{"type":"object","required":["status","error"],"properties":{"status":{"type":"string","enum":["FAILED"]},"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Stable machine-readable discriminator, present on refusals a client is expected to branch on (for example `AI_CONSENT_REQUIRED`). The `error` text is free-form; branch on `code`."},"candidates":{"type":"array","description":"With `code: ambiguous_target`: the runs, spec files or tests the request matched. Send one of their IDs.","items":{"type":"object","properties":{"runId":{"type":"string"},"ciBuildId":{"type":"string"},"instanceId":{"type":"string"},"groupId":{"type":"string"},"spec":{"type":"string"},"machineId":{"type":"string","nullable":true},"testId":{"type":"string"},"title":{"type":"array","items":{"type":"string"}}}}}}}},"responses":{"BadRequest":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"The credential authenticated but is not permitted to use this endpoint. Five refusals share the status: a `read` API key on an endpoint that writes, an OAuth token that was not granted the scope the endpoint needs (`insufficient_scope`), an OAuth token that was granted it but whose holder no longer has a role permitting it (`insufficient_role`), an OAuth token on an endpoint that accepts an API key and nothing else (`api_key_required`), and an API key on an endpoint that answers for a user (`user_credential_required`). Discriminate on `code` rather than on the message, which is free-form. The first refusal predates the codes and sets none. Only `insufficient_scope` carries the challenge header, because it is the only one a client can act on by re-authorizing.","headers":{"WWW-Authenticate":{"description":"Present on the `insufficient_scope` refusal only, naming the scope to re-authorize for (RFC 6750 3.1): `Bearer error=\"insufficient_scope\", scope=\"webhooks:read\"`. Absent on `insufficient_role`, where the scope is already granted, and on `api_key_required` and `user_credential_required`, where no scope would help.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"The credential or organization went over a rate limit. Limits per minute, per credential and per organization: 1,000 and 2,000 for `GET /test-results/{signature}`, `GET /projects/{projectId}/tests/{signature}/executions` and `POST /instances/{instanceId}/trace-link`; 1,000 and 2,000 for `GET /instances/{instanceId}` and `GET /projects/{projectId}/spec-files/{signature}/executions`; 3,000 and 6,000 for `POST /signature/test` and `POST /signature/spec`; 200 and 400 for `GET /projects/{projectId}/tests`, `/spec-files` and `/errors` with their `/metrics` and `/{signature}`, and `GET` on `/tests/{projectId}`, `/errors/{projectId}` and `/spec-files/{projectId}`; 600 and 1,200 for other `GET` requests on `/projects/...` and `POST /projects/{projectId}/test-issues`; 600 and 1,200 for other `GET` requests, including `GET /instances/{instanceId}/test-executions/{testId}`; 300 and 600 for other `POST` requests and for `PUT`, `PATCH` and `DELETE` requests.","headers":{"Retry-After":{"description":"Seconds until the limit resets","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/test-results/{signature}":{"get":{"summary":"List test executions of a test","description":"Deprecated. Use `GET /projects/{projectId}/tests/{signature}/executions` instead. It takes the same query parameters and returns the same response. The executions of one test, by test signature. Rows are newest first. To page, pass the `cursor` of the last row as `starting_after` for older rows, or the `cursor` of the first row as `ending_before` for newer rows.","operationId":"getTestResults","deprecated":true,"tags":["Test executions"],"parameters":[{"$ref":"#/components/parameters/SignaturePath"},{"$ref":"#/components/parameters/DateStartQuery"},{"name":"date_end","in":"query","required":true,"description":"End of the date range, ISO 8601, exclusive. A date without a time (`2024-01-31`) runs up to the next midnight UTC, so it includes that whole day. A value without a zone is UTC.","schema":{"type":"string"}},{"$ref":"#/components/parameters/TestExecutionsLimitQuery"},{"$ref":"#/components/parameters/StartingAfterQuery"},{"$ref":"#/components/parameters/EndingBeforeQuery"},{"$ref":"#/components/parameters/TagsQuery"},{"$ref":"#/components/parameters/BranchesQuery"},{"$ref":"#/components/parameters/AuthorsQuery"},{"$ref":"#/components/parameters/GroupsQuery"},{"$ref":"#/components/parameters/EnvironmentsQuery"},{"name":"branch[]","in":"query","required":false,"deprecated":true,"description":"Deprecated. Use branches[] instead. Filter by git branch (can be specified multiple times using bracket notation, e.g., branch[]=main&branch[]=develop). Each value supports a trailing `*` for prefix search. Each branch value is limited to 250 characters (exact or wildcard).","schema":{"type":"array","items":{"$ref":"#/components/schemas/BranchFilterQueryValue"}},"style":"form","explode":true},{"name":"tag[]","in":"query","required":false,"deprecated":true,"description":"Deprecated. Use tags[] instead. Filter by run tags (can be specified multiple times using bracket notation, e.g., tag[]=tag1&tag[]=tag2)","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true},{"name":"status[]","in":"query","required":false,"description":"Filter by outcome(s). Each value is a `RecordedTestOutcome` (see schemas). Multiple values OR together. Combine with `flaky` using AND when both are set.","schema":{"type":"array","items":{"$ref":"#/components/schemas/RecordedTestOutcome"}},"style":"form","explode":true},{"name":"flaky","in":"query","required":false,"description":"Filter by flaky status. When true, returns only flaky tests. When false, returns only non-flaky tests. When omitted, returns all tests regardless of flaky status. Can be combined with status filter using AND logic (e.g., status[]=passed&flaky=true returns only flaky passed tests).","schema":{"type":"boolean"}},{"name":"annotations","in":"query","required":false,"description":"Filter by test annotations. The parameter value must be a JSON-stringified array of objects: `[{ \"type\": \"string\", \"description\": \"string\" | [\"string\"] or null }]`. description is optional; omit or set to null to match any value for that annotation.","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestExecutionListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"413":{"description":"Payload Too Large - Response size exceeds limits. Use Accept-Encoding: gzip header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Unexpected server error, for example a database timeout. The request reads only, so it is safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## List test executions of a test

> The executions of one test in a project over a date range. Rows are newest first. To page, pass the \`cursor\` of the last row as \`starting\_after\` for older rows, or the \`cursor\` of the first row as \`ending\_before\` for newer rows.

```json
{"openapi":"3.0.2","info":{"title":"Currents REST API","version":"1.0.0"},"tags":[{"name":"Test executions","description":"Query test executions.\n\nA test execution is one test in one spec file execution. List them for a run\nor for one test across runs, or get one with its artifacts. The list for one test\nfilters by date range, branch, tags, git author, and outcome (`status[]`\nvalues use the `RecordedTestOutcome` schema)."}],"servers":[{"url":"https://api.currents.dev/v1","description":"Production API"},{"url":"https://api-staging.currents.dev/v1","description":"Staging API"},{"url":"http://localhost:4000/v1","description":"Local development"}],"security":[{"BearerAuth":[]},{"OAuth2":["results:read"]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"An organization API key, sent as `Authorization: Bearer <key>`. A key carries one scope for the whole API: a `read` key reaches the GET endpoints, a `write` key reaches all of them. A `crnts_pat_` personal access token is accepted as a Bearer while its owner remains an eligible administrator in its active organization. Each operation requires the corresponding scope stored on that token."},"OAuth2":{"type":"oauth2","description":"An access token from the Currents authorization server, for an application acting as a user in one organization. Unlike an API key it is confined per endpoint: the operation lists the scope it needs, and a token that was not granted that scope gets 403.\n\n**The endpoints below are production's.** They are written out so this specification can be exercised against production, and they are wrong for every other deployment — a token minted by `id.currents.dev` is refused by a staging or on-premise API, whose `OAUTH_ISSUER` and `OAUTH_API_AUDIENCE` are its own. Against anything but production, and in a client generated from this document, discover them instead: `GET {api origin}/.well-known/oauth-protected-resource`, then the `authorization_servers[0]` document.\n\n**The audience named here is the REST API's.** `POST /mcp` is a second resource server on the same origin, identified by `{api origin}/mcp` and described by its own document at `/.well-known/oauth-protected-resource/mcp`. Every operation below refuses a token minted for it, and it refuses every token minted for these, so a client of this specification wants the audience above and not that one.","flows":{"authorizationCode":{"authorizationUrl":"https://id.currents.dev/api/auth/oauth2/authorize","tokenUrl":"https://id.currents.dev/api/auth/oauth2/token","refreshUrl":"https://id.currents.dev/api/auth/oauth2/token","scopes":{"projects:read":"See which projects exist and their names","projects:write":"Change project configuration, including a project's tags","results:read":"See runs, specs and failure detail — errors, stacks and artifacts","analytics:read":"See aggregate metrics: flake and failure rates, error counts, durations and trends","actions:read":"See quarantine and skip rules, and the tests they affect","actions:write":"Create, edit, enable, disable and archive quarantine and skip rules","issues:write":"Create and link issues in a connected issue tracker, and list its projects and issue types","runs:write":"Cancel and reset runs, and permanently delete runs and their artifacts","webhooks:read":"See webhook configuration, including destination URLs and headers","webhooks:write":"Create, edit and delete webhooks","shares:write":"Create public links to test results that anyone with the link can open until they expire"}}}}},"parameters":{"ProjectIdPath":{"name":"projectId","in":"path","required":true,"description":"The project ID","schema":{"type":"string"}},"SignaturePath":{"name":"signature","in":"path","required":true,"description":"Test signature, as returned by `POST /signature/test` and listed by `GET /projects/{projectId}/tests`.","schema":{"type":"string"}},"DateStartQuery":{"name":"date_start","in":"query","required":true,"description":"Start date in ISO 8601 format","schema":{"type":"string","format":"date-time"}},"TestExecutionsLimitQuery":{"name":"limit","in":"query","required":false,"description":"Maximum number of items to return (default: 10, max: 100)","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},"StartingAfterQuery":{"name":"starting_after","in":"query","required":false,"description":"Cursor for the next page: the `cursor` of the last item on the current page. Returns the items after it in the list's sort order: older items on a list sorted newest first, newer items on a list sorted oldest first.","schema":{"type":"string"}},"EndingBeforeQuery":{"name":"ending_before","in":"query","required":false,"description":"Cursor for the previous page: the `cursor` of the first item on the current page. Returns the items before it in the list's sort order: newer items on a list sorted newest first, older items on a list sorted oldest first.","schema":{"type":"string"}},"TagsQuery":{"name":"tags[]","in":"query","required":false,"description":"Filter by tags (can be specified multiple times using bracket notation, e.g., tags[]=value1&tags[]=value2)","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true},"BranchesQuery":{"name":"branches[]","in":"query","required":false,"description":"Filter by git branch. Use trailing `*` for prefix match (e.g. `release/*`). Max 250 characters per value.","schema":{"type":"array","items":{"$ref":"#/components/schemas/BranchFilterQueryValue"}},"style":"form","explode":true},"AuthorsQuery":{"name":"authors[]","in":"query","required":false,"description":"Filter by git authors (can be specified multiple times using bracket notation, e.g., authors[]=author1&authors[]=author2)","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true},"GroupsQuery":{"name":"groups[]","in":"query","required":false,"description":"Filter by groups (can be specified multiple times using bracket notation, e.g., groups[]=group1&groups[]=group2)","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true},"EnvironmentsQuery":{"name":"environments[]","in":"query","required":false,"description":"Filter by environment (can be specified multiple times using bracket notation, e.g., environments[]=staging&environments[]=production)","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true}},"schemas":{"BranchFilterQueryValue":{"description":"Branch filter value: an exact branch name, or a trailing `*` for prefix match (e.g. `release/*`). Max 250 characters.","oneOf":[{"type":"string","description":"Exact branch name (must not contain `*` or spaces).","pattern":"^[!-)+-~]+$","maxLength":250},{"type":"string","description":"Prefix match: branch prefix followed by `*`.","pattern":"^[!-)+-~]+\\*$","maxLength":250}]},"RecordedTestOutcome":{"type":"string","description":"Final per-test outcome stored in Currents.\n\n- **passed** — Runner reported success.\n- **failed** — Runner reported failure (assertions, errors, timeouts, etc.).\n- **pending** — Intentional skip or disabled test (e.g. `test.skip()` / `it.skip()`). In `GET /projects/{projectId}/tests` this increments `metrics.ignored` and does **not** increment `metrics.failures`.\n- **skipped** — Runner reported a skip without a normal pass/fail (often interrupted or never executed as pass/fail). In `GET /projects/{projectId}/tests` this increments `metrics.failures` together with `failed` (there is no separate `skipped` counter in that response). On **run and spec** payloads, `stats.skipped` is still reported separately from `stats.failures` and `stats.pending`.","enum":["passed","failed","pending","skipped"]},"TestExecutionListResponse":{"type":"object","required":["status","has_more","data"],"properties":{"status":{"type":"string","enum":["OK"]},"has_more":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/TestExecutionListItem"}}}},"TestExecutionListItem":{"type":"object","properties":{"cursor":{"type":"string"},"signature":{"type":"string","description":"Test signature, as returned by `POST /signature/test` and listed by `GET /projects/{projectId}/tests`."},"framework":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"projectId":{"type":"string"},"groupId":{"type":"string"},"runId":{"type":"string"},"instanceId":{"type":"string"},"spec":{"type":"string"},"specSignature":{"type":"string","description":"Signature of the spec file: the `signature` of the spec file execution, for `GET /projects/{projectId}/spec-files/{signature}/executions`."},"machineId":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"title":{"type":"array","items":{"type":"string"}},"testId":{"type":"string"},"displayError":{"type":"string","nullable":true},"commit":{"type":"object","properties":{"branch":{"type":"string"},"authorEmail":{"type":"string"},"authorName":{"type":"string"},"sha":{"type":"string"},"message":{"type":"string"}}},"duration":{"type":"integer"},"flaky":{"type":"boolean"},"expectedStatus":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/RecordedTestOutcome"},"attempts":{"type":"array","items":{"type":"object","properties":{"attemptId":{"type":"string"},"state":{"type":"string"},"error":{"type":"object","nullable":true,"properties":{"message":{"type":"string"},"stack":{"type":"string"},"location":{"type":"object"}}},"startedAt":{"type":"string","format":"date-time"},"duration":{"type":"integer"}}}},"annotations":{"type":"array","nullable":true,"items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"}}}}}},"ErrorResponse":{"type":"object","required":["status","error"],"properties":{"status":{"type":"string","enum":["FAILED"]},"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Stable machine-readable discriminator, present on refusals a client is expected to branch on (for example `AI_CONSENT_REQUIRED`). The `error` text is free-form; branch on `code`."},"candidates":{"type":"array","description":"With `code: ambiguous_target`: the runs, spec files or tests the request matched. Send one of their IDs.","items":{"type":"object","properties":{"runId":{"type":"string"},"ciBuildId":{"type":"string"},"instanceId":{"type":"string"},"groupId":{"type":"string"},"spec":{"type":"string"},"machineId":{"type":"string","nullable":true},"testId":{"type":"string"},"title":{"type":"array","items":{"type":"string"}}}}}}}},"responses":{"BadRequest":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"The credential authenticated but is not permitted to use this endpoint. Five refusals share the status: a `read` API key on an endpoint that writes, an OAuth token that was not granted the scope the endpoint needs (`insufficient_scope`), an OAuth token that was granted it but whose holder no longer has a role permitting it (`insufficient_role`), an OAuth token on an endpoint that accepts an API key and nothing else (`api_key_required`), and an API key on an endpoint that answers for a user (`user_credential_required`). Discriminate on `code` rather than on the message, which is free-form. The first refusal predates the codes and sets none. Only `insufficient_scope` carries the challenge header, because it is the only one a client can act on by re-authorizing.","headers":{"WWW-Authenticate":{"description":"Present on the `insufficient_scope` refusal only, naming the scope to re-authorize for (RFC 6750 3.1): `Bearer error=\"insufficient_scope\", scope=\"webhooks:read\"`. Absent on `insufficient_role`, where the scope is already granted, and on `api_key_required` and `user_credential_required`, where no scope would help.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"The credential or organization went over a rate limit. Limits per minute, per credential and per organization: 1,000 and 2,000 for `GET /test-results/{signature}`, `GET /projects/{projectId}/tests/{signature}/executions` and `POST /instances/{instanceId}/trace-link`; 1,000 and 2,000 for `GET /instances/{instanceId}` and `GET /projects/{projectId}/spec-files/{signature}/executions`; 3,000 and 6,000 for `POST /signature/test` and `POST /signature/spec`; 200 and 400 for `GET /projects/{projectId}/tests`, `/spec-files` and `/errors` with their `/metrics` and `/{signature}`, and `GET` on `/tests/{projectId}`, `/errors/{projectId}` and `/spec-files/{projectId}`; 600 and 1,200 for other `GET` requests on `/projects/...` and `POST /projects/{projectId}/test-issues`; 600 and 1,200 for other `GET` requests, including `GET /instances/{instanceId}/test-executions/{testId}`; 300 and 600 for other `POST` requests and for `PUT`, `PATCH` and `DELETE` requests.","headers":{"Retry-After":{"description":"Seconds until the limit resets","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/projects/{projectId}/tests/{signature}/executions":{"get":{"summary":"List test executions of a test","description":"The executions of one test in a project over a date range. Rows are newest first. To page, pass the `cursor` of the last row as `starting_after` for older rows, or the `cursor` of the first row as `ending_before` for newer rows.","operationId":"listProjectTestExecutions","tags":["Test executions"],"parameters":[{"$ref":"#/components/parameters/ProjectIdPath"},{"$ref":"#/components/parameters/SignaturePath"},{"$ref":"#/components/parameters/DateStartQuery"},{"name":"date_end","in":"query","required":true,"description":"End of the date range, ISO 8601, exclusive. A date without a time (`2024-01-31`) runs up to the next midnight UTC, so it includes that whole day. A value without a zone is UTC.","schema":{"type":"string"}},{"$ref":"#/components/parameters/TestExecutionsLimitQuery"},{"$ref":"#/components/parameters/StartingAfterQuery"},{"$ref":"#/components/parameters/EndingBeforeQuery"},{"$ref":"#/components/parameters/TagsQuery"},{"$ref":"#/components/parameters/BranchesQuery"},{"$ref":"#/components/parameters/AuthorsQuery"},{"$ref":"#/components/parameters/GroupsQuery"},{"$ref":"#/components/parameters/EnvironmentsQuery"},{"name":"branch[]","in":"query","required":false,"deprecated":true,"description":"Deprecated. Use branches[] instead. Filter by git branch (can be specified multiple times using bracket notation, e.g., branch[]=main&branch[]=develop). Each value supports a trailing `*` for prefix search. Each branch value is limited to 250 characters (exact or wildcard).","schema":{"type":"array","items":{"$ref":"#/components/schemas/BranchFilterQueryValue"}},"style":"form","explode":true},{"name":"tag[]","in":"query","required":false,"deprecated":true,"description":"Deprecated. Use tags[] instead. Filter by run tags (can be specified multiple times using bracket notation, e.g., tag[]=tag1&tag[]=tag2)","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true},{"name":"status[]","in":"query","required":false,"description":"Filter by outcome(s). Each value is a `RecordedTestOutcome` (see schemas). Multiple values OR together. Combine with `flaky` using AND when both are set.","schema":{"type":"array","items":{"$ref":"#/components/schemas/RecordedTestOutcome"}},"style":"form","explode":true},{"name":"flaky","in":"query","required":false,"description":"Filter by flaky status. When true, returns only flaky tests. When false, returns only non-flaky tests. When omitted, returns all tests regardless of flaky status. Can be combined with status filter using AND logic (e.g., status[]=passed&flaky=true returns only flaky passed tests).","schema":{"type":"boolean"}},{"name":"annotations","in":"query","required":false,"description":"Filter by test annotations. The parameter value must be a JSON-stringified array of objects: `[{ \"type\": \"string\", \"description\": \"string\" | [\"string\"] or null }]`. description is optional; omit or set to null to match any value for that annotation.","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestExecutionListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"413":{"description":"Payload Too Large - Response size exceeds limits. Use Accept-Encoding: gzip header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Unexpected server error, for example a database timeout. The request reads only, so it is safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.currents.dev/api/resources/test-executions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
