Delete


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

Delete with single query

Deletes the specified row(s). You must specify a column name and a value to find the row(s) you want to delete. All rows that meet the condition will be deleted.

It returns count of deleted rows.

The {VALUE} part of the URL accepts the same syntax as the search endpoint: wildcards (*), negation (!), relational operators (<, >, <=, >=) and the casesensitive attribute. For example, DELETE /api/v1/{API_ID}/age/>20 deletes every row with age greater than 20. Wildcards work here regardless of the READ permission.

If no row matches, you will receive a 404 error with {"error": "No results found"}. If the column does not exist, you will receive a 404 error with {"error": "Undefined column: {COLUMN_NAME}"}.

If the sheet attribute points to a sheet (tab) that does not exist, you will receive a 404 error with {"error": "Sheet not found."} and no data will be modified.

Optional attributes

  • Name
    sheet
    Type
    string
    Description

    The sheet (tab) you want to select.

  • Name
    limit
    Type
    integer
    Description

    Maximum number of rows to delete. Rows are counted from the top of the sheet, so limit=2 deletes the first two matching rows.

  • Name
    casesensitive
    Type
    boolean
    Description

    By default, matching is not case-sensitive. Set this attribute to true to make it case-sensitive.

Request

DELETE
/api/v1/{API_ID}/{COLUMN_NAME}/{VALUE}
curl -X DELETE -G https://sheetdb.io/api/v1/58f61be4dda40/id/3

JSON Response

{
    deleted: 1
}

DELETE/api/v1/{API_ID}/duplicates

Delete duplicates

Deletes all duplicate (identical) rows.

It returns count of duplicated rows.

Optional attributes

  • Name
    sheet
    Type
    string
    Description

    The sheet (tab) you want to select.

Request

DELETE
/api/v1/{API_ID}/duplicates
curl -X DELETE -G https://sheetdb.io/api/v1/58f61be4dda40/duplicates

JSON Response

{
    duplicates: 1
}

DELETE/api/v1/{API_ID}/all

All content

Deletes all contents of the spreadsheet except the first row (column names).

It returns count of deleted rows.

Optional attributes

  • Name
    with_first_row
    Type
    boolean
    Description

    To delete the first row (column names), set this attribute to true.

  • Name
    sheet
    Type
    string
    Description

    The sheet (tab) you want to select.

Request

DELETE
/api/v1/{API_ID}/all
curl -X DELETE -G https://sheetdb.io/api/v1/58f61be4dda40/all

JSON Response

{
    deleted: 5
}