Update


PATCH/api/v1/{API_ID}/{COLUMN_NAME}/{VALUE}

Update with single query

Updates the content for the specified row. You must specify a column name and a value to find the row(s) you want to update. All rows that meet the condition will be updated. It updates only the columns passed in the data object, the other columns will remain unchanged.

Returns count of updated rows.

Required attributes

  • Name
    data
    Type
    json
    Description

    The object containing the data you want to change.

    Example: {'name': "Mark", 'age': 28}

Optional attributes

  • Name
    sheet
    Type
    string
    Description

    The sheet (tab) you want to select.

  • Name
    mode
    Type
    string
    Description

    Value Input Option, more info here.

Request

PATCH
/api/v1/{API_ID}/{COLUMN_NAME}/{VALUE}
curl -X PATCH -G https://sheetdb.io/api/v1/58f61be4dda40/id/3 \
  -d name=Emma

JSON Response

{
    updated: 1
}


PATCH/api/v1/{API_ID}/batch_update

Batch update

Update for multiple queries. The required attribute data should be an array, and each object in it should have a query (for example, "id=3").

All queries will be updated as in a regular PATCH update.

It returns the number of updated rows.

Required attributes

  • Name
    data
    Type
    json
    Description

    An array containing the objects you want to change. Each object should contain a query that will filter the rows to be updated.

    Example:

    [
        {
            "query":"id=1",
            "name":"Sophia",
            "age":20
        },{
            "query":"id=2",
            "age":25
        }
    ]
    

Optional attributes

  • Name
    sheet
    Type
    string
    Description

    The sheet (tab) you want to select.

  • Name
    mode
    Type
    string
    Description

    Value Input Option, more info here.

Request

PATCH
/api/v1/{API_ID}/batch_update
curl -X PATCH -G https://sheetdb.io/api/v1/58f61be4dda40/batch_update \
  -d data='[{"query":"id=1","name":"Sophia","age":20},{"query":"id=2","age":25}]'

JSON Response

{
    updated: 2
}