Skip to content

Get public statistics

GET
/public/triggers/{id}/stats
curl --request GET \
--url https://localhost:3000/api/v1/public/triggers/example/stats

Returns the statistics of a public trigger (no authentication)

id
required
string

Trigger ID (UUID)

from
string

Start (default: now-1h)

to
string

End (default: now)

interval
string

Interval (default: 1m)

filter
string

JSON filter on metadata (reserved _* keys rejected)

Event statistics

Media typeapplication/json
object
buckets
required
Array<object>
object
count
required

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

integer
time
required
string
value

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

number
from
required
string
measure

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

string
to
required
string
total
required
integer
total_value

TotalValue is the sum over the window, present with measure=sum: only.

number
trigger_id
required
string format: uuid

Example

{
"buckets": [
{
"count": 152,
"time": "2024-01-15T10:00:00Z",
"value": 1.25
}
],
"from": "2024-01-15T09:30:00Z",
"measure": "sum:cost_usd",
"to": "2024-01-15T10:30:00Z",
"total": 1523,
"total_value": 12.5,
"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"
}

Trigger not found or not public

Media typeapplication/json
object
error
required
string
message
string

Example

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

Stats query timed out

Media typeapplication/json
object
error
required
string
message
string

Example

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