Skip to main content
GET
/
api
/
test-runs
curl -X GET \
  "https://dash.empirical.run/api/test-runs" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY"
{
  "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"
        }
      ],
      "total": 150,
      "limit": 20,
      "offset": 0
    }
  }
}
Retrieves a paginated list of test runs for a project with optional filtering by branch, state, result, and environment.

Request

Authorization
string
required
Bearer token for authentication. Format: Bearer <your-api-key>
limit
number
default:20
Maximum number of test runs to return. Must be between 1 and 100.
offset
number
default:0
Number of test runs to skip for pagination.
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

data.test_runs
object
Paginated test runs response.
curl -X GET \
  "https://dash.empirical.run/api/test-runs" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY"
{
  "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"
        }
      ],
      "total": 150,
      "limit": 20,
      "offset": 0
    }
  }
}