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

Authorization

apiKey
headerAuthorizationBearer <snoze_sk_…>

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

Path Parameters

workspaceId*string
databaseId*string

Query Parameters

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

Response Body

Success

application/json
  1. response
data*
Example Request
curl -X GET 'https://api.snoze.dev/v1/workspaces/string/databases/string/records/aggregate'
Example Response
{  "data": {    "value": 0,    "count": 0  }}