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

# SMS Analytics

> Understand team-wide SMS delivery performance and country distribution.

Use `GET /sms/analytics` to retrieve team-wide SMS delivery analytics.

```bash theme={null}
curl --request GET \
  --url https://api.dugble.com/sms/analytics \
  --header "Authorization: Bearer $DUGBLE_API_KEY" \
  --header "Accept: application/json"
```

A successful request returns `200 OK`:

```json theme={null}
{
  "success": true,
  "data": {
    "object": "sms.analytics",
    "windows": [
      {
        "days": 7,
        "rates": [
          { "name": "delivery_rate", "value": 0.98 },
          { "name": "failure_rate", "value": 0.02 }
        ],
        "series": [
          {
            "date": "2026-08-25",
            "total": 100,
            "delivered": 98,
            "failed": 2
          }
        ]
      }
    ],
    "delivery_by_country": [
      {
        "country": "GH",
        "total": 100,
        "delivered": 98,
        "failed": 2
      }
    ]
  }
}
```

## Windows

Dugble returns fixed 7-day, 30-day, and 90-day windows. Each window includes aggregate rates and a daily series.

| Rate            | Calculation       |
| --------------- | ----------------- |
| `delivery_rate` | delivered / total |
| `failure_rate`  | failed / total    |

The failed count includes terminal failure outcomes such as `undelivered`, `rejected`, `failed`, and `expired`.

## Delivery by country

`delivery_by_country` summarizes SMS traffic from the most recent 90 days, grouped by destination country. Each item contains `country`, `total`, `delivered`, and `failed`.

Dugble returns up to 25 country groups, ordered by message volume.

<Note>
  Analytics are aggregated for the team. Retrieve an individual SMS or its event history when you need message-level diagnostics.
</Note>
