Skip to main content
PUT
/
api
/
test-runs
curl -X PUT \
  https://dash.empirical.run/api/test-runs \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY" \
  -d '{
    "environment": "production"
  }'
{
  "data": {
    "trigger": {
      "success": true
    },
    "test_run": {
      "id": 456,
      "state": "queued",
      "test_run_branch": "main",
      "created_at": "2024-01-15T10:30:00.000Z"
    }
  }
}
Triggers a new test run for the specified project and environment.

Request

Authorization
string
required
Bearer token for authentication. Format: Bearer <your-api-key>
environment
string
required
The environment slug to run tests against (e.g., production, staging).
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.
{
  "deployed_by": "alice",
  "ticket": "JIRA-1234"
}
environment_variables_overrides
array
Environment variables to override for this test run.

Response

data.trigger.success
boolean
Whether the test run was triggered successfully.
data.test_run
object
The created test run object.
curl -X PUT \
  https://dash.empirical.run/api/test-runs \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY" \
  -d '{
    "environment": "production"
  }'
{
  "data": {
    "trigger": {
      "success": true
    },
    "test_run": {
      "id": 456,
      "state": "queued",
      "test_run_branch": "main",
      "created_at": "2024-01-15T10:30:00.000Z"
    }
  }
}