Skip to content

Stats API

Everything the dashboard shows is available as JSON, at https://millimetry.app/api/v1. Create a read-only token under your organization’s settings → API tokens (admins and owners), then:

Terminal window
curl -H "Authorization: Bearer mt_…" \
"https://millimetry.app/api/v1/apps/42/overview?from=2026-09-01&to=2026-09-30"

Requests carry a read-only org token (Authorization: Bearer mt_…) or the dashboard’s session cookie. Common query parameters for stats endpoints:

  • from, to: UTC dates, inclusive.
  • debug=true: debug data instead of production data.
  • filter=dimension:value: repeatable, for example filter=country:CA&filter=app_version:1.5.0.
  • compare=previous: adds the previous period of the same length.

Answers are cached for 30 seconds. Busy periods answer 503 with Retry-After. A query too heavy for its time or memory budget answers 422: narrow the dates or the filters.

The machine-readable document is at /api/v1/openapi.json.

Auth

Sign-in links, sessions.

POST /auth/logout

Ends this session.

  • 204

POST /auth/magic-link

Sends a sign-in link.

Body: LinkRequest

  • 202 If the address can sign in, a link is on its way
  • 400
  • 429
  • 503

POST /auth/verify

Uses a sign-in link: starts a session (the cookie) and returns who signed in. Needs `X-Requested-With`, which a cross-site form cannot send. 404 when the link is unknown, used or expired.

Body: VerifyRequest

  • 200 LinkInfo Signed in; the session cookie is set
  • 403
  • 404

GET /me

Who is signed in, and their orgs and roles.

GET /me/sessions

The signed-in person's active sessions.

DELETE /me/sessions/{id}

Signs out one session (another device).

ParameterInTypeDescription
idpathstringThe session id from /me/sessions
  • 204
  • 404

Apps

Apps, web sites and their keys.

GET /apps

The apps the caller may see, across their orgs.

POST /apps

Creates an app or web site with its first key.

Body: NewApp

GET /apps/{id}

One app.

ParameterInTypeDescription
idpathinteger (int32)

PATCH /apps/{id}

Renames an app, replaces a site's origins, or pauses and resumes ingest.

ParameterInTypeDescription
idpathinteger (int32)

Body: AppChange

DELETE /apps/{id}

Deletes an app. Its keys stop at once; its data is purged after a 7-day undo window (§15.6).

ParameterInTypeDescription
idpathinteger (int32)
  • 204
  • 403
  • 404

POST /apps/{id}/export

Exports every event of the app to a file; poll `GET /jobs/{id}` for the download link (valid 7 days). Admins and owners: an export holds everything the app ever sent.

ParameterInTypeDescription
idpathinteger (int64)

Body: ExportRequest

POST /apps/{id}/forwarding-secret

Issues a new forwarding secret for a proxied web install (§12.2).

ParameterInTypeDescription
idpathinteger (int32)

GET /apps/{id}/funnels

The app's saved funnels.

ParameterInTypeDescription
idpathinteger (int32)

POST /apps/{id}/funnels

Saves a funnel for everyone in the org to reuse.

ParameterInTypeDescription
idpathinteger (int32)

Body: NewSavedFunnel

DELETE /apps/{id}/funnels/{funnel_id}

Deletes a saved funnel.

ParameterInTypeDescription
idpathinteger (int32)
funnel_idpathinteger (int64)
  • 204
  • 403
  • 404

GET /apps/{id}/keys

The app's keys, active and revoked.

ParameterInTypeDescription
idpathinteger (int32)

POST /apps/{id}/keys

Adds a key. Rotation is an overlap: add, ship it, revoke the old one later.

ParameterInTypeDescription
idpathinteger (int32)

DELETE /apps/{id}/keys/{key}

Revokes a key. Ingest stops accepting it within a minute (its key cache).

ParameterInTypeDescription
idpathinteger (int32)
keypathstring
  • 204
  • 403
  • 404

GET /jobs/{id}

A job the caller's org started (exports).

ParameterInTypeDescription
idpathinteger (int64)

Orgs

Orgs, members and API tokens.

GET /invitations

What an invitation link is for, before signing in to accept it. 404 when used or expired.

ParameterInTypeDescription
tokenquerystring

POST /invitations/accept

Joins the org. The signed-in address must be the invited one; otherwise, and when the link is used or expired, 404.

Body: AcceptInvitation

POST /orgs

Creates an org with the caller as its owner, on the free plan.

Body: NewOrg

PATCH /orgs/{id}

Renames the org.

ParameterInTypeDescription
idpathinteger (int64)

Body: OrgChange

  • 204
  • 400
  • 403
  • 404

DELETE /orgs/{id}

Deletes the org: every app stops at once and all its data is purged within minutes (§15.6). Owners only, and the body must repeat the org's name.

ParameterInTypeDescription
idpathinteger (int64)

Body: DeleteOrg

  • 204
  • 400
  • 403
  • 404

GET /orgs/{id}/invitations

Pending invitations.

ParameterInTypeDescription
idpathinteger (int64)

POST /orgs/{id}/invitations

Invites someone by email. Inviting the same address again replaces the earlier invitation.

ParameterInTypeDescription
idpathinteger (int64)

Body: NewInvitation

DELETE /orgs/{id}/invitations/{invitation_id}

Withdraws a pending invitation; its link stops working.

ParameterInTypeDescription
idpathinteger (int64)
invitation_idpathstring
  • 204
  • 403
  • 404

GET /orgs/{id}/members

The org's members and roles. Invitations come with Milestone B (§20 phase 7).

ParameterInTypeDescription
idpathinteger (int64)

PATCH /orgs/{id}/members/{user_id}

Changes a member's role. Admins change admins, members and viewers; owners also owners.

ParameterInTypeDescription
idpathinteger (int64)
user_idpathinteger (int64)

Body: RoleChange

  • 204
  • 400
  • 403
  • 404

DELETE /orgs/{id}/members/{user_id}

Removes a member; any member may remove themselves (leave). The last owner cannot go.

ParameterInTypeDescription
idpathinteger (int64)
user_idpathinteger (int64)
  • 204
  • 400
  • 403
  • 404

GET /orgs/{id}/tokens

The org's API tokens (never the tokens themselves).

ParameterInTypeDescription
idpathinteger (int64)

POST /orgs/{id}/tokens

Creates a read-only API token for the org.

ParameterInTypeDescription
idpathinteger (int64)

Body: NewToken

DELETE /orgs/{id}/tokens/{token_id}

Revokes an API token at once.

ParameterInTypeDescription
idpathinteger (int64)
token_idpathinteger (int64)
  • 204
  • 403
  • 404

Stats

Dashboard queries.

GET /apps/{id}/breakdown

Top values of one dimension by events, sessions or users (§16).

ParameterInTypeDescription
idpathinteger (int32)
dimensionquerystring
metric (optional)querystring
limit (optional)queryinteger (int32)
from (optional)querystring
to (optional)querystring
filter (optional)querystring[]

GET /apps/{id}/events

The app's events by count, each with a daily series for a sparkline (§14.3).

ParameterInTypeDescription
idpathinteger (int32)
limit (optional)queryinteger (int32)
from (optional)querystring
to (optional)querystring
filter (optional)querystring[]

GET /apps/{id}/events/{name}

One event: its trend, its text properties' top values, its number properties' statistics, and optionally one number property by a dimension (revenue by version, §13).

ParameterInTypeDescription
idpathinteger (int32)
namepathstring
property (optional)querystring
by (optional)querystring
from (optional)querystring
to (optional)querystring
filter (optional)querystring[]

POST /apps/{id}/funnel

Ordered steps within a session and a time window (§13 funnel), optionally per dimension value.

ParameterInTypeDescription
idpathinteger (int32)
from (optional)querystring
to (optional)querystring
filter (optional)querystring[]

Body: FunnelRequest

GET /apps/{id}/heatmap

Sessions by weekday and hour (§13).

ParameterInTypeDescription
idpathinteger (int32)
from (optional)querystring
to (optional)querystring
filter (optional)querystring[]

GET /apps/{id}/live

Sessions active in the last 5 minutes (§14.3). Never cached.

ParameterInTypeDescription
idpathinteger (int32)
debug (optional)queryboolean

GET /apps/{id}/overview

KPIs and the daily series, from `daily_totals` when unfiltered and raw `events` when filtered.

ParameterInTypeDescription
idpathinteger (int32)
from (optional)querystring
to (optional)querystring
debug (optional)queryboolean
filter (optional)querystring[]dimension:value, repeatable
compare (optional)querystring

POST /apps/{id}/paths

What happens next after an event, within a session (§13).

ParameterInTypeDescription
idpathinteger (int32)
from (optional)querystring
to (optional)querystring
filter (optional)querystring[]

Body: PathsRequest

GET /apps/{id}/sessions

Recent sessions and the window's session statistics. No user identity exists to show (§14.3).

ParameterInTypeDescription
idpathinteger (int32)
limit (optional)queryinteger (int32)
from (optional)querystring
to (optional)querystring
filter (optional)querystring[]platform, country, os_name or app_version only

GET /apps/{id}/sessions/{session_id}

One session's events in order.

ParameterInTypeDescription
idpathinteger (int32)
session_idpathstring
debug (optional)queryboolean

GET /apps/{id}/usage

Ingest health and the org's quota (§16).

ParameterInTypeDescription
idpathinteger (int32)
from (optional)querystring
to (optional)querystring

Billing

Plans, usage and Stripe billing.

GET /orgs/{id}/billing

The org's plan, usage and the plans on offer.

ParameterInTypeDescription
idpathinteger (int64)

POST /orgs/{id}/billing/checkout

Starts a subscription: a Stripe Checkout Session for the plan's Price. The plan changes only when Stripe's webhook confirms it. An org that already pays changes plan in the Portal.

ParameterInTypeDescription
idpathinteger (int64)

Body: CheckoutRequest

POST /orgs/{id}/billing/portal

Opens the Stripe Customer Portal: change plan, update the card, invoices, cancel.

ParameterInTypeDescription
idpathinteger (int64)

Schemas

AcceptInvitation

FieldTypeDescription
tokenstring

AppChange

FieldTypeDescription
name (optional)string, nullable
origins (optional)string[]
paused (optional)boolean, nullableA paused app's events are dropped and counted (§15.1).

AppView

FieldTypeDescription
created_atstring
has_forwarding_secretboolean
idinteger (int32)
kindstring`app` (SDK batches) or `web` (the tracker).
namestring
org_idinteger (int64)
originsstring[]Web only: origins allowed to send events.
pausedboolean

BillingView

FieldTypeDescription
billing_enabledbooleanWhether Checkout and the Portal are available on this server.
cancel_at (optional)string, nullableWhen the subscription ends instead of renewing (cancelled at period end); `null` while it renews.
effective_events_per_monthinteger (int64)The limit in force: the free plan's once a past-due grace period has ended.
events_per_monthinteger (int64)The plan's monthly events.
grace_until (optional)string, nullable
hard_limit_percentinteger (int64)Events are accepted up to this share of the limit, then dropped (§15.4).
has_billing_accountbooleanWhether the org has a Stripe customer, so the Portal can open.
period_end (optional)string, nullable
planstring
plansPlanView[]
statusstring`none`, `active`, `past_due` or `canceled`.
used_this_monthinteger (int64)

Breakdown

FieldTypeDescription
dimensionstring
metricstring
rowsRow2[]
sampledboolean
sourcestring

CheckoutRequest

FieldTypeDescription
planstringThe plan to subscribe to, e.g. `pro_1m`.

CreatedApp

FieldTypeDescription
appAppView
keystringThe first public key (`ak_…` or `wk_…`).

CreatedToken

object

DayPoint

FieldTypeDescription
daystring
eventsinteger (int64)
sessionsinteger (int64)
usersinteger (int64)

DeleteOrg

FieldTypeDescription
confirmstringThe org's name, typed back: deleting is irreversible.

EventDetail

FieldTypeDescription
namestring
number_propertiesNumberProperty[]
property_by (optional)PropertyGroup[]With `property` and `by`: the number property per value of the dimension.
sampledboolean
seriesDayPoint[]
string_propertiesStringProperty[]

EventSummary

FieldTypeDescription
eventsinteger (int64)
namestring
seriesinteger (int64)[]Events per day over the window, oldest first, one entry per day (zeros included).
usersinteger (int64)

EventsList

FieldTypeDescription
eventsEventSummary[]
sampledboolean

ExportFormat

"parquet" | "csv"

ExportRequest

FieldTypeDescription
format (optional)ExportFormat`parquet` (default) or `csv`.

ForwardingSecret

FieldTypeDescription
secretstringShown once; the previous secret stops working.

Funnel

FieldTypeDescription
groupsFunnelGroup[]One group without a breakdown; with one, the biggest groups by first-step sessions.
more_groupsbooleanWhether groups beyond the first 20 were left out.
sampledboolean

FunnelGroup

FieldTypeDescription
groupstringThe breakdown value, or empty without a breakdown.
stepsFunnelStep[]

FunnelRequest

FieldTypeDescription
breakdown (optional)string, nullable
stepsstring[]
window_seconds (optional)integer (int32)

FunnelStep

FieldTypeDescription
conversionnumber (double)Share of the first step's sessions.
namestring
sessionsinteger (int64)Sessions that reached this step.
step_conversionnumber (double)Share of the previous step's sessions.

FunnelView

FieldTypeDescription
breakdown (optional)string, nullable
created_atstring
idinteger (int64)
namestring
stepsstring[]
window_secondsinteger (int32)

HeatCell

Sessions active in one weekday-hour: a session spanning two hours counts in both.

FieldTypeDescription
hourinteger (int32)0–23, UTC.
sessionsinteger (int64)
weekdayinteger (int32)1 = Monday … 7 = Sunday.

Heatmap

FieldTypeDescription
cellsHeatCell[]
sampledboolean

InvitationInfo

FieldTypeDescription
emailstring
org_namestring
rolestring

InvitationView

FieldTypeDescription
emailstring
expires_atstring
idstring
rolestring

JobStarted

FieldTypeDescription
job_idinteger (int64)

JobView

FieldTypeDescription
created_atstring
error (optional)string, nullable
idinteger (int64)
kindstring
result (optional)object, nullable
statestring`pending`, `running`, `done` or `failed`.

Joined

FieldTypeDescription
org_idinteger (int64)

KeyView

FieldTypeDescription
created_atstring
keystring
revoked_at (optional)string, nullable

LinkInfo

FieldTypeDescription
emailstringThe address the link signs in as.

LinkRequest

FieldTypeDescription
emailstring

Live

FieldTypeDescription
eventsinteger (int64)
minutesinteger (int32)
sessionsinteger (int64)

Me

FieldTypeDescription
orgsobject[]
userobject

Member

FieldTypeDescription
emailstring
name (optional)string, nullable
rolestring`owner`, `admin`, `member` or `viewer`.
user_idinteger (int64)

NewApp

FieldTypeDescription
kindstring`app` or `web`.
namestring
org_idinteger (int64)
origins (optional)string[]

NewInvitation

FieldTypeDescription
emailstring
rolestring`admin`, `member` or `viewer`; `owner` only from an owner.

NewKey

FieldTypeDescription
keystring

NewOrg

FieldTypeDescription
namestring

NewSavedFunnel

FieldTypeDescription
breakdown (optional)string, nullable
namestring
stepsstring[]
window_seconds (optional)integer (int32)

NewToken

FieldTypeDescription
namestring

NumberProperty

FieldTypeDescription
countinteger (int64)
keystring
meannumber (double)
mediannumber (double)
p95number (double)
sumnumber (double)

OrgChange

FieldTypeDescription
namestring

OrgCreated

FieldTypeDescription
idinteger (int64)

Overview

FieldTypeDescription
currentPeriod
previous (optional)Period | null
sampledboolean
sourcestring`daily_totals` (rollup) or `events` (raw, when filtered).

Paths

FieldTypeDescription
afterstring
nextRow2[]
sampledboolean

PathsRequest

FieldTypeDescription
afterstring

Period

FieldTypeDescription
fromstring
seriesDayPoint[]
tostring
totalsTotals

PlanView

FieldTypeDescription
events_per_monthinteger (int64)
idstring
price_usd_monthinteger (int32)
purchasablebooleanWhether it can be bought now (its Stripe Price is configured).

PropertyGroup

FieldTypeDescription
countinteger (int64)
mediannumber (double)
sumnumber (double)
valuestring

Redirect

FieldTypeDescription
urlstringStripe's page; the browser goes there.

RoleChange

FieldTypeDescription
rolestring`owner`, `admin`, `member` or `viewer`.

Row2

FieldTypeDescription
countinteger (int64)
valuestring

SessionInfo

FieldTypeDescription
created_atstring
currentboolean
expires_atstring
idstring

SessionItem

FieldTypeDescription
app_versionstring
countrystring
duration_secondsinteger (int64)
endedstring
entrystringFirst page (web) or `screen` property (apps).
eventsinteger (int64)
exitstring
idstring
pageviewsinteger (int64)
platformstring
referrer_sourcestring
startedstring

SessionSummary

FieldTypeDescription
bounce_ratenumber (double)
events_per_sessionnumber (double)
median_secondsnumber (double)
sessionsinteger (int64)

Sessions

FieldTypeDescription
sessionsSessionItem[]
summarySessionSummary

StringProperty

FieldTypeDescription
keystring
valuesRow2[]

TimelineEvent

FieldTypeDescription
namestring
pathnamestring
propertiesobject
screenstring
tsstring

TokenView

FieldTypeDescription
created_atstring
idinteger (int64)
namestring

Totals

FieldTypeDescription
bounce_ratenumber (double)Sessions with at most one page view and one event (web).
eventsinteger (int64)
events_per_sessionnumber (double)
median_session_secondsnumber (double)
pageviewsinteger (int64)
sessionsinteger (int64)
usersinteger (int64)Daily-rotating visitors: a person counts once per day (§19).

Usage

FieldTypeDescription
events_per_monthinteger (int64)
fromstring
org_events_this_monthinteger (int64)Accepted events this calendar month for the whole org (the quota counts per org).
outcomesobjectIngest outcomes for this app over the window (§6 ingest_counters).
planstring
tostring

VerifyRequest

FieldTypeDescription
tokenstring