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 the analytics_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

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

Cohort row

MVP limitations

  • churn30d uses updatedAt as a proxy for the cancellation timestamp because the subscriptions collection has no dedicated statusChangedAt field. False positives are possible if a CANCELLED/EXPIRED row was touched for an unrelated reason (e.g. a tax metadata refresh). Acceptable for the dashboard; not acceptable for accounting.
  • trialToPaid captures TRIALING → ACTIVE transitions but does not count trial drops (TRIALING → CANCELLED). That is correct by definition — those users did not convert — but flagged here so the metric is not misread as “trial outcomes.”

Error responses

See also

curl

Postman

See docs/postman/swappr.postman_collection.json → Admin Analytics → Cohorts.