Skip to main content

Endpoints

All analytics routes require the analytics:read scope and three query parameters: from, to, and workspaceId. Dates are inclusive (UTC); the API expands them to full-day windows when querying ClickHouse.

Key concepts

  • Responses are JSON arrays validated against the ClickHouse schemas defined in @workspace/types. Each object includes a day field (ISO date) plus metric-specific fields (cnt, amount_cents_sum, etc.).
  • The API does not paginate; ensure your requested date range is appropriate for dashboard queries (typically 90 days or less).
  • Use the same workspace ID your API key maps to. For multi-workspace service accounts, switching workspaceId lets you build cross-workspace dashboards.
  • Metrics return raw cents for revenue totals (amount_cents_sum). Convert to currency units in your analytics layer.