Skip to content

Exact breakdown of the events of a set of triggers

GET
/events/breakdown
curl --request GET \
--url 'https://localhost:3000/api/v1/events/breakdown?dimension=example' \
--header 'Authorization: <Authorization>'

Counts the events of the WHOLE scope and the whole window by the value of one axis (dimension), or by pair of values of two axes (cross): this is what the panels show (donut, bars, table, heatmap, punchcard, stacked). dimension and cross are hour (0-23), weekday (1 Monday to 7 Sunday), @country (sender country, server key _geo_country) or a metadata key; hour and weekday are read in the tz time zone (IANA name, default UTC, otherwise 400). Without cross, buckets lists the first limit values (default 20, max 50; natural order for hour and weekday, otherwise by descending count then value) and total counts every event carrying the dimension: total minus the sum of the buckets is what limit cut off. With cross, pairs lists the pairs of the first limit dimension values; a null cross_key groups the cross values beyond limit; events missing either value are not counted. Only scalar values (non-empty string, number, boolean) form a bucket. measure=sum: (default count) gives the sum of a numeric metadata key per value instead of the number of events: each bucket and pair then carries value (the sum) next to count (the events summed), total_value is the sum behind total, and values are ranked by descending sum; it reads raw events only, ignores the events whose key is missing or not a JSON number, and an invalid measure or key (empty, over 128 characters, control characters, or a _ key for a public trigger of someone else) is rejected (400). Counts are exact: values are grouped over the whole scope before cutting, in a single SQL query. Window bounded to the last 30 days (from defaults to now-1h), same scope rules as GET /events: exactly one of owner, scope=all, group_id or trigger_ids (50 max); unreadable triggers are ignored (trigger_ids returns skipped_trigger_ids); inaccessible owner or group: 404; API key with trigger:stats per trigger and tenant:read:{id} for an organization; truncated=true beyond 10000 triggers (scope=all) or 500 (others). If a trigger of the scope is only readable through its public visibility (other owner), a dimension, a cross or a filter on a _ key (including @country) is rejected (400).

owner
string

Scope: personal or tenant:{id}

scope
string

Scope: all

group_id
string

Scope: group ID (UUID)

trigger_ids
string

Scope: comma-separated trigger IDs (50 max)

dimension
required
string

Axis: hour, weekday, @country or metadata key (128 characters max)

cross
string

Second axis (same values as dimension)

tz
string

IANA time zone for hour and weekday (default: UTC)

from
string

Start (default: now-1h). Supports relative time: now-1h, now-24h

to
string

End (default: now). Supports relative time

filter
string

JSON filter on metadata

measure
string

Count (default) or sum:{metadata key}: sums that numeric key per value, read on raw events; events whose key is missing or not a JSON number are ignored

limit
integer

Max number of values per metadata axis (default: 20, max: 50)

Breakdown

Media typeapplication/json
object
buckets
required

Buckets is empty with cross.

Array<object>
object
count
required

Count is the number of events (with measure=sum:, of those carrying a numeric key).

integer
key
required
string
value

Value is the sum of the key, present with measure=sum: only.

number
cross
string
dimension
required
string
from
required
string
measure
required

Measure is count, or sum: when the request asked for a sum.

string
pairs
required

Pairs is empty without cross.

Array<object>
object
count
required
integer
cross_key
required

CrossKey is null for the cross values beyond the limit, gathered together.

string
key
required
string
value

Value is the sum of the key, present with measure=sum: only.

number
skipped_trigger_ids
required

SkippedTriggerIDs lists the requested trigger_ids that do not exist or that the caller may not read (the two cases are not told apart). Empty for the other scopes.

Array<string>
to
required
string
total
required

Total is the number of events carrying the dimension, over the whole scope and window; Total minus the sum of Buckets is what the limit cut. Zero with cross.

integer
total_value

TotalValue is the sum behind Total, present with measure=sum: only.

number
truncated
required

Truncated is true when the scope holds more readable triggers than the cap (10000 for scope=all, 500 otherwise): only the oldest ones are read.

boolean

Example

{
"buckets": [
{
"count": 1234,
"key": "/home",
"value": 12.5
}
],
"cross": "weekday",
"dimension": "hour",
"from": "2026-01-15T10:30:00Z",
"measure": "sum:cost_usd",
"pairs": [
{
"count": 42,
"cross_key": "/home",
"key": "1",
"value": 3.2
}
],
"skipped_trigger_ids": [
"550e8400-e29b-41d4-a716-446655440000"
],
"to": "2026-01-16T10:30:00Z",
"total": 15234,
"total_value": 812.4,
"truncated": false
}

Invalid request

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}

Unauthorized

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}

Owner or group not found

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}

Too many concurrent calls

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}

Erreur interne

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}

Timeout

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}