---
title: "Query account execution seconds"
method: GET
path: "/accounts/{account_id}/reports/usage/executionSeconds"
tags: ["Reporting"]
---

# Query account execution seconds

`GET /accounts/{account_id}/reports/usage/executionSeconds`

Same as `/workspaces/{workspace_id}/reports/usage/executionSeconds` but aggregates across every active workspace the authenticated caller has access to within the account. Use this for account-wide billing or utilization reports, or pair with `group_by=workspace` to produce a per-workspace breakdown of execution seconds.

Scope to one workspace by passing its identifier as the `workspace_id` query parameter; the caller must have access to that workspace. All filter, granularity, `group_by`, and time-range rules are identical to the workspace-level endpoint. All timestamps are Unix epoch milliseconds.

## Path parameters

- `account_id` string, required

## Query parameters

- `start_time` integer, required
- `end_time` integer, required
- `granularity` 'daily' | 'weekly' | 'monthly', required
- `group_by` 'workspace' | 'plan' | 'application'
- `application_id` string
- `plan_id` string
- `test_type` 'api' | 'browser' | 'mobile' | 'performance'
- `workspace_id` string

## Response `200`

Execution time grouped by time buckets

- UsageExecutionSecondsResponse — Response payload for the execution seconds endpoint. Contains the resolved query range, granularity, and `group_by` dimension, plus one `time_buckets` entry per (time period, group_id) combination with at least one completed run.
  - `start_time` integer — Inclusive start of the queried time range as Unix epoch milliseconds, echoed from the request.
  - `end_time` integer — Exclusive end of the queried time range as Unix epoch milliseconds, echoed from the request.
  - `granularity` 'daily' | 'weekly' | 'monthly' — Time bucket size used for grouping test run results. `daily` aligns buckets to midnight UTC. `weekly` aligns to Monday 00:00 UTC of each ISO-8601 week. `monthly` aligns to the first day of each calendar month at 00:00 UTC.
  - `group_by` 'workspace' | 'plan' | 'application' — Dimension applied to break usage report results down by. `plan` emits one bucket per (time period, plan_id); `application` emits one bucket per (time period, application_id); `workspace` emits one bucket per (time period, workspace_id) and only appears on account-level responses.
  - `time_buckets` UsageExecutionSecondsBucket[] — Time-bucketed execution second results. Ordered by `bucket_start_time` ascending, then `group_id` ascending when `group_by` is set. Buckets with zero matching completed runs are omitted.
    - `bucket_start_time` integer — Inclusive start of the time bucket as Unix epoch milliseconds. Aligned to midnight UTC, Monday 00:00 UTC, or first-of-month 00:00 UTC per the selected granularity.
    - `bucket_end_time` integer — Exclusive end of the time bucket as Unix epoch milliseconds. Equal to the `bucket_start_time` of the following period for that bucket size.
    - `group_id` string — ID of the grouping dimension value. Only present when the request specifies `group_by`; omitted otherwise. The value is a plan ID when `group_by=plan`, an application ID when `group_by=application`, or a workspace ID when `group_by=workspace` (account-level endpoints only). Without `group_by` you get one bucket per time period; with `group_by` you get one bucket per (time period x dimension value), so consumers can break down counts or minutes by plan, application, or workspace.
    - `group_name` string — Human-readable name of the group corresponding to `group_id`. Populated on a best-effort basis — may be absent for deleted or otherwise unresolvable entities. Not guaranteed unique; use `group_id` for joins.
    - `total_execution_seconds` integer — Sum of (end_time - start_time) in whole seconds across every completed run whose `start_time` falls within the bucket. Measures time spent executing, not time queued. In-flight runs are excluded.
    - `total_test_runs` integer — Number of completed runs contributing to `total_execution_seconds`. Excludes in-flight runs. This is NOT the same as the equivalent field on `testRunCounts`, which includes in-flight runs.

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `default` — Unknown 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)
