v1
latestOpenAPI 3.1.02026-07-2466150275.0 KBIncidents
Aggregate Incidents
Aggregate incidents with GROUP BY operations.
Allows grouping by status, severity, site_id, user_id, and is_archived fields with aggregation functions like COUNT, SUM, AVG, MIN, MAX. Uses the same base filters and company scoping as the search endpoint for consistent behavior.
post/v1/incident/aggregate
Request body
Example request
{
"aggregations": [
{
"alias": "total_incidents",
"column": "id",
"operator": "count"
},
{
"alias": "total_lost_time",
"column": "lost_time",
"operator": "sum"
}
],
"date_filter_column": "updated_at",
"group_by": [
"status",
"severity"
],
"is_archived": false,
"limit": 50,
"project_is_archived": false,
"skip": 0,
"sort_column": "total_incidents",
"sort_direction": "desc"
}Response
Successful Response
Example response
{
"data": {
"data": [
{
"count_by_site": 13,
"severity": "low",
"status": "active"
},
{
"count_by_site": 14,
"severity": "high",
"status": "closed"
}
],
"metadata": {
"aggregations": [
{
"alias": "count_by_site",
"column": "site_id",
"operator": "count"
}
],
"group_by_columns": [
"status",
"severity"
]
},
"total_groups": 3
}
}