# Retrieve per-step journey statistics

`GET /v1/journeys/{id}/step-stats`

Requires an API key with the `journeys:read` scope. [About keys and scopes](/docs/api/authentication)

Counters broken down by step, showing where contacts are accumulating or dropping out, with the email and push messages each send step created.

## Path parameters

- `id` (string, required, uuid)

## Query parameters

- `definitionId` (string, optional) — A version of the steps, from the journey definitions list; defaults to the current one.

## Returns

Returns `200 OK` with a `JourneyStepStats` in `data`. Otherwise returns an error; [Errors](/docs/api/errors) lists every code and which to retry.

- `definitionId` (string, required) — The version of the steps these counters are for.
- `matchesCurrentSteps` (boolean, required) — Whether that version is the journey's current steps.
- `checkedAt` (string, required, date-time) — When the counters were read.
- `enrollmentCount` (integer, required, min 0, max 9007199254740991) — Runs that followed this version.
- `steps` (object[], required, at most 50 items)
  - `stepIndex` (integer, required, min 0, max 9007199254740991) — Index of the step in `steps`.
  - `type` (string, required, one of `wait`, `wait_until`, `digest`, `send`, `branch`, `filter`, `split`, `action`) — The step type.
  - `scheduled` (integer, required, min 0, max 9007199254740991) — Runs waiting to act on this step.
  - `active` (integer, required, min 0, max 9007199254740991) — Runs on this step now.
  - `completedHere` (integer, required, min 0, max 9007199254740991) — Runs that finished the journey at this step.
  - `exitedHere` (integer, required, min 0, max 9007199254740991) — Runs that were ended early while on this step.
  - `email` (object, required) — Email messages this step created, by status; zero for other steps.
    - `created` (integer, required, min 0, max 9007199254740991)
    - `queued` (integer, required, min 0, max 9007199254740991)
    - `sending` (integer, required, min 0, max 9007199254740991)
    - `failed` (integer, required, min 0, max 9007199254740991)
    - `skipped` (integer, required, min 0, max 9007199254740991)
    - `sent` (integer, required, min 0, max 9007199254740991)
    - `delivered` (integer, required, min 0, max 9007199254740991)
    - `opened` (integer, required, min 0, max 9007199254740991)
    - `clicked` (integer, required, min 0, max 9007199254740991)
  - `push` (object, required) — Push messages this step created, by status. No `delivered`: push services report acceptance, not arrival.
    - `created` (integer, required, min 0, max 9007199254740991)
    - `queued` (integer, required, min 0, max 9007199254740991)
    - `sending` (integer, required, min 0, max 9007199254740991)
    - `failed` (integer, required, min 0, max 9007199254740991)
    - `skipped` (integer, required, min 0, max 9007199254740991)
    - `sent` (integer, required, min 0, max 9007199254740991)
    - `opened` (integer, required, min 0, max 9007199254740991)
    - `clicked` (integer, required, min 0, max 9007199254740991)
  - `conversions` (object[], required) — Conversions credited to this step's messages, per goal; empty for others.
    - `goalId` (string, required, uuid) — The conversion goal.
    - `count` (integer, required, min 0, max 9007199254740991) — Conversions credited to this step.
    - `value` (number | null, required) — The goal's value total, in its currency; `null` when it names no value.

## Example

```bash
curl https://api.kirora.io/v1/journeys/018f2a4e-6b1c-7d3e-9f40-37386ae05a6b/step-stats \
  -H "Authorization: Bearer $KIRORA_API_KEY"
```

Response `200`:

```json
{
  "data": {
    "definitionId": "definitionId_example",
    "matchesCurrentSteps": true,
    "checkedAt": "2030-03-14T09:30:00Z",
    "enrollmentCount": 0,
    "steps": [
      {
        "stepIndex": 0,
        "type": "wait",
        "scheduled": 0,
        "active": 0,
        "completedHere": 0,
        "exitedHere": 0,
        "email": {
          "created": 0,
          "queued": 0,
          "sending": 0,
          "failed": 0,
          "skipped": 0,
          "sent": 0,
          "delivered": 0,
          "opened": 0,
          "clicked": 0
        },
        "push": {
          "created": 0,
          "queued": 0,
          "sending": 0,
          "failed": 0,
          "skipped": 0,
          "sent": 0,
          "opened": 0,
          "clicked": 0
        },
        "conversions": [
          {
            "goalId": null,
            "count": null,
            "value": null
          }
        ]
      }
    ]
  }
}
```
