Get metadata field facets
GET
/triggers/{id}/metadata/facets
const url = 'https://localhost:3000/api/v1/triggers/example/metadata/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/triggers/example/metadata/facets?field=example' \ --header 'Authorization: <Authorization>'Returns the top values, coverage (present vs total events) and numeric min/max of one metadata field over ALL events of the range and filter. The range is clamped to the last 30 days. Server-injected “_” keys are accepted only when exposed by the metadata schema. Requires trigger:stats:{id} or trigger:stats:*
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Trigger ID (UUID)
Query Parameters
Section titled “Query Parameters”field
required
string
Metadata key (max 128 characters)
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 top values (default: 5, max: 50, 0 skips them)
Responses
Section titled “Responses”Facets of the field
Media typeapplication/json
object
field
required
string
from
required
string
max
number
min
number
present
required
integer
to
required
string
top
required
Array<object>
object
count
required
integer
value
required
string
total_events
required
integer
trigger_id
required
string format: uuid
Example
{ "field": "country", "from": "2026-01-15T10:30:00Z", "max": 99, "min": 1, "present": 14000, "to": "2026-01-16T10:30:00Z", "top": [ { "count": 420, "value": "FR" } ], "total_events": 15234, "trigger_id": "550e8400-e29b-41d4-a716-446655440000"}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"}Insufficient permissions
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Trigger not found
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Rate limit exceeded
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Internal error
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}