v1
latestOpenAPI 3.1.02026-07-2466150275.0 KBAssets
Aggregate Assets
Aggregate assets with GROUP BY operations.
Allows grouping by model, colour, maintenance status, and other 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/asset/aggregate
Request body
Example request
{
"aggregations": [
{
"alias": "total_assets",
"column": "id",
"operator": "count"
},
{
"alias": "total_hours",
"column": "hours",
"operator": "sum"
}
],
"date_filter_column": "updated_at",
"group_by": [
"model",
"colour"
],
"is_archived": false,
"limit": 50,
"query": "truck",
"skip": 0,
"sort_column": "total_assets",
"sort_direction": "desc"
}Response
Successful Response
Example response
{
"data": {
"data": [
{
"colour": "White",
"model": "Ford F-150",
"total_assets": 12,
"total_hours": 4500.5
},
{
"colour": "Black",
"model": "Ford F-150",
"total_assets": 8,
"total_hours": 3200
},
{
"colour": "Yellow",
"model": "Caterpillar 320",
"total_assets": 5,
"total_hours": 2100.75
}
],
"metadata": {
"aggregations": [
{
"alias": "total_assets",
"column": "id",
"operator": "count"
},
{
"alias": "total_hours",
"column": "hours",
"operator": "sum"
}
],
"group_by_columns": [
"model",
"colour"
]
},
"total_groups": 3
}
}