---
title: "Create or reuse an analytics report"
method: POST
path: "/v1/analytics/reports"
tags: ["Analytics"]
---

# Create or reuse an analytics report

`POST /v1/analytics/reports`

## Request

- Base URL: `https://api.mailrith.com`
- URL: `https://api.mailrith.com/v1/analytics/reports`
- Auth: HTTP bearer

Runs from compact rollups. Ranges through 31 days complete inline; longer ranges are queued. Results expire after 24 hours and never exceed 100 rows.

## Headers

- `Idempotency-Key` string

## Request body

- AnalyticsReportCreateRequest
  - `from` string, date, required
  - `to` string, date, required
  - `source_types` string[]
  - `source_ids` string[]
  - `group_by` string[]
  - `compare_previous` boolean

## Response `200`

Successful response

- object
  - `data` AnalyticsReport, required: A 24-hour cached report with at most 100 aggregate rows, explicit definitions, freshness, attribution, and optional previous-period comparison.
    - `self` string, required: Stable relative Public API path for retrieving this resource.

## Other responses

- `202`: The bounded report was queued.

---

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