SmoothDeploy Docs
API Reference

Test Runs

Query test run status, fetch results and artifact URLs, cancel runs, and rerun using the SmoothDeploy API. All actions require testRuns:read.

Test runs are created by the run actions on Tests or by schedules. Every action in this group requires testRuns:read. Canceling a run additionally requires tests:cancel, and rerunning a run requires tests:run. Read actions do not require an active subscription; canceling and rerunning do. See Authentication and Scopes.

GET actions take their inputs as query parameters; POST actions take a JSON body. All actions require x-project-id. The branch is resolved from x-branch-id or the project default branch. test-runs.list uses the branch only to resolve testId; without testId or branchId it returns runs from every branch of the project.

Run Status Lifecycle

pending → queued → running → completed
                           → failed
                           → quarantined
                           → cancelled

completed means every test in the run passed. Any failure of a non-quarantined test produces failed. quarantined means every executed test was quarantined: quarantined tests still run, but their failures never fail a run. A run stays in pending while all parallels are busy; it advances to queued once a parallel is reserved and running once the remote runner picks it up.


List Runs

GET /v1/actions/test-runs.list

Scope: testRuns:read

Returns test runs for a project, with pagination.

Query Parameters

ParameterTypeDefaultNotes
limitinteger20Results per page. Minimum 1, maximum 500.
pageinteger0Zero-based page index.
statusstring-Filter by status: pending, queued, running, completed, failed, quarantined, or cancelled.
namestring-Substring filter on run name.
testIdUUID-Filter to runs for this test or directory (directories expand to all descendants).
scheduleIdUUID-Filter to runs triggered by this schedule.
branchIdUUID-Filter to runs on this branch.
startDatestring-ISO 8601 date. Include only runs created on or after this date.
endDatestring-ISO 8601 date. Include only runs created on or before this date (inclusive).
exportAllbooleanfalseReturn up to 10 000 runs in one response as { data, totalCount }, without pagination.

Response

{
  "data": [
    {
      "id": "run-uuid",
      "name": "Login flow",
      "status": "completed",
      "testId": "test-uuid",
      "testRevisionId": "rev-uuid",
      "branchId": "branch-uuid",
      "testName": "Login flow",
      "branchName": "main",
      "scheduleType": null,
      "createdAt": "2026-09-20T10:00:00.000Z",
      "startedAt": "2026-09-20T10:00:05.000Z",
      "completedAt": "2026-09-20T10:04:12.000Z",
      "duration": 247000
    }
  ],
  "pagination": {
    "page": 0,
    "limit": 20,
    "total": 42,
    "totalPages": 3,
    "hasMore": true
  }
}

Get Latest Run

GET /v1/actions/test-runs.get-latest

Scope: testRuns:read

Returns the most recent run for the given filter. Useful for dashboards and status badges.

Query Parameters

ParameterTypeNotes
testIdUUIDFilter to runs for this test or directory.
scheduleIdUUIDFilter to runs triggered by this schedule.
branchIdUUIDFilter to runs on this branch.

All parameters are optional.

Response

{
  "data": {
    "id": "run-uuid",
    "name": "Login flow",
    "status": "failed",
    "createdAt": "2026-09-21T09:00:00.000Z"
  }
}

Returns { "data": null } when no run matches the filter.


Get Run Statistics

GET /v1/actions/test-runs.get-stats

Scope: testRuns:read

Returns aggregate pass/fail/skip counts and average duration for the given filter scope.

Query Parameters

Same as Get latest run: testId, scheduleId, branchId.

Response

{
  "data": {
    "totalRuns": 38,
    "successRate": 89,
    "avgDuration": 245000,
    "lastRun": "2026-09-21T09:00:00.000Z",
    "passed": 34,
    "failed": 3,
    "skipped": 1
  }
}
FieldNotes
successRateInteger 0-100. Computed as passed / (passed + failed) * 100, rounded.
avgDurationAverage run duration in milliseconds. 0 when no completed runs exist.
lastRunISO 8601 timestamp of the most recent run. null when no runs exist.

Get a Run

GET /v1/actions/test-runs.get

Scope: testRuns:read

Returns the full run record including branch and revision metadata. For completed, failed, and quarantined runs, a report field is included inline with summary data used to generate the email report.

Query Parameters

ParameterTypeRequiredNotes
runIdUUIDyesThe run to read.

Response

{
  "data": {
    "id": "run-uuid",
    "name": "Login flow",
    "status": "completed",
    "testId": "test-uuid",
    "testRevisionId": "rev-uuid",
    "projectId": "proj-uuid",
    "branchId": "branch-uuid",
    "testName": "Login flow",
    "branchName": "main",
    "scheduleId": null,
    "config": {
      "use": { "browserName": "chromium" },
      "workers": 2,
      "timeout": 30000
    },
    "vars": { "test-uuid": {} },
    "parameters": { "test-uuid": [] },
    "metadata": {},
    "stats": null,
    "createdAt": "2026-09-20T10:00:00.000Z",
    "startedAt": "2026-09-20T10:00:05.000Z",
    "completedAt": "2026-09-20T10:04:12.000Z",
    "cancelledAt": null,
    "duration": 247000,
    "report": null
  }
}

report is only present for completed, failed, and quarantined runs. It is null when generation fails, and includes: status, testName, runName, runId, duration, completedAt, branchId, branchName, scheduleName, and runTypeInfo (with type, name, testResults, and stats). For runs in any other status the report field is omitted.

Status Codes

StatusMeaning
200Run found
404Run not found in this project

Get Run Tests

GET /v1/actions/test-runs.list-tests

Scope: testRuns:read

Returns the list of tests that were executed (or scheduled to execute) in this run. For a single-test run this is one entry; for directory and bulk runs the full leaf-test list is returned.

Query Parameters

ParameterTypeRequiredNotes
runIdUUIDyesThe run to read.

Response

{
  "data": [
    { "testId": "test-uuid-1", "testName": "Login flow" },
    { "testId": "test-uuid-2", "testName": "Checkout flow" }
  ]
}

Get Run Results

GET /v1/actions/test-runs.get-results

Scope: testRuns:read

Returns the parsed Playwright JSON report (test-results.json) of a finished run: the resolved config, the suites with every spec and its results, any top-level errors, and aggregate stats.

Query Parameters

ParameterTypeRequiredNotes
runIdUUIDyesThe run to read.

Response

{
  "data": {
    "config": { "workers": 1, "timeout": 30000 },
    "suites": [],
    "errors": [],
    "stats": {
      "startTime": "2026-09-20T10:00:05.000Z",
      "duration": 241000,
      "expected": 3,
      "skipped": 0,
      "unexpected": 0,
      "flaky": 0
    }
  }
}

data is null when the run has not produced a results file (for example while it is still running, or when it was canceled before starting). The element shapes inside suites follow the Playwright JSON reporter and are not described further here. Returns 404 if the run does not exist in this project.


Get Run Artifacts

GET /v1/actions/test-runs.get-artifacts

Scope: testRuns:read

Returns presigned download URLs (valid for 60 minutes) for all artifacts produced by the run. Only artifacts that already exist are returned, so the list can be empty while the run is still in progress.

Query Parameters

ParameterTypeRequiredNotes
runIdUUIDyesThe run to read.

Response

{
  "data": [
    {
      "key": "bundle.tgz",
      "label": "Test Bundle - Code and Dependencies",
      "type": "archive",
      "url": "https://..."
    },
    {
      "key": "playwright-report.tar.gz",
      "label": "Playwright Report Archive",
      "type": "archive",
      "url": "https://..."
    },
    {
      "key": "test-results.json",
      "label": "Test Results JSON Report",
      "type": "json",
      "url": "https://..."
    },
    {
      "key": "test-run.log",
      "label": "Test Run Log",
      "type": "log",
      "url": "https://..."
    },
    {
      "key": "tests/Login flow/trace.zip",
      "label": "Login flow - Trace",
      "type": "trace",
      "testName": "Login flow",
      "size": 1048576,
      "url": "https://..."
    },
    {
      "key": "tests/Login flow/error-context.md",
      "label": "Login flow - Error Context",
      "type": "error-context",
      "testName": "Login flow",
      "size": 2048,
      "url": "https://..."
    }
  ]
}

If a file was not produced (e.g. trace is off in the config), its entry is absent from the array. Per-test artifacts (traces, images, videos) appear alongside the run-level files and include a testName field.


Get Run Report

GET /v1/actions/test-runs.get-report

Scope: testRuns:read

Returns the HTML email report for a completed or failed run as { "data": { "html": "<!DOCTYPE html>..." } }.

Query Parameters

ParameterTypeRequiredNotes
runIdUUIDyesThe run to read.

Returns 400 unless the run's status is completed, failed, or quarantined. Runs in pending, queued, running, or cancelled status return 400.

{ "data": { "html": "<!DOCTYPE html>...", "contentType": "text/html" } }

Get Run Screenshots

GET /v1/actions/test-runs.get-screenshots

Scope: testRuns:read

Returns the step screenshot index of a run with presigned URLs.

Query Parameters

ParameterTypeRequiredNotes
runIdUUIDyesThe run to read.

Response

{
  "data": {
    "steps": [
      {
        "stepId": "revision-step-uuid",
        "testId": "test-uuid",
        "title": "Click Sign in",
        "urls": { "page": "https://...", "element": null }
      }
    ],
    "failureScreenshots": { "test-uuid": true },
    "failureScreenshotUrls": { "test-uuid": "https://..." }
  }
}

steps lists every step that has a page or element screenshot. urls.page and urls.element are null when that screenshot does not exist. failureScreenshots and failureScreenshotUrls are keyed by test ID. steps is empty and the failure maps are absent or empty when the run produced no screenshot manifest.


Rerun a Run

POST /v1/actions/test-runs.rerun

Scope: testRuns:read and tests:run

Starts a new run of the same tests with the same configuration as an earlier run. Pass testIds to rerun only a subset, for example the failed tests. Requires an active subscription.

Body

FieldRequiredNotes
runIdyesUUID of the run to repeat.
testIdsno1 to 1000 test IDs to rerun instead of every test of the original run.

Response

The response is the same as tests.run-many:

{
  "data": {
    "runId": "new-run-uuid",
    "status": "pending",
    "totalTests": 3,
    "message": "Started bulk run with 3 tests"
  }
}

Without testIds, the tests are the ones listed by test-runs.list-tests. The same cooldown, parallel, and 100-test limits as the run actions apply. Returns 400 when the original run has no tests to rerun and 404 when the run does not exist in this project.


Cancel a Run

POST /v1/actions/test-runs.cancel

Scope: testRuns:read and tests:cancel

Cancels a run that is in pending, queued, or running state. Returns 400 if the run is already in a terminal state.

Body

FieldRequiredNotes
runIdyesUUID of the run to cancel.

Response

{
  "data": {
    "success": true,
    "message": "Cancelled 1 task(s)"
  }
}

Status Codes

StatusMeaning
200Cancellation succeeded (or was partially successful; check the message)
400Run is already completed, failed, or canceled
403Missing tests:cancel scope, or no active subscription ({ "error": "LICENSE_REQUIRED" })
404Run not found in this project