LogoLogo
  • Set up UserFlux
    • What is UserFlux?
  • Create an account
  • Start collecting data
  • View your data in UserFlux
  • Plan remaining implementation
  • Integration
    • Identify users
    • Send events
  • Enrich your data
  • Feature Guides
    • Insights
      • Series
      • Funnel
      • User Composition
      • Custom SQL
      • AI Insight Editor
  • Reports
  • Segments & Computed Properties
  • User Flows
    • User Flows Dashboard Overview
    • Creating a New User Flow
    • Adding a Trigger
    • Workflow Editor Actions Panel
    • Adding a Step
    • Adding Actions
    • Connecting Workflow Components
    • Saving Workflows
  • Destinations
  • Metrics API
  • Email Insights
  • Security
    • API Authentication
    • Trust Center
  • SDKs
    • Browser SDK
    • React SDK
    • Backend JS SDK
  • APIs
    • Profiles API
    • Events API
    • Metrics API
    • Workflow API
    • Products API
Powered by GitBook
On this page
  • 1. Why use it?
  • 2. Two ways to query
  • 4. Caching & performance

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.

PreviousDestinationsNextEmail Insights

Last updated 1 month ago