Facets of a metadata field over a set of triggers
const url = 'https://localhost:3000/api/v1/events/facets?field=example';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Scope: personal or tenant:{id}
Scope: all
Scope: group ID (UUID)
Scope: comma-separated trigger IDs (50 max)
Metadata key (128 characters max)
Start (default: now-1h). Supports relative time: now-1h, now-24h
End (default: now). Supports relative time
JSON filter on metadata
Max number of values (default: 5, max: 50, 0 skips them)
Responses
Section titled “Responses”Field facets
object
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.
object
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.
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
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}Unauthorized
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}Owner or group not found
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}Too many concurrent calls
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}Erreur interne
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}Timeout
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}