# Update or insert records from a HyperDB table by primary keys

`PUT https://api.airtable.com/v0/{enterpriseAccountId}/{dataTableId}/upsertRecords`

Update or insert records from a HyperDB table with primary keys matching specified primary keys

## Requirements

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

## Path parameters

- `enterpriseAccountId: string`

- `dataTableId: string`

## Request body

- `records: array<object>` — required

  - `fields: object` — required

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

  - `primaryKey: string` — required

## Response format

- `_promisedCompressedResponseDataSymbol: unknown` — required

- `compressedResponseDataResultPromise: object` — required

### Example — Example response

```sh
curl -X PUT "https://api.airtable.com/v0/{enterpriseAccountId}/{dataTableId}/upsertRecords" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data '{
    "records": [
      {
        "fields": {
          "id": "483",
          "name": "Frank"
        },
        "primaryKey": "483"
      },
      {
        "fields": {
          "id": "484",
          "name": "Alice"
        },
        "primaryKey": "484"
      }
    ]
  }'
```
