Skip to main content
POST
/
api
/
v2
/
analytics
/
test-case-history
/
batch
Test Case History (Batch)
curl --request POST \
  --url https://dash.empirical.run/api/v2/analytics/test-case-history/batch \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "test_case_ids": [
    "<string>"
  ],
  "project_id": "<string>",
  "days": 123,
  "start_date": "<string>",
  "end_date": "<string>",
  "environment_id": "<string>",
  "limit_per_test_case": 123
}
'
{
  "data": {
    "history_by_test_case_id": {
      "abc-123-def": [
        {
          "timestamp": "2025-02-01T10:30:00Z",
          "status": "pass",
          "test_run_id": "12345",
          "environment_id": "1",
          "executed_at": "2025-02-01T10:30:00.000Z",
          "duration_total": 5200,
          "retries": 0
        },
        {
          "timestamp": "2025-01-31T10:30:00Z",
          "status": "fail",
          "test_run_id": "12344",
          "environment_id": "1",
          "executed_at": "2025-01-31T10:30:00.000Z",
          "duration_total": 4800,
          "retries": 1
        }
      ]
    }
  }
}

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.

Returns full per-execution history for one or many test cases in a single request. Pair this with GET /api/v2/analytics/test-cases (which omits history) to keep the table query fast and only load history for the rows you actually need.
{
  "data": {
    "history_by_test_case_id": {
      "abc-123-def": [
        {
          "timestamp": "2025-02-01T10:30:00Z",
          "status": "pass",
          "test_run_id": "12345",
          "environment_id": "1",
          "executed_at": "2025-02-01T10:30:00.000Z",
          "duration_total": 5200,
          "retries": 0
        },
        {
          "timestamp": "2025-01-31T10:30:00Z",
          "status": "fail",
          "test_run_id": "12344",
          "environment_id": "1",
          "executed_at": "2025-01-31T10:30:00.000Z",
          "duration_total": 4800,
          "retries": 1
        }
      ]
    }
  }
}

Fetch history for several test cases

curl -X POST \
  "https://dash.empirical.run/api/v2/analytics/test-case-history/batch" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "test_case_ids": ["abc-123-def", "ghi-456-jkl"],
    "project_id": "20",
    "days": 30,
    "limit_per_test_case": 50
  }'

Filter by environment and custom date range

curl -X POST \
  "https://dash.empirical.run/api/v2/analytics/test-case-history/batch" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "test_case_ids": ["abc-123-def"],
    "project_id": "20",
    "start_date": "2025-01-01T00:00:00.000Z",
    "end_date": "2025-02-01T00:00:00.000Z",
    "environment_id": "42"
  }'

Authorizations

Authorization
string
header
required

Project API key from the Empirical dashboard.

Body

application/json

Test cases and date window to fetch history for.

test_case_ids
string[]
required

Test case IDs to fetch history for. Must be a non-empty array.

project_id
string
required

Project ID the test cases belong to.

days
number

Number of days of history (1-90, default 30). Ignored if start_date and end_date are provided.

start_date
string

Start of custom date range (ISO 8601). Must be used together with end_date.

end_date
string

End of custom date range (ISO 8601). Must be used together with start_date.

environment_id
string

Filter by environment ID.

limit_per_test_case
number

Maximum history entries returned per test case (1-200, default 50).

Response

History entries grouped by test case ID.

data
object
required