Admin analytics cohorts
Analytics
Admin analytics cohorts
Per-day DAU, MAU, new users, trial→paid, and 30-day churn read from the nightly analytics_daily rollup. Defaults to the trailing 30 days.
GET
Admin analytics cohorts
Overview
Per-day product analytics for the admin dashboard’s “trend” charts — DAU, MAU, new users, trial→paid conversions, and 30-day churn. Unlike the overview, these metrics are not computed live; they are read straight from theanalytics_daily collection populated by the nightly rollup worker at 02:00 UTC.
Pass from/to (both YYYY-MM-DD, inclusive bounds) to bound the range. When neither is supplied the server returns the trailing 30 days (today inclusive).
See Analytics and rollups for the rollup pipeline + staleness contract.
Available to any admin role — SUPER, MODERATOR, and FINANCE all read this surface.
Authentication
Bearer <accessToken> with scope: 'admin' required (requireAdmin).
Path parameters
None.Query parameters
| Name | Type | Required | Notes | Example |
|---|---|---|---|---|
from | string | no | Inclusive start date, YYYY-MM-DD. Defaults to 29 days before to (so the response is exactly 30 days). | 2026-04-24 |
to | string | no | Inclusive end date, YYYY-MM-DD. Defaults to today (UTC). | 2026-05-23 |
Days for which the rollup has not yet produced a row are simply absent from
items — there is no zero-fill. The most recent day in items is generally yesterday (the rollup runs 02:00 UTC and computes the previous day).Request body
None.Response — 200 OK
| Field | Type | Notes |
|---|---|---|
items | array | One entry per analytics_daily row in the range. Order matches the underlying repo (chronological). |
Cohort row
| Field | Type | Notes | Example |
|---|---|---|---|
date | string | UTC date the row covers, YYYY-MM-DD. | 2026-05-22 |
dau | integer | Daily Active Users — users with lastSeenAt inside the 24h window ending at midnight UTC the next day. | 247 |
mau | integer | Monthly Active Users — users with lastSeenAt inside the trailing 30-day window. | 1432 |
newUsers | integer | users whose createdAt falls inside the day. | 18 |
trialToPaid | integer | Subscriptions whose status is ACTIVE AND whose trialEndsAt falls in the trailing 30 days from the row’s date. Captures the trial-end conversion. | 9 |
churn30d | integer | Subscriptions in CANCELLED/EXPIRED whose updatedAt falls in the trailing 30 days. Proxy metric — see limitations. | 4 |
MVP limitations
Error responses
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | from or to not in YYYY-MM-DD form. |
| 401 | UNAUTHENTICATED | Missing, malformed, expired, or non-admin-scope token. |
See also
- Analytics and rollups — the rollup pipeline + the 24h staleness contract.
- Admin analytics overview — live counters, 60s cache.
- Admin analytics locations — top boroughs from the latest rollup.
curl
Postman
Seedocs/postman/swappr.postman_collection.json → Admin Analytics → Cohorts.