Skip to main content

At a glance

  • Base URL: https://api.checksum.ai/public-api/v1/. Only grep (and its job-name status) uses https://api.checksum.ai/public-api/v2/.
  • Auth: every REST call sends Authorization: Bearer $CHECKSUM_API_KEY. Key location: Settings → Project Settings.
  • Gating CI: poll GET /execution/status/run/{runId} until isTerminal is true, then pass only when verdict is "pass".
  • Heal on failure: add an autoHeal object to any execution request, or pass --cksm-auto-heal to the CLI.
  • No cancel: API-triggered runs can’t be cancelled through the public API.
  • Sharding: shardCount 2–40. Requires checksumai 4.4.0+ on the tests branch.
Developer guide
The CLI, GitHub Actions, and the REST API

Before you run the CLI

Checksum sets up your tests repository during onboarding. To run it with the CLI, clone the tests repo and prepare it once:
dotenv --download writes a .env file with your project’s environment settings: environment URL, login URL, credentials, and custom variables. Your API key is in Settings → Project Settings (see API Keys). Checksum maintains the file’s values, so to change them, contact your Checksum team and then download it again. Any automation that starts a Checksum test run or AI generation should download the latest .env first (see Environments). To check your setup, run the built-in example test. It’s a quick check that your login works:

Run tests with the CLI

The Checksum CLI (checksumai) runs your generated Playwright tests. It downloads your environment configuration, runs the tests, uploads the results to the dashboard, and can hand failures to auto-healing. It ships in the @checksum-ai/runtime npm package, and every command runs with npx checksumai. Because it wraps Playwright, your tests also run under plain Playwright.

Everyday commands

In CI (where CI=true), results upload to the dashboard automatically. See What gets reported.

Useful flags

Most runs need no flags at all. The ones you’ll reach for:
  • -g "pattern" runs only the tests whose name matches.
  • --cksm-auto-heal sends failures to auto-healing when the run ends. In GitHub Actions and GitLab CI, Checksum detects the repository, branch, and pull request on its own, so this flag alone is usually enough.
  • --cksm-affected runs only the tests a change affects (below).
  • --cksm-rerun-failed re-runs only what didn’t pass last time (below).
The full flag list, with defaults, is in the Reference for AI block at the end of this CLI section.

Run only the tests a change affects

For pull-request checks, you usually don’t need the whole suite. --cksm-affected looks at which files changed since a base branch, asks Checksum which tests those files affect, and runs just those:
It needs enough git history to find where your branch split off, so use a full checkout in CI (for example fetch-depth: 0 in actions/checkout). It can’t be combined with -g or --cksm-rerun-failed.
Try it with a dry run firstRun --cksm-affected-dry-run in CI for a while to see which tests would run, before you turn the flag on for PR workflows.

Re-run only what failed

After a run with failures, you can retry just the test files that didn’t pass (failed or recovered), without running everything again:
If every test in that run passed, the command finishes successfully with nothing to run.

Update the CLI

Installing your tests repository’s dependencies installs the CLI (see Before you run the CLI). To update to the latest release, which you need before using sharding (minimum 4.4.0), run this and commit the result:

Other CLI commands

Package: checksumai (npm dependency of the tests repository). Invocation: npx checksumai <command>. Wraps Playwright; generated tests also run under plain Playwright. Update: npm install checksumai@latest, then commit package.json / lockfile to the tests branch; sharding requires 4.4.0+.Setup per checkout: npm install, npx playwright install --with-deps, npx checksumai dotenv --download --api-key=$CHECKSUM_API_KEY. Verify with npx checksumai test -g "example" (checks login). Re-download after Checksum updates the variables, and in any automation that starts a Checksum test run or AI generation.

Commands

npx checksumai test flags

CI auto-detection: in GitHub Actions and GitLab CI, repository, branch, and pull-request number are read from the CI environment, so --cksm-auto-heal alone is usually enough.

--cksm-affected behavior and constraints

Three steps: (1) compute changed files between the current checkout and the base ref; (2) call POST /public-api/v1/affected-tests; (3) run Playwright with an internal --grep over the returned test IDs.

--cksm-rerun-failed behavior

Re-runs only test files that didn’t pass (failed or recovered). Without an ID, fetches per-test results via GET /public-api/v1/test-runs/latest; with =$TEST_RUN_ID, uses that run. Resolves failing file paths and passes them to Playwright. If every test passed, exits successfully with nothing to run. Can’t be combined with --cksm-affected or -g.Reporting: with hostReports enabled (default true when CI=true), results upload to the dashboard.

Run from GitHub Actions

On GitHub, the simplest option is the Checksum GitHub Action. It starts a cloud run from your workflow and calls the REST API for you, so you don’t need Playwright on your runner. Store your API key as the repository secret CHECKSUM_API_KEY:
.github/workflows/checksum.yml
The action can pick tests by name pattern, by what a PR changed, or by suite, test, or collection ID, and it can wait for the result, shard, and override environment variables. All of its options, plus GitLab and other CI recipes, are in CI/CD Integration → GitHub Action.
Action: checksum-ai/test-run-action@v2. Calls the REST execution endpoints. Required input: api-key: ${{ secrets.CHECKSUM_API_KEY }}. Selection modes: grep, affected, suite-ids, test-ids, collection-id. Other inputs: wait, sharding, env overrides, auto-heal. Full input table: CI/CD Integration → GitHub Action.

Start a cloud run from the REST API

With the REST API, Checksum runs your tests in its own cloud, which works from any CI system or script. Each call starts a run and immediately returns a runId. You then use that ID to check the result. All calls send Authorization: Bearer $CHECKSUM_API_KEY (see Base URL & versions). The v1 execution endpoints run against the project’s configured branch and environment.
Every way of starting a run also accepts two optional settings: autoHeal, which heals failures automatically when the run ends (Auto-Healing), and shardCount, which splits the run across parallel machines (Sharding).
Update checksumai before shardingAfter all shards finish, Checksum merges their results using the checksumai version installed on the branch you run against. If that version is older than 4.4.0, the shards still run but may never merge, and the run never returns a final verdict. An autoHeal request on that run is then never evaluated. Run npm install checksumai@latest on your tests branch and commit it before your first sharded run.

Run the whole suite

The body is optional. This example also asks Checksum to heal any failures and open a PR in acme-co/my-tests.

Run a collection

POST
Runs every test in one collection, such as “Checkout”.

Run specific tests

Pass the Checksum test IDs you want to run. These can come straight from the affected-tests call.

Run tests that match a name or tag

The most flexible option, and the one to use for pull-request checks. Besides a name or tag pattern such as @smoke, it can check out a specific branch of your tests repository and point the run at a preview deployment:
Only your own application variables (like BASE_URL) can be overridden. Names reserved by Checksum are rejected. An older v1 version of this endpoint accepts only the pattern. Use v2 for new integrations.

Find the tests a change affects

Send the list of files a change touched (for example, the output of git diff --name-only) and Checksum returns the tests most likely affected. Then run just those with Run specific tests. The CLI’s --cksm-affected flag does both steps for you.
Base URLs: https://api.checksum.ai/public-api/v1/ (all execution endpoints except grep) and https://api.checksum.ai/public-api/v2/ (grep). Headers on every call: Authorization: Bearer $CHECKSUM_API_KEY, Content-Type: application/json. v1 execution endpoints run against the project’s configured branch and environment.

Execution response (all execution endpoints)

Optional fields accepted by every execution endpoint

POST https://api.checksum.ai/public-api/v1/execution/suite

Runs the full test suite in Checksum’s cloud. Body optional: autoHeal, shardCount. Example body:
Response: execution response, e.g. { "runId": "9f2c7a4e-8b31-4d6a-a2f0-3c5e1b7d9a42", "name": "job-name-12345", "sharded": false }. Next: GET /public-api/v1/execution/status/run/{runId}.

POST https://api.checksum.ai/public-api/v1/execution/collection/{id}

Runs every test in the collection. Body optional: autoHeal, shardCount. Response: execution response. Next: GET /execution/status/run/{runId}.

POST https://api.checksum.ai/public-api/v1/execution/tests

Response: execution response. Next: GET /execution/status/run/{runId}.

POST https://api.checksum.ai/public-api/v2/execution/grep

Runs every test whose name matches a pattern. The only execution endpoint that can check out a specific branch and inject per-run environment variables; use it for PR checks against preview deployments.
Legacy: POST https://api.checksum.ai/public-api/v1/execution/grep still exists with a smaller body (grep only). New integrations should use v2.Response: execution response. Next: poll GET /public-api/v1/execution/status/run/{runId}; pass the CI check only when verdict is "pass".

POST https://api.checksum.ai/public-api/v1/affected-tests

Returns the Checksum test IDs most likely affected by a set of changed source files.Next: pass affectedTestIds as testIds to POST /public-api/v1/execution/tests. The CLI flag --cksm-affected does both steps.

Check whether a run passed

A cloud run takes a few minutes. To find out how it went, ask for its status using the runId you got back when you started it. Keep asking until isTerminal is true, then look at verdict: "pass" means the run passed.

Get a run’s status and verdict

GET
When the run is done, you’ll see something like this:
Gate CI on verdictPass your CI check only when verdict is "pass", not on status or on the counts. Checksum computes verdict only after a sharded run has merged its results, and it treats an empty test selection as a failure. A passed status with executedCount: 0 still returns verdict: "fail".
From here you can read the per-test details (Results API) or heal failures (Auto-Healing).

Older integrations: status by job name

Before run IDs, integrations checked status by the job name returned when a run started. That still works for non-sharded runs, but use the run ID for anything new, and always for sharded runs.
API-triggered runs can’t be cancelledThere’s no cancel endpoint in the public API. Cancelling your CI job only stops your workflow from polling. The Checksum run keeps going until it finishes. Plan concurrency to match: GitHub Actions’ cancel-in-progress, for example, cancels your workflow but not the run on Checksum.

GET https://api.checksum.ai/public-api/v1/execution/status/run/{runId}

Server-computed status of a run by runId from any execution endpoint. Works for sharded and non-sharded runs. Use for all new integrations. Header: Authorization: Bearer $CHECKSUM_API_KEY.Response while running:
Gating rule: poll until isTerminal is true, then pass only when verdict is "pass". Don’t gate on status or on counts. verdict is computed only after sharded results merge; an empty selection is a failure.Next: GET /public-api/v1/test-runs/{id}/results for per-test details, or POST /public-api/v1/auto-heal to heal failures.

GET https://api.checksum.ai/public-api/v1/execution/status/{jobName} (legacy)

Also: GET https://api.checksum.ai/public-api/v2/execution/status/{jobName} for v2 grep runs. Non-sharded runs only. Prefer GET /execution/status/run/{runId} for new integrations and all sharded runs. The v2 response adds testRunId (UUID) once terminal; use that value, not jobName, for POST /auto-heal.Response while running:
Response when complete (v1):
Response when complete (v2):
Cancellation: there is no cancel endpoint. Cancelling a CI job stops polling only; the Checksum run continues. GitHub Actions cancel-in-progress cancels the workflow, not the Checksum run.

Example: run the suite, wait for the verdict, heal failures

This script puts the pieces together. It starts a full suite run with auto-heal on failure, then waits for it to finish. If the run fails, healing starts automatically, with no separate heal call. It needs curl, jq, and CHECKSUM_API_KEY in the environment. Set TESTS_REPO and TESTS_BRANCH to your tests repository and its integration branch.
To heal a run that has already finished without autoHeal, call POST /public-api/v1/auto-heal with testRunId set to the run’s UUID (the runId, or the id from GET /test-runs/latest). Don’t use the dispatch name.

Pick which tests to run

Every interface can narrow a run down. Here’s how the same choice looks in each:

Environment overrides per run

Runs use the environment settings from your project (Environments → Environment variables). You can override any variable for a single run: Variables you set explicitly always take precedence over the downloaded .env file.

Run modes and runtime recovery (runMode)

runMode in checksum.config.ts controls how the CLI reacts to a failing step: Two related options fine-tune recovery: useChecksumSelectors (smart selector recovery, default true) and useChecksumAI ({ actions: true, assertions: false } by default, so assertion failures aren’t auto-recovered). See Auto-Maintenance & Recovery and checksum.config.ts.

What gets reported (hostReports)

When hostReports is enabled (default true when CI=true, which most CI providers set automatically), the CLI uploads the following after each run. Local runs keep reports on your machine unless you turn hostReports on.
  • Test results: passed / failed / recovered / bug status per test
  • Videos of each test’s browser session
  • Screenshots at key points and on failure
  • HAR files of network traffic
  • Playwright traces for step-by-step debugging
View them in Test Results in the web app, or fetch them over the API. See Results, Reports & Traces.
i
How it works
Where tests execute, scheduling, and troubleshooting

Ways to run

For pipeline recipes (GitHub Actions, GitLab CI, cross-repo checkout, PR gating), see CI/CD Integration.

Scheduled runs

Periodic runs execute your tests on a recurring, cron-based schedule. You don’t need to trigger runs by hand or rely only on CI events.
Coming soon: self-serve schedulingScheduling recurring runs in the web app is internal only for now. Until it’s generally available, you can:
  • Schedule runs in your own CI (schedule: cron in GitHub Actions, $CI_PIPELINE_SOURCE == "schedule" in GitLab). See CI/CD Integration.
  • Ask your Checksum team to set up scheduled runs, and to turn on auto-healing after scheduled runs (a project-level setting).
Planned capabilities for self-serve periodic runs:
  • Create scheduled runs with cron patterns (e.g. daily at midnight, every 6 hours)
  • Branch selection: choose which branch to run against
  • Test filtering with grep patterns
  • Activate / deactivate schedules without deleting them
  • Run now: trigger an immediate run outside the schedule
  • View results from scheduled runs alongside manual runs
  • Auto-heal on failure (project-level setting)

Troubleshooting

Check executedCount. An empty selection (e.g. a grep that matches nothing) is treated as a failure. Fix the pattern or IDs.
The shards finished but couldn’t be merged, usually because the tests branch has checksumai older than 4.4.0. Update it, commit, and re-run. Always set a timeout on your polling loop.
That’s expected. API-triggered runs can’t be cancelled through the public API.
Remove any key named CI or starting with CHECKSUM_. Also, envOverrides is only accepted on v2 grep.
Your checkout is probably shallow. Increase the fetch depth (e.g. fetch-depth: 0 in actions/checkout) so the merge base with the target branch is available.
The example test checks your login. Re-download .env, confirm the environment URL and test user in Environments, and make sure your network can reach the environment.

CI/CD Integration

GitHub Actions, GitLab, and PR gating recipes.

Sharding

Parallel runs, and how to prepare your suite.

Results, Reports & Traces

Dashboard and results API.

Auto-Healing

What happens when a run fails.