# Retrieve a flow's analytics

`GET https://api.morevoice.ai/v1/flows/{id}/analytics`

How this key's mode's calls went through the flow (the latest 5000 in the range): visits, calls, drop-off, caller turns and errors per node, how often each transition was taken, how calls ended, and IVR KPIs for IVR flows. Filter by `from` / `to` (start time) and a published `version`.

Authenticate with a secret API key: `Authorization: Bearer $MOREVOICE_API_KEY`.

Operation ID: `flows_retrieve_analytics`.

## Parameters

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | A flow ID (`flow_…`). |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | `string` | no | Calls that started at or after this time (ISO 8601). |
| `to` | `string` | no | Calls that started at or before this time (ISO 8601). |
| `version` | `string` | no | Only calls that ran this published version. |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `MoreVoice-Version` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |

## Responses

### 200 OK

OK Returns `FlowAnalytics`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"flow_analytics"` | — |
| `flow_id` | `string` | A flow ID (prefix `flow_`). |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `from` | `string \| null` | — |
| `to` | `string \| null` | — |
| `version` | `integer \| null` | — |
| `calls` | `integer` | Calls that ran the flow in the range (at most the latest 5000). |
| `nodes` | `object[]` | — |
| `transitions` | `object[]` | — |
| `ends` | `object[]` | — |
| `ivr` | `object \| null` | IVR flows: containment, abandon rate, keypad vs speech, per menu. |
| `ivr.calls` | `integer` | — |
| `ivr.containment` | `number` | — |
| `ivr.abandon_rate` | `number` | — |
| `ivr.avg_ivr_ms` | `number` | — |
| `ivr.dtmf_share` | `number` | — |
| `ivr.speech_share` | `number` | — |
| `ivr.invalid_rate` | `number` | — |
| `ivr.no_input_rate` | `number` | — |
| `ivr.by_menu` | `object[]` | — |
| `ivr.exits` | `object[]` | — |

Example:

```json
{
  "calls": 120,
  "ends": [
    {
      "calls": 98,
      "reason": "flow-ended"
    },
    {
      "calls": 22,
      "reason": "customer-hangup"
    }
  ],
  "flow_id": "flow_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8",
  "from": "2026-11-01T00:00:00.000Z",
  "ivr": null,
  "livemode": true,
  "nodes": [
    {
      "avg_turns": 0.2,
      "calls": 120,
      "drop_off": 4,
      "errors": 0,
      "node_key": "start",
      "node_type": "start",
      "visits": 120
    },
    {
      "avg_turns": 1.4,
      "calls": 116,
      "drop_off": 9,
      "errors": 0,
      "node_key": "ask_id",
      "node_type": "question",
      "visits": 131
    }
  ],
  "object": "flow_analytics",
  "to": null,
  "transitions": [
    {
      "node_key": "start",
      "rate": 0.967,
      "taken": 116,
      "transition_key": "t_next"
    }
  ],
  "version": null
}
```

### 400 Bad Request

The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown. Returns `ErrorEnvelope`.

### 401 Unauthorized

No valid API key was sent. Returns `ErrorEnvelope`.

### 403 Forbidden

The key may not do this (a missing scope, a plan limit, or a compliance block). Returns `ErrorEnvelope`.

### 404 Not Found

No object with this ID exists in this organisation and mode. Returns `ErrorEnvelope`.

### 429 Too Many Requests

Too many requests, or no call capacity right now. Retry after the Retry-After delay. Returns `ErrorEnvelope`.

### 500 Internal Server Error

Something went wrong on MoreVoice's side. Retry with the same Idempotency-Key. Returns `ErrorEnvelope`.

## Code samples

**TypeScript**

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

const flowAnalytics = await mv.flows.retrieveAnalytics("flow_7Hk2Lm9Qp");
console.log(flowAnalytics);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

flow_analytics = client.flows.retrieve_analytics("flow_7Hk2Lm9Qp")
print(flow_analytics)
```

**cURL**

```sh
curl https://api.morevoice.ai/v1/flows/flow_7Hk2Lm9Qp/analytics \
  -H "Authorization: Bearer $MOREVOICE_API_KEY"
```
