# Callback statistics

`GET https://api.morevoice.ai/v1/callbacks/stats`

Totals for callbacks requested in a period (default: the last 7 days): outcomes, SLA, time to return, by source and by agent.

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

Operation ID: `callbacks_stats`.

## Parameters

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | `string` | no | Start of the period (default: 7 days before `to`). |
| `to` | `string` | no | End of the period (default: now). |
| `queue_id` | `string` | no | A queue ID (`q_…`). |

### 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 `CallbackStats`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"callback_stats"` | — |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `from` | `string` | An ISO-8601 timestamp in UTC. |
| `to` | `string` | An ISO-8601 timestamp in UTC. |
| `total` | `integer` | Requests in the period. |
| `open` | `integer` | — |
| `completed` | `integer` | — |
| `failed` | `integer` | — |
| `expired` | `integer` | — |
| `cancelled` | `integer` | — |
| `within_sla` | `integer` | Completed within their SLA target. |
| `breached_open` | `integer` | Still open past their SLA target. |
| `sla_rate` | `number \| null` | within_sla / completed; null with nothing completed. |
| `avg_return_ms` | `integer \| null` | Average time from request to completion. |
| `attempts` | `integer` | — |
| `by_source` | `object[]` | — |
| `by_agent` | `object[]` | — |

Example:

```json
{
  "attempts": 51,
  "avg_return_ms": 1860000,
  "breached_open": 1,
  "by_agent": [
    {
      "agent_id": "usr_4Gk2LmN9pQ4rS6tV8wX0yZ",
      "count": 12
    }
  ],
  "by_source": [
    {
      "completed": 24,
      "count": 30,
      "source": "queue"
    }
  ],
  "cancelled": 1,
  "completed": 31,
  "expired": 2,
  "failed": 3,
  "from": "2026-10-27T09:00:00.000Z",
  "livemode": true,
  "object": "callback_stats",
  "open": 5,
  "sla_rate": 0.871,
  "to": "2026-11-03T09:00:00.000Z",
  "total": 42,
  "within_sla": 27
}
```

### 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`.

### 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 callbackStats = await mv.callbacks.stats();
console.log(callbackStats);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

callback_stats = client.callbacks.stats()
print(callback_stats)
```

**cURL**

```sh
curl https://api.morevoice.ai/v1/callbacks/stats \
  -H "Authorization: Bearer $MOREVOICE_API_KEY"
```
