SnozeDevelopers
API referenceDatabases

Aggregate the records in a database

Computes one aggregate in the database - `fn` is `count` (the default), `sum`, `avg`, `min` or `max` - over the records matching the optional `viewId`'s filters, and returns the value with the number of contributing records. Every function except `count` needs a `field` key. Requires the `records:read` permission; an unsupported function, an unknown field key and an unknown view are all rejected.

GET
/v1/workspaces/{workspaceId}/databases/{databaseId}/records/aggregate
AuthorizationBearer <token>

Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.

In: header

Path Parameters

workspaceId*string
databaseId*string

Query Parameters

fn?string|null
field?string|null
viewId?string|null

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v1/workspaces/string/databases/string/records/aggregate"
{  "data": {    "value": 0,    "count": 0  }}