> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.voicebip.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.voicebip.com/_mcp/server.

# Analytics

> Track call resolution rates, voice quality (MOS), and conversation trends across your workspace.

The analytics endpoint provides aggregated metrics across all agents in your workspace. Use it to track resolution rates, voice quality, and call volume trends.

## Get Analytics

```bash
curl "https://api.voicebip.com/v1/analytics?days=7" \
  -H "Authorization: Bearer pk_live_your_key"
```

### Query Parameters

| Parameter | Type    | Default | Description                                       |
| --------- | ------- | ------- | ------------------------------------------------- |
| `days`    | integer | 7       | Lookback period. Allowed values: `7`, `30`, `90`. |

### Response

```json
{
  "total_calls": 142,
  "calls_per_day": [
    { "date": "2026-04-04", "count": 18 },
    { "date": "2026-04-05", "count": 22 },
    { "date": "2026-04-06", "count": 15 },
    { "date": "2026-04-07", "count": 25 },
    { "date": "2026-04-08", "count": 20 },
    { "date": "2026-04-09", "count": 21 },
    { "date": "2026-04-10", "count": 21 }
  ],
  "resolution_rate": 0.82,
  "average_duration_seconds": 187.5,
  "average_mos": 4.1
}
```

## Metrics Explained

### Resolution Rate

Voicebip automatically classifies each completed call as `resolved` or `unresolved` using AI analysis of the conversation transcript. Classification happens asynchronously via a NATS consumer on `call.completed` events.

The `resolution_rate` is the ratio of resolved calls to total classified calls (0.0 to 1.0).

### Mean Opinion Score (MOS)

Voice quality is estimated using the E-model from voice pipeline RTP statistics:

* **Jitter** - Variation in packet arrival time
* **Packet loss** - Percentage of lost RTP packets
* **RTT** - Round-trip time to the caller

| MOS Range | Quality   |
| --------- | --------- |
| 4.0 - 5.0 | Excellent |
| 3.5 - 4.0 | Good      |
| 3.0 - 3.5 | Fair      |
| 2.5 - 3.0 | Poor      |
| 1.0 - 2.5 | Bad       |

MOS is tracked per-call and aggregated per-MNO for network quality monitoring.

### Sentiment Trend

> **Note**
>
> Sentiment trend analysis is not yet available. This field is planned for a future release. The current response includes call volume, resolution rate, and voice quality (MOS) metrics.

## Call-Level Quality Data

Individual calls include quality fields in the `GET /v1/calls/{call_id}` response:

```json
{
  "call_id": "call_abc123",
  "quality_mos": 4.2,
  "resolution": "resolved",
  "classified_at": "2026-04-10T14:30:00Z",
  "recording_url": "/v1/calls/call_abc123/recording"
}
```

## Conversation Export

Download all conversation data for an agent as CSV or JSON:

```bash
# JSON format
curl "https://api.voicebip.com/v1/agents/{agent_id}/conversations/export?format=json" \
  -H "Authorization: Bearer pk_live_your_key" \
  --output conversations.json

# CSV format
curl "https://api.voicebip.com/v1/agents/{agent_id}/conversations/export?format=csv" \
  -H "Authorization: Bearer pk_live_your_key" \
  --output conversations.csv
```

The CSV includes columns: `call_id`, `from_number`, `to_number`, `direction`, `status`, `duration_seconds`, `created_at`, `transcript_text`.