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

# Get Analytics Time Series

> Account-wide mail metrics charted over time

Get an account-wide time series for a single metric, bucketed by day or week. Useful for charting mail performance trends. Missing buckets are filled with zeroes so the series is continuous across the full range.

Supported metrics:

* `sent` — pieces mailed
* `delivered` — pieces delivered
* `scans` — QR/link scans (each point also includes `secondary_value`: total scans vs. unique properties)
* `open_rate` — unique opens divided by pieces sent, as a percentage

<ParamField query="metric" type="string" default="sent">
  One of `sent`, `delivered`, `scans`, `open_rate`.
</ParamField>

<ParamField query="group_by" type="string" default="day">
  Bucket size: `day` or `week`.
</ParamField>

<ParamField query="days" type="integer" default="30">
  Number of days back from today when no date range is given (1–365).
</ParamField>

<ParamField query="start_date" type="string">
  Start of the date range (ISO). Overrides `days` when provided.
</ParamField>

<ParamField query="end_date" type="string">
  End of the date range (ISO, defaults to now).
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.v2.dealmachine.com/v1/mail/analytics/timeseries?metric=sent&group_by=day&days=7" \
    -H "Authorization: Bearer dm_sk_live_xxx"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": {
      "metric": "sent",
      "group_by": "day",
      "start_date": "2026-06-03T00:00:00.000Z",
      "end_date": "2026-06-09T18:00:00.000Z",
      "points": [
        { "date": "2026-06-03", "value": 120 },
        { "date": "2026-06-04", "value": 0 },
        { "date": "2026-06-05", "value": 340 },
        { "date": "2026-06-06", "value": 210 },
        { "date": "2026-06-07", "value": 0 },
        { "date": "2026-06-08", "value": 95 },
        { "date": "2026-06-09", "value": 60 }
      ]
    }
  }
  ```
</ResponseExample>
