Metrics API

The Metrics API lets you query your data over HTTPS and embed the results wherever you need them — inside your own customer‑facing product, an internal admin portal, or a backend job that exports large data sets.

1. Why use it?

Use case
How the Metrics API helps

Embedded analytics for customers

Call a pre‑defined metric and drop the JSON straight into a chart component inside your app.

Internal dashboards

Power admin portal UIs.

Bulk exports / ETL

Paginate or schedule heavy SQL queries from a backend worker to export data.


2. Two ways to query

Pre‑defined Metric

You saved a query in the UI and want consistency + permissioning.

Raw SQL

Ad‑hoc exploration, joins, or dynamic SQL built by your app.


4. Caching & performance

  • Cache TTL (min 5 minutes) is configurable in Settings ▶ Cache Configuration.

  • Cached responses reduce query latency and DB load – raise TTL for public dashboards that refresh frequently.

  • Cache is keyed on the full request body, so changing variables or SQL bypasses the cache.

Last updated