---
title: "Get aggregated run success metrics for a workflow"
method: GET
path: "/v4/workflows/{workflowId}/history/metrics"
tags: ["Workflows"]
---

# Get aggregated run success metrics for a workflow

`GET /v4/workflows/{workflowId}/history/metrics`

## Request

- Base URL: `https://api.kadoa.com`
- URL: `https://api.kadoa.com/v4/workflows/{workflowId}/history/metrics`
- Auth: API key in header `x-api-key`

Per-day successful/failed run counts and the overall success rate over the requested window, aggregated over all runs (not paginated). Days are bucketed by the run's finish date in UTC.

## Path parameters

- `workflowId` string, required

## Query parameters

- `days` integer

## Response `200`

Aggregated run metrics for the workflow

- object
  - `workflowId` string: Unique identifier of the workflow
  - `windowStart` string, date-time: Inclusive start of the aggregation window
  - `windowEnd` string, date-time: Exclusive end of the aggregation window
  - `totalRuns` integer: Number of terminal (finished or failed) runs in the window
  - `successfulRuns` integer: Number of finished runs in the window
  - `failedRuns` integer: Number of failed runs in the window
  - `successRatePercentage` number, nullable: successfulRuns / totalRuns as a percentage, null when the window has no terminal runs
  - `daily` object[]: Per-day buckets (UTC, by run finish date); days without terminal runs are omitted
    - `date` string, date: UTC calendar day of the bucket
    - `successfulRuns` integer
    - `failedRuns` integer
    - `uptimePercentage` number: successfulRuns / (successfulRuns + failedRuns) for the day as a percentage

## Other responses

- `400`: Invalid workflow ID or days parameter
- `401`: Unauthorized access, either due to missing or invalid x-api-key
- `404`: Workflow with the specified ID could not be found
- `500`: Internal server error

---

[API](https://skmtc.dev/kadoa/apis/kadoa-api.md) · [All operations](https://skmtc.dev/kadoa/apis/kadoa-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kadoa/apis/kadoa-api/revisions/bf7803c927b4?raw)
