Get group stats
GET
/groups/{id}/stats
const url = 'https://localhost:3000/api/v1/groups/example/stats';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/groups/example/stats \ --header 'Authorization: <Authorization>'Returns aggregated event statistics for all triggers in a group
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Group ID (UUID)
Query Parameters
Section titled “Query Parameters”from
string
Start time (default: now-1h)
to
string
End time (default: now)
interval
string
Bucket interval (default: 1m)
filter
string
JSON metadata filter
Responses
Section titled “Responses”Group statistics
Media typeapplication/json
object
buckets
required
Array<object>
object
count
required
integer
time
required
string
value
Value is the sum of the key over the bucket; nil unless the query set SumKey.
number
from
required
string
group_id
required
string format: uuid
to
required
string
total
required
integer
Example generated
{ "buckets": [ { "count": 1, "time": "example", "value": 1 } ], "from": "example", "group_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "to": "example", "total": 1}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"}Group not found
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"}Stats query timed out
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}