> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://reference.flatfile.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://reference.flatfile.com/_mcp/server.

# Update records

PUT https://api.x.flatfile.com/v1/sheets/{sheetId}/records
Content-Type: application/json

Updates existing records in a workbook sheet

Reference: https://reference.flatfile.com/api-reference/records/update

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `sheetId` (string, required) — ID of sheet

### Body (application/json)

This endpoint expects a list of Record.

- `list of Record`

## Response

### 200

- `data` (Version, required)

## Errors

### 400 Bad Request Error

- `errors` (list of Error, required)

### 404 Not Found Error

- `errors` (list of Error, required)

## Types

### Record

A single row of data in a Sheet

- `id` (string, required) — Record ID
- `values` (map from string to CellValue, required) — A single row of data in a Sheet
- `commitId` (string, optional) — Commit ID
- `config` (RecordConfig, optional) — Configuration of a record or specific fields in the record
- `metadata` (map from string to any, optional)
- `valid` (boolean, optional) — Auto-generated value based on whether the record contains a field with an error message. Cannot be set via the API.
- `messages` (list of ValidationMessage, optional, deprecated) — This record level `messages` property is deprecated and no longer stored or used. Use the `messages` property on the individual cell values instead. This property will be removed in a future release.
- `versionId` (string, optional, deprecated) — Deprecated, use `commitId` instead.

### Version

- `versionId` (string, required) — Version ID

### Error

- `message` (string, required)
- `key` (string, optional)

### CellValue

- `valid` (boolean, optional)
- `messages` (list of ValidationMessage, optional)
- `value` (CellValueUnion, optional)
- `layer` (string, optional)
- `updatedAt` (datetime, optional)
- `metadata` (map from string to any, optional, deprecated) — Deprecated, use record level metadata instead.

### RecordConfig

Configuration of a record or specific fields in the record

- `readonly` (boolean, optional)
- `fields` (map from string to CellConfig, optional)
- `markedForDeletion` (boolean, optional)

### ValidationMessage

Record data validation messages

- `field` (string, optional)
- `type` (enum, optional)
  - Allowed values: `error`, `warn`, `info`
- `source` (enum, optional)
  - Allowed values: `required-constraint`, `unique-constraint`, `custom-logic`, `unlinked`, `invalid-option`, `is-artifact`
- `message` (string, optional)
- `path` (string, optional) — This JSONPath is based on the root of mapped cell object.

### CellValueUnion

### CellConfig

CellConfig

- `readonly` (boolean, optional)

## Examples

**Request**

```json
[
  {
    "id": "us_rc_YOUR_ID",
    "values": {
      "firstName": {
        "valid": true,
        "messages": [],
        "value": "John"
      },
      "lastName": {
        "valid": true,
        "messages": [],
        "value": "Smith"
      },
      "email": {
        "valid": true,
        "messages": [],
        "value": "john.smith@example.com"
      }
    },
    "commitId": "us_vr_YOUR_ID",
    "config": {},
    "metadata": {},
    "valid": true,
    "versionId": "us_vr_YOUR_ID"
  }
]
```

**Response**

```json
{
  "data": {
    "versionId": "us_vr_YOUR_ID"
  }
}
```

**SDK Code**

```python Example0
import requests

url = "https://api.x.flatfile.com/v1/sheets/us_sh_YOUR_ID/records"

payload = [
    {
        "id": "us_rc_YOUR_ID",
        "values": {
            "firstName": {
                "valid": True,
                "messages": [],
                "value": "John"
            },
            "lastName": {
                "valid": True,
                "messages": [],
                "value": "Smith"
            },
            "email": {
                "valid": True,
                "messages": [],
                "value": "john.smith@example.com"
            }
        },
        "commitId": "us_vr_YOUR_ID",
        "config": {},
        "metadata": {},
        "valid": True,
        "versionId": "us_vr_YOUR_ID"
    }
]
headers = {
    "X-Disable-Hooks": "true",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```typescript Example0
import { FlatfileClient } from "@flatfile/api";

const client = new FlatfileClient({ token: "YOUR_TOKEN" });
await client.records.update("us_sh_YOUR_ID", [{
        id: "us_rc_YOUR_ID",
        versionId: "us_vr_YOUR_ID",
        commitId: "us_vr_YOUR_ID",
        values: {
            "firstName": {
                value: "John",
                messages: [],
                valid: true
            },
            "lastName": {
                value: "Smith",
                messages: [],
                valid: true
            },
            "email": {
                value: "john.smith@example.com",
                messages: [],
                valid: true
            }
        },
        valid: true,
        metadata: {},
        config: {}
    }]);

```

```go Example0
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.x.flatfile.com/v1/sheets/us_sh_YOUR_ID/records"

	payload := strings.NewReader("[\n  {\n    \"id\": \"us_rc_YOUR_ID\",\n    \"values\": {\n      \"firstName\": {\n        \"valid\": true,\n        \"messages\": [],\n        \"value\": \"John\"\n      },\n      \"lastName\": {\n        \"valid\": true,\n        \"messages\": [],\n        \"value\": \"Smith\"\n      },\n      \"email\": {\n        \"valid\": true,\n        \"messages\": [],\n        \"value\": \"john.smith@example.com\"\n      }\n    },\n    \"commitId\": \"us_vr_YOUR_ID\",\n    \"config\": {},\n    \"metadata\": {},\n    \"valid\": true,\n    \"versionId\": \"us_vr_YOUR_ID\"\n  }\n]")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("X-Disable-Hooks", "true")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Example0
require 'uri'
require 'net/http'

url = URI("https://api.x.flatfile.com/v1/sheets/us_sh_YOUR_ID/records")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["X-Disable-Hooks"] = 'true'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n  {\n    \"id\": \"us_rc_YOUR_ID\",\n    \"values\": {\n      \"firstName\": {\n        \"valid\": true,\n        \"messages\": [],\n        \"value\": \"John\"\n      },\n      \"lastName\": {\n        \"valid\": true,\n        \"messages\": [],\n        \"value\": \"Smith\"\n      },\n      \"email\": {\n        \"valid\": true,\n        \"messages\": [],\n        \"value\": \"john.smith@example.com\"\n      }\n    },\n    \"commitId\": \"us_vr_YOUR_ID\",\n    \"config\": {},\n    \"metadata\": {},\n    \"valid\": true,\n    \"versionId\": \"us_vr_YOUR_ID\"\n  }\n]"

response = http.request(request)
puts response.read_body
```

```java Example0
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.x.flatfile.com/v1/sheets/us_sh_YOUR_ID/records")
  .header("X-Disable-Hooks", "true")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("[\n  {\n    \"id\": \"us_rc_YOUR_ID\",\n    \"values\": {\n      \"firstName\": {\n        \"valid\": true,\n        \"messages\": [],\n        \"value\": \"John\"\n      },\n      \"lastName\": {\n        \"valid\": true,\n        \"messages\": [],\n        \"value\": \"Smith\"\n      },\n      \"email\": {\n        \"valid\": true,\n        \"messages\": [],\n        \"value\": \"john.smith@example.com\"\n      }\n    },\n    \"commitId\": \"us_vr_YOUR_ID\",\n    \"config\": {},\n    \"metadata\": {},\n    \"valid\": true,\n    \"versionId\": \"us_vr_YOUR_ID\"\n  }\n]")
  .asString();
```

```php Example0
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.x.flatfile.com/v1/sheets/us_sh_YOUR_ID/records', [
  'body' => '[
  {
    "id": "us_rc_YOUR_ID",
    "values": {
      "firstName": {
        "valid": true,
        "messages": [],
        "value": "John"
      },
      "lastName": {
        "valid": true,
        "messages": [],
        "value": "Smith"
      },
      "email": {
        "valid": true,
        "messages": [],
        "value": "john.smith@example.com"
      }
    },
    "commitId": "us_vr_YOUR_ID",
    "config": {},
    "metadata": {},
    "valid": true,
    "versionId": "us_vr_YOUR_ID"
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'X-Disable-Hooks' => 'true',
  ],
]);

echo $response->getBody();
```

```csharp Example0
using RestSharp;

var client = new RestClient("https://api.x.flatfile.com/v1/sheets/us_sh_YOUR_ID/records");
var request = new RestRequest(Method.PUT);
request.AddHeader("X-Disable-Hooks", "true");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"id\": \"us_rc_YOUR_ID\",\n    \"values\": {\n      \"firstName\": {\n        \"valid\": true,\n        \"messages\": [],\n        \"value\": \"John\"\n      },\n      \"lastName\": {\n        \"valid\": true,\n        \"messages\": [],\n        \"value\": \"Smith\"\n      },\n      \"email\": {\n        \"valid\": true,\n        \"messages\": [],\n        \"value\": \"john.smith@example.com\"\n      }\n    },\n    \"commitId\": \"us_vr_YOUR_ID\",\n    \"config\": {},\n    \"metadata\": {},\n    \"valid\": true,\n    \"versionId\": \"us_vr_YOUR_ID\"\n  }\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example0
import Foundation

let headers = [
  "X-Disable-Hooks": "true",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "id": "us_rc_YOUR_ID",
    "values": [
      "firstName": [
        "valid": true,
        "messages": [],
        "value": "John"
      ],
      "lastName": [
        "valid": true,
        "messages": [],
        "value": "Smith"
      ],
      "email": [
        "valid": true,
        "messages": [],
        "value": "john.smith@example.com"
      ]
    ],
    "commitId": "us_vr_YOUR_ID",
    "config": [],
    "metadata": [],
    "valid": true,
    "versionId": "us_vr_YOUR_ID"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.x.flatfile.com/v1/sheets/us_sh_YOUR_ID/records")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```