Skip to main content
PUT
/
api
/
test-runs
Create Test Run
curl --request PUT \
  --url https://dash.empirical.run/api/test-runs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "environment": "<string>",
  "build": {
    "url": "<string>",
    "branch": "<string>",
    "commit": "<string>",
    "commit_url": "<string>",
    "version": "<string>"
  },
  "metadata": {},
  "environment_variables_overrides": [
    {
      "name": "<string>",
      "value": "<string>"
    }
  ],
  "tags": [
    "<string>"
  ]
}
'
{
  "data": {
    "trigger": {
      "success": true
    },
    "test_run": {
      "id": 456,
      "state": "queued",
      "test_run_branch": "main",
      "created_at": "2024-01-15T10:30:00.000Z"
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.empirical.run/llms.txt

Use this file to discover all available pages before exploring further.

Triggers a new test run for the specified project and environment.
{
  "data": {
    "trigger": {
      "success": true
    },
    "test_run": {
      "id": 456,
      "state": "queued",
      "test_run_branch": "main",
      "created_at": "2024-01-15T10:30:00.000Z"
    }
  }
}

Minimal request

curl -X PUT \
  https://dash.empirical.run/api/test-runs \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY" \
  -d '{
    "environment": "production"
  }'

With build info

curl -X PUT \
  https://dash.empirical.run/api/test-runs \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY" \
  -d '{
    "environment": "production",
    "build": {
      "url": "https://app.example.com",
      "branch": "main",
      "commit": "abc123",
      "commit_url": "https://github.com/org/repo/commit/abc123"
    },
    "metadata": {
      "deployed_by": "alice"
    }
  }'

With environment variables

curl -X PUT \
  https://dash.empirical.run/api/test-runs \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY" \
  -d '{
    "environment": "staging",
    "environment_variables_overrides": [
      { "name": "BASE_URL", "value": "https://staging.example.com" }
    ]
  }'

With tags

curl -X PUT \
  https://dash.empirical.run/api/test-runs \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY" \
  -d '{
    "environment": "production",
    "tags": ["@smoke", "@critical"]
  }'

Authorizations

Authorization
string
header
required

Project API key from the Empirical dashboard.

Body

application/json

Test run to create.

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.

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.

Response

Created test run.

data
object
required