# Sum, count or average a page's records

The calculations strip of a record page: how many rows, and one figure per column that carries a calculation (sum, average, median, min, max, filled, empty, percent filled/empty, unique, earliest, latest) — the way to answer "what is the total loan amount" or "how many leads have a phone" without listing rows. Takes the rows route's narrowing (`?q=`, `?filter[<columnId>]=<value>` repeated, `?group=<groupId>`) and figures over the rows in it. Computed columns (formula, lookup) are left out.

Access class: `def:read`.

## Endpoint

`GET /v1/definitions/{key}/aggregates`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |
| body | query | null | No |
| params | query | object | No |
| query | query | object | No |

## Responses

### 200

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "columns": [
      "string"
    ],
    "total": 1.5
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
