Aggregations
The aggregations endpoints return the total record count and aggregate values (sum, average, per-field count) over a filtered set of objects. They mirror the list endpoints but return totals instead of paginated rows.
Endpoints
Standalone list:
GET /data/{tenant}/{typeName}/aggregations
Related list (within a RELATED_VIEW):
GET /data/{tenant}/{relatedTypeName}/{relatedId}/{typeName}/aggregations
Request parameters
Use the same filter parameters as the corresponding list endpoint. No page, size, or sort parameters — aggregations always run over the full filtered set.
Specify which aggregate functions to compute using one parameter per function. The value is a comma-separated list of field names:
?sum=units,amount&avg=units&count=units
| Parameter | Description |
|---|---|
sum | Sum of each listed field. |
avg | Average of each listed field. |
count | Number of matching records that have a value for each listed field. |
Aggregate parameters are optional — the total record count is always returned regardless (see below).
Response structure
The response always includes a top-level total (the total number of records matching the filters). Any requested aggregate functions are added alongside it, nested by function and then by field name:
{
"total": 15968,
"sum": { "units": 120.00, "amount": 9450.00 },
"avg": { "units": 2.50 },
"count": { "units": 118 }
}
totalis always present, even when no aggregate parameters are sent (the response is then simply{ "total": <n> }).- Only requested functions appear; a function with no valid fields is omitted.
totalcounts all matching records regardless of field values; the per-fieldcountcounts only records where that specific field has a value.
Constraints
sum,avg, andcountonly produce a result for fields with data typeINTEGER,DECIMAL,CURRENCY, orPERCENTAGE. Requesting them on other field types is silently ignored.- Works for both standalone lists and
RELATED_VIEW— there is no restriction on view type.
Example
Request the sum and average of units, the sum of amount, and the per-field count of units for the payPerUse objects related to a specific clientAgreement:
GET /data/2f9c6e1a-7b34-4d58-9c21-0a5e8f1b2c3d/clientAgreements/a17f4c92-3b8e-4e21-9d7a-6c0b1e2f3a4b/payPerUses/aggregations?sum=units,amount&avg=units&count=units
Response:
{
"total": 28,
"sum": { "units": 84.00, "amount": 6300.00 },
"avg": { "units": 3.00 },
"count": { "units": 26 }
}