---
title: "Query account quality metrics over a date range"
method: GET
path: "/accounts/{account_id}/reports/qualityMetrics/daily"
tags: ["Report"]
---

# Query account quality metrics over a date range

`GET /accounts/{account_id}/reports/qualityMetrics/daily`

Retrieve daily test-run and plan-run quality metrics (total/passed/failed/stopped/retried counts) across workspaces in an account. Backed by the precomputed workspace_quality_metric_daily fact table, populated daily by the event-metric-aggregator cron. Only accessible by company admins.

## Path parameters

- `account_id` string, required

## Query parameters

- `metric_names` string
- `start_date` string
- `end_date` string
- `workspace_ids` string

## Response `200`

Quality metric series for the account over the date range

- AccountQualityMetricsDailyResult — Daily quality metric breakdowns across workspaces in an account, with status sub-counts
  - `account_id` string — The account ID
  - `start_date` string, date — Inclusive start of the date range (YYYY-MM-DD)
  - `end_date` string, date — Inclusive end of the date range (YYYY-MM-DD)
  - `series` QualityMetricSeries[] — One entry per metric name, ordered by metric_name
    - `metric_name` string — Stable identifier for the metric (e.g. test_runs_executed, plan_runs_executed)
    - `buckets` QualityMetricBucket[] — One bucket per calendar day in the range. Days with zero events across all in-scope workspaces are omitted (sparse encoding).
      - `date` string, date — Calendar day for this bucket (YYYY-MM-DD)
      - `total` integer — Sum of total_count across all in-scope workspace+test_type rows for the day
      - `passed` integer — Sum of passed_count across all in-scope workspace+test_type rows for the day
      - `failed` integer — Sum of failed_count across all in-scope workspace+test_type rows for the day
      - `stopped` integer — Sum of stopped_count across all in-scope workspace+test_type rows for the day
      - `retried` integer — Sum of retried_count across all in-scope workspace+test_type rows for the day
      - `by_workspace` WorkspaceQualityMetricCount[] — Per-workspace contribution to this bucket. Workspaces with zero total for the day are omitted. Status sub-counts within each workspace are summed across test_type sub-rows.
        - `workspace_id` string — The workspace ID
        - `workspace_name` string — The workspace name
        - `total` integer — Total runs for this workspace on this day
        - `passed` integer — Passed runs
        - `failed` integer — Failed runs
        - `stopped` integer — Stopped (terminated mid-run) runs
        - `retried` integer — Runs that were part of a retry
        - `by_test_type` QualityMetricByTestType[] — Optional sub-breakdown by test_type (browser / api / mobile). Present when the underlying metric is sub-keyed by test_type; omitted otherwise.
          - `test_type` string — browser | api | mobile
          - `total` integer
          - `passed` integer
          - `failed` integer
          - `stopped` integer
          - `retried` integer

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized (not a company admin)
- `default` — Unexpected error

---

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