Skip to main content

API: Aggregations

The aggregations endpoints return aggregate values (sum, average, 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
ParameterDescription
sumSum of each listed field.
avgAverage of each listed field.
countCount of rows that have a value for each listed field.

If no aggregate parameters are sent, the response is an empty object {}.

Response structure

Nested by function, then by field name:

{
"sum": { "units": 120.00, "amount": 9450.00 },
"avg": { "units": 2.50 },
"count": { "units": 48 }
}

Only requested functions appear in the response. Functions with no requested fields are omitted.

Constraints

  • Only fields with data type INTEGER, DECIMAL, CURRENCY, or PERCENTAGE produce a result. Requesting aggregation on other field types is silently ignored.
  • count counts only rows that have a numeric value for the field. Rows without a value for that field are excluded from the count.
  • Works for both standalone lists and RELATED_VIEW — there is no restriction on view type.

Example

Request the sum and average of units and the sum of amount for the legalmanager.payPerUse objects related to agreement 42:

GET /data/acme/legalmanager.clientAgreement/42/legalmanager.payPerUse/aggregations?sum=units,amount&avg=units

Response:

{
"sum": { "units": 84.00, "amount": 6300.00 },
"avg": { "units": 3.00 }
}