# Read records from a HyperDB table

`POST https://api.airtable.com/v0/{enterpriseAccountId}/{dataTableId}/getRecords`

Read records from a HyperDB table

## Requirements

- **Authentication:** [Personal access token](https://airtable.com/developers/web/api/authentication.md#types-of-token)
- **Scope:** [`hyperDB.records:read`](https://airtable.com/developers/web/api/scopes.md#hyper-db-records-read)
- **User role:** Enterprise admin
- **Billing plans:** Enterprise Scale

## Path parameters

- `enterpriseAccountId: string`

- `dataTableId: string`

## Request body

- `cursor: string` — optional

- `maxRecords: number` — optional

- `fields: array<string>` — optional

- `primaryKeys: array<string>` — optional

## Response format

- `nextCursor: string | null` — required

- `records: array<object>` — required

  - `fields: object` — required

    - `[key: string]: string | number | null`

  - `primaryKey: string` — required

### Example — Filtering on primary key

```sh
curl -X POST "https://api.airtable.com/v0/{enterpriseAccountId}/{dataTableId}/getRecords" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data '{
    "primaryKeys": [
      "483",
      "484",
      "99294934924299"
    ]
  }'
```

```json
{
  "nextCursor": null,
  "records": [
    {
      "fields": {
        "id": "473",
        "joined_date": "2025-02-25T12:00:00.000Z",
        "name": "Frank"
      },
      "primaryKey": "483"
    },
    {
      "fields": {
        "id": "484",
        "joined_date": null,
        "name": "Alice"
      },
      "primaryKey": "484"
    }
  ]
}
```

### Example — Querying all records - first request

```sh
curl -X POST "https://api.airtable.com/v0/{enterpriseAccountId}/{dataTableId}/getRecords" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data '{}'
```

```json
{
  "nextCursor": "25k49x",
  "records": [
    {
      "fields": {
        "id": "320",
        "joined_date": "2022-03-02T10:00:000.000Z",
        "name": "Pranesh"
      },
      "primaryKey": "320"
    },
    {
      "fields": {
        "id": "432",
        "joined_date": "2022-08-22T10:00:000.000Z",
        "name": "James"
      },
      "primaryKey": "432"
    },
    {
      "fields": {
        "id": "473",
        "joined_date": "2025-02-25T12:00:00.000Z",
        "name": "Frank"
      },
      "primaryKey": "483"
    }
  ]
}
```

### Example — Querying all records - second request using cursor

```sh
curl -X POST "https://api.airtable.com/v0/{enterpriseAccountId}/{dataTableId}/getRecords" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data '{
    "cursor": "25k49x"
  }'
```

```json
{
  "nextCursor": null,
  "records": [
    {
      "fields": {
        "id": "484",
        "joined_date": null,
        "name": "Alice"
      },
      "primaryKey": "484"
    },
    {
      "fields": {
        "id": "464",
        "joined_date": "2023-01-20T10:00:000.000Z",
        "name": "Nolan"
      },
      "primaryKey": "464"
    }
  ]
}
```
