Closed Beta — not yet enabled for all workspaces (403 otherwise). Request access at https://developers.myclickfunnels.com/page/code-support.
Aggregate statistics over a filtered set of records, without listing the records. Use this for any
"how many", "what's the breakdown", or "what's the total" question: it is dramatically cheaper than paging
a collection and counting client-side.
One workspace endpoint serves every analyzable resource. Name the resource and request the stats you want
as query parameters:
GET /api/v2/workspaces/{workspace_id}/stats?resource=contact&count=true&count_by[property]=is_active&filter[tag_ids]=42A flag of true computes the stat; an object-style query supplies a stat's parameters. Omit a stat (or pass
false) to skip it. Calling with only resource returns a 422 that lists the stats and property values the
named resource supports, so the endpoint is self-describing.
Narrowing the set
The same selectors the resource's own index accepts, composed with AND:
filter- simple field matches, e.g.filter[tag_ids]=42for contactsstable_id- a one-off Refine filter token, e.g. fromPOST /workspaces/{workspace_id}/contacts/filtersstored_filter_id- a saved Refine filter id
Omit all three to report on every record of that resource in the workspace.
Counts are capped
Counting a large filtered audience scans every matching row, so every stat here is bounded. When the
matching set exceeds the cap, count returns the cap and the response carries count_capped_at - the real
total is higher, so narrow the filter. Exact aggregates (created_at_range, sum) are not computed at all
beyond the cap; they are named in unavailable rather than returned as a confidently wrong number.
Access
Computing a statistic persists nothing, so a token with read-only access may call it. Authorization
follows the category of the resource being analyzed: contact requires read access to Contacts, order
requires read access to Store.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||