Skip to content

Facets of a metadata field over a set of triggers

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

Returns the most frequent values, the coverage (present out of total_events) and the numeric min/max of a field over ALL events of the window and filter, for the whole scope. Counts are exact: values are grouped over the whole scope before keeping the top N (this is not a merge of per-trigger tops). Same parameters and rules as GET /triggers/{id}/metadata/facets (field required, limit default 5, max 50, 0 without values, window bounded to the last 30 days, from defaults to now-1h), with the scope rules of 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 field or a filter on a _ key is rejected (400). A _ key is only accepted if the merged schema exposes it.

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)

field
required
string

Metadata key (128 characters max)

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

limit
integer

Max number of values (default: 5, max: 50, 0 skips them)

Field facets

Media typeapplication/json
object
field
required
string
from
required
string
max
number
min
number
present
required
integer
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
top
required
Array<object>
object
count
required
integer
value
required
string
total_events
required
integer
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

{
"field": "country",
"from": "2026-01-15T10:30:00Z",
"max": 99,
"min": 1,
"present": 14000,
"skipped_trigger_ids": [
"550e8400-e29b-41d4-a716-446655440000"
],
"to": "2026-01-16T10:30:00Z",
"top": [
{
"count": 420,
"value": "FR"
}
],
"total_events": 15234,
"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"
}