---
title: "Test cases"
method: GET
path: "/v1/insights/test-cases"
tags: ["Insights"]
---

# Test cases

`GET /v1/insights/test-cases`

Groups your test runs by test name and returns per-test statistics: total runs, success/failure/unknown counts, pass rate, a flaky flag (both passes and failures seen), and average duration in seconds. Sort by total (default), pass_rate, failure, flaky or avg_duration. Paginated with offset/count.

## Query parameters

- `start` string
- `end` string
- `time_range` string
- `status` 'all' | 'success' | 'failure' | 'unknown'
- `browser` integer[]
- `build` integer[]
- `group_ids` integer[]
- `team` integer[]
- `name` string
- `sort` 'total' | 'pass_rate' | 'failure' | 'flaky' | 'avg_duration'
- `sort_order` 'asc' | 'desc'
- `offset` integer
- `count` integer

## Response `200`

Test cases

- TestingbotEntitiesInsightTestCaseList — Testingbot_Entities_InsightTestCaseList model
  - `data` TestingbotEntitiesInsightTestCase[], required — Per-test-name statistics.
    - `name` string, required — Test name.
    - `total` integer, required — Total runs of this test.
    - `success` integer, required — Passed runs.
    - `failure` integer, required — Failed runs.
    - `unknown` integer, required — Unknown-status runs.
    - `pass_rate` number, required — success / total, 0..1.
    - `flaky` boolean, required — True when the test both passed and failed in the period.
    - `avg_duration` number, required — Average run time in seconds; null if not computable.
  - `meta` TestingbotEntitiesInsightTestCaseMeta, required
    - `start` string, date-time, required — Period start (ISO-8601, UTC).
    - `end` string, date-time, required — Period end (ISO-8601, UTC).
    - `total` integer, required — Distinct test names matching the filters.
    - `offset` integer, required — Items skipped.
    - `count` integer, required — Items returned in this page.
    - `sort` string, required — Sort field applied.
    - `sort_order` string, required — Sort direction applied.

## Other responses

- `400` — Invalid parameters
- `401` — Authentication required
- `403` — Permission denied

---

[API](https://skmtc.net/testingbot/apis/testingbot-rest-api.md) · [All operations](https://skmtc.net/testingbot/apis/testingbot-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/testingbot/testingbot-rest-api/revisions/eff607a49246/schema)
