Cross-entity event aggregation
Aggregate events across all entities. Returns counts, distinct entity counts, and optional SUM/AVG/MIN/MAX. Supports GROUP BY event_type, source, month, or entity. Use for analytics like 'total revenue by month' or 'refund count per entity'.
sumField: Name of a promoted metadata field for numeric aggregation (e.g. amount_cents). Enables SUM, AVG, MIN, MAX in the response. Only works on numeric metadata fields.
minCount: Minimum event count threshold (HAVING COUNT >= N). Only groups with at least this many events are returned.
minSum: Minimum sum threshold (HAVING SUM >= N). Requires sumField. Only groups whose sum meets this threshold are returned. Use with groupBy=entity to find entities above a revenue threshold (e.g., minSum=100000 for > $1000 in cents).
Request
- Base URLhttp://localhost:3009
- AuthHTTP bearer
Query parameters
Filter by source type.
Filter by event type.
Filter events after this ISO date.
Filter events before this ISO date.
Group results by a dimension. Person/entity groups exclude events without that owner. Ungrouped totals count all matches.
Promoted metadata field for numeric aggregation (e.g. amount_cents). Enables SUM, AVG, MIN, MAX.
Minimum event count threshold (HAVING COUNT >= N). Only groups meeting this threshold are returned.
Minimum sum threshold (HAVING SUM >= N). Requires sumField. Only groups whose sum meets this threshold are returned.
Root entity id or domain.
Required when graphRoot is supplied.
Filter events stamped with this human; merged IDs resolve to their survivor.
person selects sole-person events; company selects company-associated events; omit for both. Filters before pagination/counts. Personal ownership conflicts with entityId/company graph.
Response
Aggregation results
Example response
{
"data": {
"count": 45,
"distinctEntities": 12,
"sum": 1250000,
"avg": 27777.78,
"min": 5000,
"max": 99000,
"groups": [
{
"key": "stripe_charge.succeeded",
"count": 30,
"distinctEntities": 10
}
]
}
}Changes
No recorded changes to this operation across all 1 revision of this API.