Skip to main content
POST
Aggregate records

Operations

fieldId (a field ID or field name) is required for every operation. sum and avg require a numeric field (number, currency, percent, rating, or duration).

Filtering

Use the optional filter to restrict which records are aggregated. It supports the same nested AND/OR logic as List Records.

Grouping

When groupBy is supplied, the response returns groupedResults (one entry per group with its value and groupValue) instead of a single result.

Authorizations

Authorization
string
header
required

Enter your Zite API key. Format: Bearer <api_key>

Path Parameters

databaseId
string
required

The unique identifier of the database

tableId
string
required

The unique identifier of the table. You can also use the table name instead of the ID.

Body

application/json
fieldId
string
required

The field to aggregate, specified by field ID or field name. Required for all operations. sum and avg require a numeric field (number, currency, percent, rating, or duration).

operation
enum<string>
required

The aggregation to perform.

Available options:
sum,
avg,
min,
max,
count,
count_distinct
filter
object

Optional filter condition restricting which records are aggregated. Supports the same nested AND/OR logic as List Records.

groupBy
string

Optional field (field ID or name) to group results by. When provided, groupedResults is returned instead of a single result.

Response

Aggregation result

fieldId
string
required

The field ID that was aggregated.

operation
enum<string>
required

The aggregation that was performed.

Available options:
sum,
avg,
min,
max,
count,
count_distinct
result
number | null
required

The aggregated value. Null when groupBy is used (see groupedResults) or when no rows match. sum returns 0 when no rows match.

groupedResults
object[]

Present only when groupBy is supplied. One entry per group.