UPDATE

PATCH/v1/data/:id

This endpoint allows you to update existing rows in a specific sheet of your spreadsheet. You can either update rows based on their index or apply a filter to update matching rows.

To update by row index, provide the row number. To update using a filter, specify a filter expression that matches the rows you want to update.

id
stringRequired
Example: aace0271-c068-499f-bb40-83354a35eebc
The unique identifier for the API
sheet
stringOptional
Example: Transactions
The name of the sheet (tab) within the spreadsheet to operate on.

type
enum['row' | 'filter']Required
Example: filter
Specifies the update mode: use 'row' to update by row index or 'filter' to update rows matching a filter condition.
data
objectRequired
Example:
{
  "name": "John"
}
An object representing the columns and values to be updated in the row(s).
filter
stringRequired If type=filter
Example: id:eq:12332

A filter expression to select rows to update when type is set to 'filter'. For example, 'age:eq:21' to update rows where age is 21.

Learn More
row
integerRequired If type=row
Example: 5
The index (1-based excluding header) of the row to update when type is set to 'row'.

Request Example

curl -X PATCH https://api.sheet2db.dev/v1/data/aace0271-c068-499f-bb40-83354a35eebc/contacts \
-H "Content-Type: application/json" \
-d '{
  "type": "filter",
  "filter": "id:eq:12332",
  "data": {
    "age": 25
  }
}'

Successful Response Example

{
  "updated": 1
}