Skip to main content
PUT
Trigger a test run

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
environment
string

Slug of a saved environment to run with (e.g., production, staging). Optional: without it the run uses only the project's variables and the config sent on this request.

build
object

Build information to associate with the test run.

metadata
object

Custom key-value pairs to associate with the test run. Values must be strings or numbers.

environment_variables_overrides
object[]

Environment variables to override for this test run.

tags
string[]

Tags to filter which tests to run (e.g., @smoke, @critical). Only tests matching these tags will be executed.

exclude_tags
string[]

Tags whose tests are skipped (e.g., @slow). Applied after every other selection, so it can only remove tests: with tags it runs tests matching tags but not exclude_tags; alone it runs every test except the excluded ones.

test_case_ids
string[]

Specific test case ids (Playwright per-project test.id) to run. Only these tests will be executed.

branch
string

Existing test-repository branch to run. A missing explicit branch creates an errored run; Empirical never creates it. May be supplied alongside build, which describes the application code under test.

trigger
object

The application pull request under test, for pre-merge runs. The run uses the test-repository branch named pull_request.head, merged into the project default branch. If no such branch exists, it uses the default branch. An explicit branch takes precedence.

concurrency
object | null

Concurrency group and policy for this run. Runs in the same group (within the project) are limited to one in progress; on_conflict says what this run does when the group already has an active run: cancel cancels it and starts now, wait queues behind it (a newer waiting run replaces an older one). Omit to use the project's legacy concurrency setting; null for no limit.

reporters
object[]

Reporters for this run, saved on the run when it is created; at most one entry per reporter_type. Omit to use the environment's reporter_config (a run without an environment then gets none). A list replaces those defaults: reporters not listed do not fire, and [] turns them all off. Without reporters, a run started by a person (dashboard, CLI or agent session) also gets slack_creator_dm; a list sends the DM only if it names slack_creator_dm. Invalid entries (unknown Slack channels, duplicate types) reject the request without creating a run.

rerun_source_id
integer

ID of the test run this run is a rerun of.

Required range: x >= 1
rerun_only_failed
boolean

When rerunning, only re-execute the previously failed tests.

Response

The triggered test run.

data
object
required