# KPI summary

`GET /summary`

Returns the main KPIs of one shop (`shop_id`) or all your shops in a
single call: review count and average rating, satisfaction responses,
missed calls and their SMS follow-up, and gift wheel participations.
Without `from`/`to`, aggregates cover the whole history.

Requires the `dashboard:read` scope.

**Returns** a single object with one block per feature (`reviews`,
`feedbacks`, `missed_calls`, `wheel_games`). Counts are `0` and averages
`null` when a feature has no data on the period. For the detail behind
each block, use the matching `/analytics/*` and list endpoints.

## Example request

```bash
curl "https://api.dokaa.app/v1/summary" \
  -H "Authorization: Bearer dk_live_..."
```

## Query parameters

- `shop_id` (string) – Restrict to a single shop (omit to query all your shops)
- `from` (string) (format: date) – Only data on or after this date
- `to` (string) (format: date) – Only data on or before this date

## Responses

### 200 – KPI summary

```json
{
  "reviews": {
    "count": 4572,
    "average_rating": 4.6,
    "reply_rate": 87.1
  },
  "feedbacks": {
    "count": 812
  },
  "missed_calls": {
    "count": 145,
    "sms_sent": 130,
    "sms_delivered": 118,
    "sms_blocked": 8
  },
  "wheel_games": {
    "participations": 960,
    "gifts_claimed": 411
  }
}
```

### 401 – Missing, invalid, or revoked API key

### 403 – The API key does not grant access to this resource

### 422 – Invalid request parameters

Errors are `application/problem+json` (RFC 9457) with `type`, `title`, `status` and `detail` fields.
