Skip to main content
GET
/
api
/
test-runs
List Test Runs
curl --request GET \
  --url https://dash.empirical.run/api/test-runs \
  --header 'Authorization: Bearer <token>'
{
  "data": {
    "test_runs": {
      "items": [
        {
          "id": 456,
          "state": "ended",
          "total_count": 50,
          "success_count": 48,
          "failed_count": 2,
          "skipped_count": 0,
          "flaky_count": 1,
          "duration": 120000,
          "test_run_branch": "main",
          "environment_slug": "production",
          "environment_name": "Production",
          "build_url": "https://app.example.com",
          "build_branch": "main",
          "commit": "abc123",
          "created_at": "2024-01-15T10:30:00.000Z"
        },
        {
          "id": 455,
          "state": "ended",
          "total_count": 50,
          "success_count": 50,
          "failed_count": 0,
          "duration": 115000,
          "test_run_branch": "main",
          "environment_slug": "production",
          "environment_name": "Production",
          "created_at": "2024-01-14T10:30:00.000Z"
        }
      ]
    }
  },
  "pagination": {
    "page": 1,
    "per_page": 20,
    "total": 150,
    "total_pages": 8
  }
}
Retrieves a paginated list of test runs for a project with optional filtering by branch, state, result, and environment.
{
  "data": {
    "test_runs": {
      "items": [
        {
          "id": 456,
          "state": "ended",
          "total_count": 50,
          "success_count": 48,
          "failed_count": 2,
          "skipped_count": 0,
          "flaky_count": 1,
          "duration": 120000,
          "test_run_branch": "main",
          "environment_slug": "production",
          "environment_name": "Production",
          "build_url": "https://app.example.com",
          "build_branch": "main",
          "commit": "abc123",
          "created_at": "2024-01-15T10:30:00.000Z"
        },
        {
          "id": 455,
          "state": "ended",
          "total_count": 50,
          "success_count": 50,
          "failed_count": 0,
          "duration": 115000,
          "test_run_branch": "main",
          "environment_slug": "production",
          "environment_name": "Production",
          "created_at": "2024-01-14T10:30:00.000Z"
        }
      ]
    }
  },
  "pagination": {
    "page": 1,
    "per_page": 20,
    "total": 150,
    "total_pages": 8
  }
}

Basic list

curl -X GET \
  "https://dash.empirical.run/api/test-runs" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY"

With filters

curl -X GET \
  "https://dash.empirical.run/api/test-runs?state=ended&result=failed&per_page=10" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY"

Pagination

curl -X GET \
  "https://dash.empirical.run/api/test-runs?per_page=20&page=3" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY"

Filter by branch

curl -X GET \
  "https://dash.empirical.run/api/test-runs?branch=feature/login" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY"

Authorizations

Authorization
string
header
required

API key from the Empirical dashboard.

Query Parameters

page
number

Page number (1-indexed, default 1).

per_page
number

Items per page (default 20, max 100).

branch
string

Filter by Git branch name.

state
string

Filter by test run state. One of: pending, queued, started, ended, error, cancelled, cancelling.

result
string

Filter by test result. One of: passed, failed.

environment_ids
string

Comma-separated list of environment IDs to filter by.

interval_in_days
number

Only return runs from the last N days.

Response

Paginated list of test runs.

data
object
required
pagination
object
required