Analytics
The analytics endpoints expose pre-aggregated billing metrics that would otherwise require expensive ad-hoc queries against the underlying invoice and subscription tables. Three metric families are currently exposed: MRR, churn, and a revenue breakdown.
Why this matters. Decisions about pricing, retention, and growth depend on metrics that finance, ops, and product all trust - bespoke SQL against the billing database loses that trust the moment definitions diverge across teams. Kontorion exposes pre-aggregated, definition-aligned metrics so the same numbers reach the dashboard, the boardroom, and the customer.
Available metrics
| Metric | Endpoint | What it answers |
|---|---|---|
| MRR | GET /v1/analytics/mrr | Monthly recurring revenue history. |
| Churn | GET /v1/analytics/churn | Logo and revenue churn for the current period. |
| Revenue breakdown | GET /v1/analytics/revenue | Revenue split by entity (customer type or other segment). |
All three sit under the BearerAuth security scheme and use the standard data envelope (see Errors for the response shape).
MRR history
Code
| Query param | Default | Notes |
|---|---|---|
months | 12 | History length, in months. Capped at 36; values outside 1..36 fall back to 12. |
segment | unset | When set to customer_type, returns the breakdown by BUSINESS / CONSUMER / UNKNOWN. |
Response shape (segmented variant):
Code
The unsegmented variant returns a flat history with one MRR value per month.
Churn
Code
Returns logo and revenue churn for the period the analytics service computes against. No request parameters.
Revenue breakdown
Code
segment=customer_type switches between the default revenue breakdown and the customer-type breakdown.
Caching and freshness
Analytics aggregates are computed asynchronously off the billing event stream and surfaced at request time from materialized rollups. The exact freshness window depends on workspace size and the upstream sync cadence; treat values as eventually consistent.
All amounts are returned in minor units (cents) of the organization's base currency. Cross-currency revenue is converted via the FX policy in effect at finalize time - see Exchange rates for the conversion semantics.
- Subscriptions - the entity MRR aggregates over.
- Segments - planned cohort surface (roadmap).