# Satisfaction survey analytics (CSAT and NPS)

`GET /analytics/feedbacks`

Returns aggregates over the Dokaa satisfaction surveys of one shop
(`shop_id`) or all your shops. Surveys rated 1 to 5 feed the `csat`
block (average note); surveys rated 0 to 10 feed the `nps` block
(score = share of promoters, note 9 or 10, minus share of detractors,
note 6 or below). Without `from`/`to`, aggregates cover the whole
history.

Requires the `feedbacks:read` scope.

**Returns** an object with a `csat` block and an `nps` block; a block is
`null` when the shop has no survey of that type. Only submissions
carrying a note are counted: partial submissions without a rating are
ignored.

## Example request

```bash
curl "https://api.dokaa.app/v1/analytics/feedbacks" \
  -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 responses submitted on or after this date
- `to` (string) (format: date) – Only responses submitted on or before this date

## Responses

### 200 – Survey aggregates

```json
{
  "csat": {
    "response_count": 812,
    "average_note": 4.3,
    "note_distribution": {
      "1": 18,
      "2": 25,
      "3": 90,
      "4": 260,
      "5": 419
    }
  },
  "nps": {
    "response_count": 340,
    "score": 42,
    "promoters": 190,
    "passives": 92,
    "detractors": 58
  }
}
```

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