Statistics of a set of triggers, per trigger
const url = 'https://localhost:3000/api/v1/stats?by=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/stats?by=example' \ --header 'Authorization: <Authorization>'Returns the stats buckets of several triggers in one call (list sparklines). by=trigger is required (without it: 400). Exactly one scope parameter: owner (personal or tenant:{id}, same triggers as GET /triggers?owner=, without triggers shared through access), scope=all (personal, organizations and shared triggers), group_id, or trigger_ids (50 max). No scope parameter, or several: 400. Triggers the caller cannot read are ignored; trigger_ids returns skipped_trigger_ids (nonexistent and forbidden cannot be told apart). An inaccessible owner or group: 404. An API key must carry trigger:stats on every trigger, and tenant:read:{id} for an organization’s triggers. Buckets are those of GET /triggers/{id}/stats (same intervals, same alignment, only non-empty buckets, 10000 max per trigger); a readable trigger without events has buckets=[]. Window bounded to 30 days (an older from is brought back to to - 30 days). More than 200000 buckets in total: 400. Beyond 10000 triggers (scope=all) or 500 (other scopes) the response carries truncated=true and covers the oldest triggers. Public triggers of another owner, read only through their public visibility, reject a filter on a _ key (400) for the whole call.
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)
Regroupement: trigger
Start (default: now-1h). Supports relative time: now-1h, now-24h
End (default: now). Supports relative time
Bucket interval (default: 1m). E.g. 1m, 5m, 1h, 1d
JSON filter on metadata
Responses
Section titled “Responses”Buckets per trigger
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.
Triggers is keyed by trigger ID. A readable trigger without events has empty buckets.
object
object
Buckets holds only the time buckets that contain events, in time order.
object
Count is the number of events (with measure=sum:
Value is the sum of the key over the bucket, present with measure=sum:
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
{ "skipped_trigger_ids": [ "550e8400-e29b-41d4-a716-446655440000" ], "triggers": { "additionalProperty": { "buckets": [ { "count": 152, "time": "2024-01-15T10:00:00Z", "value": 1.25 } ] } }, "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"}