Skip to main content
POST
Run a cohort analysis

Authorizations

x-api-key
string
header
required

Your Upstack API key. Starts with upstack_.

x-pixel-id
string
header
required

The pixel id the request targets.

Body

application/json
pixelId
string
required

Must match the x-pixel-id header.

granularity
enum<string>
required
Available options:
week,
month,
year
measures
enum<string>[]
required

Cohort-specific measure ids. Pass measure ids as strings (this endpoint differs from /api/query, which takes objects with pacing).

Required array length: 1 - 30 elements
Available options:
orders.ltv_cohort_gross_revenue,
orders.ltv_cohort_net_revenue,
orders.customers_cohort,
orders.avg_order_value_cohort,
orders.cohort_retention_percent,
orders.cohort_cm1,
orders.cohort_cm2
dateRange
object
required
timezone
string
filters
object

Canonical filter applied to the cohort. orders.* fields are valid in this context — discover via GET /api/filters.

orderSettings
object

Order-level query settings — exclusion filters, pending/voided handling.

Response

Cohort results.

results
object[]
required