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>"
    }
  ]
}
'
{
  "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.
{
  "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" }
    ]
  }'

Authorizations

Authorization
string
header
required

API key from the Empirical dashboard.

Body

application/json

Test run to create.

environment
string
required
build
object
metadata
object
environment_variables_overrides
object[]

Response

Created test run.

data
object
required