> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sendora.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Analytics

> Pull campaign performance metrics via the Sendora API.

## Overview

The Analytics API gives you read-only access to campaign performance data, the same metrics that power the Sendora dashboard charts. Use it to:

* Pull performance data into your own BI tools (Metabase, Looker, Tableau, etc.)
* Build custom reporting dashboards
* Monitor campaigns programmatically and trigger actions on performance thresholds
* Export data to your CRM or data warehouse

## Workspace overview

```bash theme={"dark"}
GET /api/v1/public/analytics/overview
```

Returns aggregate metrics across your entire workspace for a given time range:

```json theme={"dark"}
{
  "period": {
    "from": "2026-06-01T00:00:00Z",
    "to": "2026-06-22T23:59:59Z"
  },
  "campaigns": {
    "total": 12,
    "active": 3,
    "completed": 8
  },
  "leads": {
    "total_enrolled": 4820,
    "contacted": 4102,
    "replied": 387,
    "meetings_booked": 64
  },
  "calls": {
    "total": 2904,
    "connected": 1841,
    "avg_duration_seconds": 187,
    "meeting_booked_rate": 0.034
  },
  "email": {
    "sent": 8441,
    "opened": 2112,
    "clicked": 430,
    "replied": 201,
    "open_rate": 0.25,
    "reply_rate": 0.024
  },
  "sms": {
    "sent": 1203,
    "replied": 89,
    "reply_rate": 0.074
  }
}
```

Supports `from` and `to` query params (ISO 8601):

```bash theme={"dark"}
GET /api/v1/public/analytics/overview?from=2026-06-01&to=2026-06-22
```

## All campaigns list

```bash theme={"dark"}
GET /api/v1/public/analytics/campaigns
```

Returns per-campaign summary metrics, sorted by most recently active:

```json theme={"dark"}
{
  "campaigns": [
    {
      "id": "camp_abc",
      "name": "Q3 Enterprise Outbound",
      "status": "running",
      "total_leads": 500,
      "contacted": 342,
      "replied": 28,
      "meetings_booked": 7,
      "reply_rate": 0.082,
      "meeting_rate": 0.020,
      "started_at": "2026-06-10T09:00:00Z"
    }
  ]
}
```

## Single campaign metrics

```bash theme={"dark"}
GET /api/v1/public/analytics/campaigns/{campaign_id}
```

Returns detailed per-channel breakdowns for one campaign:

```json theme={"dark"}
{
  "id": "camp_abc",
  "name": "Q3 Enterprise Outbound",
  "status": "running",
  "summary": {
    "total_leads": 500,
    "contacted": 342,
    "replied": 28,
    "meetings_booked": 7
  },
  "by_channel": {
    "voice": {
      "calls_placed": 342,
      "connected": 198,
      "connect_rate": 0.579,
      "avg_duration_seconds": 204,
      "meetings_booked": 5
    },
    "email": {
      "sent": 312,
      "delivered": 308,
      "opened": 87,
      "clicked": 14,
      "replied": 18,
      "open_rate": 0.282,
      "reply_rate": 0.058
    },
    "sms": {
      "sent": 194,
      "replied": 10,
      "reply_rate": 0.052
    }
  },
  "by_day": [
    {
      "date": "2026-06-10",
      "calls": 45,
      "emails": 40,
      "replies": 3,
      "meetings": 1
    }
  ],
  "a_b_variants": [
    {
      "variant_id": "var_a",
      "name": "Variant A, Question opener",
      "leads": 250,
      "reply_rate": 0.092
    },
    {
      "variant_id": "var_b",
      "name": "Variant B, Statement opener",
      "leads": 250,
      "reply_rate": 0.072
    }
  ]
}
```

## Usage patterns

### Sync to a data warehouse

```python theme={"dark"}
import httpx, datetime

client = httpx.Client(
    base_url="https://api.sendora.ai",
    headers={"X-API-Key": "sk_live_..."},
)

# Pull all active campaigns
campaigns = client.get("/api/v1/public/analytics/campaigns").json()["campaigns"]

rows = []
for camp in campaigns:
    detail = client.get(f"/api/v1/public/analytics/campaigns/{camp['id']}").json()
    rows.append({
        "campaign_id": camp["id"],
        "name": camp["name"],
        "reply_rate": camp["reply_rate"],
        "meeting_rate": camp["meeting_rate"],
        "synced_at": datetime.datetime.utcnow().isoformat(),
    })

# write rows to your data warehouse...
```

### Alert on underperforming campaigns

```python theme={"dark"}
campaigns = client.get("/api/v1/public/analytics/campaigns").json()["campaigns"]

for camp in campaigns:
    if camp["status"] == "running" and camp.get("contacted", 0) > 100:
        if camp.get("reply_rate", 1) < 0.02:
            # Under 2% reply rate after 100+ contacts, alert
            send_slack_alert(f"Campaign '{camp['name']}' reply rate is {camp['reply_rate']:.1%}: review messaging")
```

## Time ranges

All analytics endpoints support `from` and `to` query parameters in ISO 8601 format:

```
?from=2026-06-01T00:00:00Z&to=2026-06-22T23:59:59Z
```

Defaults to the last 30 days if omitted. Maximum range is 365 days.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.