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
  • Reports
  • Segments & Computed Properties
  • Workflows
  • Destinations
  • Metrics API
  • 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. APIs

Metrics API

PreviousEvents APINextWorkflow API

Last updated 9 months ago

  • POSTGet Access Token
  • POSTRun pre-defined query
  • POSTRun SQL Query

Get Access Token

post

Generate a access token to use in metrics API requests

Body
clientSecretstringOptionalExample: {{metricsClientSecret}}
environmentApiKeystringOptionalExample: {{metricsApiKey}}
Responses
200
Successful Response
application/json
post
POST /metrics/auth/token HTTP/1.1
Host: metrics-api.userflux.co
Content-Type: application/json
Accept: */*
200

Successful Response

No content

Run pre-defined query

post

Run a query against one of your pre-defined metrics

Authorizations
Body
variablesobjectOptional
Responses
200
Successful Response
application/json
post
POST /metrics/query/{metric-id} HTTP/1.1
Host: metrics-api.userflux.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
200

Successful Response

No content

Run SQL Query

post

Run a SQL query

Authorizations
Body
encodedQuerystringOptionalExample: U0VMRUNUIHRpbWVzdGFtcCwgdXNlcklkLCBhbm9ueW1vdXNJZCwgbmFtZSwgdWZQcm9wZXJ0aWVzLnVybFBhdGggYXMgcGFnZVBhdGggCkZST00gZXZlbnRzVGFibGUgCldIRVJFIG5hbWUgPSAnQHtldmVudE5hbWV9JyAKTElNSVQgQHtyb3dMaW1pdH0=
Responses
200
Successful Response
application/json
post
POST /metrics/query HTTP/1.1
Host: metrics-api.userflux.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
200

Successful Response

No content