---
title: "Get message volume analytics"
method: GET
path: "/v1/analytics/stats"
tags: ["Analytics"]
---

# Get message volume analytics

`GET /v1/analytics/stats`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/analytics/stats`
- Auth: API key in header `x-api-key`

Returns outbound message counts over the half-open selected instant range, grouped by organization-local calendar day, week, or month. A range with traffic returns every bucket in it, including the ones that saw none; a range with no outbound traffic at all returns no buckets. A range with no `before` runs through the current instant, so its quiet trailing buckets are reported as zero.

## Query parameters

- `after` string, nullable
- `before` string, nullable
- `groupBy` 'day' | 'week' | 'month', nullable
- `channel` 'email', nullable

## Response `200`

Success

- object
  - `volumeHistory` object[], required
    - `date` string, required
    - `email` integer, required

## Other responses

- `400`: AnalyticsQueryError
- `401`: UnauthorizedError
- `403`: ForbiddenError
- `422`: ValidationError
- `500`: InternalError
- `504`: GatewayTimeoutError

---

[API](https://skmtc.dev/samva/apis/samva-api.md) · [All operations](https://skmtc.dev/samva/apis/samva-api/llms.txt) · [OpenAPI document](https://skmtc.dev/samva/apis/samva-api/revisions/a99408542cc3?raw)
