---
title: "Count records per value"
description: "Count records by each value in one column for the same set a list would return; a key has the shape the record's value has (a link is `[{ id, label }]`); order keys by that column's sort order."
canonical: "https://grid82.com/docs/app-api/records/groups"
updated: "2026-11-13"
---

# Count records per value

`GET https://your-suite.grid82.app/your-app/v1/tables/{tableId}/records/groups`

Count records by each value in one column for the same set a list would return; a key has the shape the record's value has (a link is `[{ id, label }]`); order keys by that column's sort order.

> **Note: Generic contract**
>
> Your own version of this operation, with your tables and the fields you can read, is in
> your app's document: `https://{suite}.grid82.app/{app}/v1/openapi.json`, behind your credential.
> [Why each person gets their own](/docs/start/studio-and-runtime#why-an-app-has-an-api-of-its-own).

Set `fieldId` to the field's ID or exact name. Refuses unreadable fields and lists the fields you can read. `meta.rowsLimited` as on records.list.

Requires the `records:read` scope. Operation `records.groups`. MCP tool `records_groups`. CLI: `grid82 records groups` (`npx grid82`).

## Path parameters

| Name      | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| `tableId` | string | yes      |             |

## Query parameters

| Name      | Type    | Required | Description            |
| --------- | ------- | -------- | ---------------------- |
| `viewId`  | string  | no       | Up to 64 characters.   |
| `search`  | string  | no       | Up to 200 characters.  |
| `filter`  | string  | no       | Up to 4000 characters. |
| `sorts`   | string  | no       | Up to 1000 characters. |
| `where`   | string  | no       | Up to 4000 characters. |
| `fieldId` | string  | yes      | Up to 200 characters.  |
| `limit`   | integer | no       |                        |

**Authorizations**

- `Authorization` (bearer, in header, required)

## Response

**200**: Success

- `data` (`object`, required)
- `data.groups` (`object[]`, required)
- `data.groups.key` (`object`, required)
- `data.groups.count` (`number`, required)
- `data.truncated` (`boolean`, required)
- `meta` (`object`, required)
- `meta.rowsLimited` (`boolean`, required): True when your roles see only some of the table's rows: this answer is about those rows, not the whole table.

```json
{
  "data": {
    "groups": [
      {
        "key": null,
        "count": 123.45
      }
    ],
    "truncated": true
  },
  "meta": {
    "rowsLimited": true
  }
}
```

**4XX**: Refused

- `error` (`object`, required)
- `error.code` (`enum<string>`, required, one of: `not_found, forbidden, unauthenticated, validation_failed, conflict, rate_limited, payment_required, not_implemented, internal`)
- `error.message` (`string`, required)
- `error.details` (`Record<string, unknown>`)

```json
{
  "error": {
    "code": "not_found",
    "message": "<string>",
    "details": {}
  }
}
```

**Example request**

```bash
curl --request GET \
  --url 'https://your-suite.grid82.app/your-app/v1/tables/<tableId>/records/groups?fieldId=<fieldId>' \
  --header 'Authorization: Bearer <token>'
```
