# Get a workflow's analytics

```http
GET https://trydimmi.com/api/v1/workflows/{workflow}/metrics
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `workflows:read`.

## Path parameters

- `workflow` (string, required): Id of the workflow, starting with wf_, such as wf_01jx2m8k4t. Find it with GET /workflows.

## Query parameters

- `from` (string): First day, YYYY-MM-DD; 30 days ago when left out.
- `to` (string): Last day, YYYY-MM-DD.
- `version` (integer): Only runs on this published version number; 0 counts every version.

## Response 200 (OK)

- `data` (object, required)
  - `active` (integer, required): Runs in the range still running or waiting.
  - `completed` (integer, required): Runs in the range that reached the end of their path.
  - `days` (object[] | null, required): Runs started, completed and failed per day of the range.
    - `completed` (integer, required): Runs started that day that completed.
    - `day` (string, required): The day, as YYYY-MM-DD in UTC.
    - `failed` (integer, required): Runs started that day that failed.
    - `triggered` (integer, required): Runs started that day.
  - `engaged` (integer, required): Runs in the range where the customer wrote while the run went on.
  - `failed` (integer, required): Runs in the range that failed, or where a step failed.
  - `from` (string, required): The first moment the numbers count.
  - `goal` (object, required)
    - `kind` (string, required): What counts as the workflow working: resolved (closed with no teammate reply or handover) or csat (rated at least min_rating).
    - `min_rating` (integer | null, required): With csat, the lowest rating that counts, 1 to 5. Null otherwise.
    - `window` (string, required): How long after the run starts the goal may be reached, such as 7d.
  - `goal_met` (integer | null, required): Runs in the range whose conversation reached the workflow's goal. Null when the workflow has no goal.
  - `handed_over` (integer, required): Runs in the range that handed the conversation to a person.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `steps` (object, required): Each step's numbers, by step id: reached, waiting now, failed, dropped and paths taken.
  - `to` (string, required): The moment the numbers stop counting.
  - `triggered` (integer, required): Runs that started in the range and did something. Test conversations never count.
  - `version` (integer | null, required): The published version the numbers count. Null when they count every version.
  - `workflow_id` (string, required): The workflow the numbers are about, such as wf_....

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request GET \
  --url 'https://trydimmi.com/api/v1/workflows/{workflow}/metrics' \
  --header 'Authorization: Bearer <token>'
```

## Example response

```json
{
  "data": {
    "active": 123,
    "completed": 123,
    "days": [
      {
        "completed": 123,
        "day": "2026-11-01T09:30:00Z",
        "failed": 123,
        "triggered": 123
      }
    ],
    "engaged": 123,
    "failed": 123,
    "from": "2026-11-01T09:30:00Z",
    "goal": {
      "kind": "<string>",
      "min_rating": 123,
      "window": "<string>"
    },
    "goal_met": 123,
    "handed_over": 123,
    "object": "<string>",
    "steps": {
      "<key>": {
        "dropped": 123,
        "failed": 123,
        "paths": {
          "<key>": 123
        },
        "reached": 123,
        "variants": {
          "<key>": {}
        },
        "waiting": 123
      }
    },
    "to": "2026-11-01T09:30:00Z",
    "triggered": 123,
    "version": 123,
    "workflow_id": "<string>"
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
