#
DELETE - Deleting Rows
DELETE
method is enabled by default, but you can disable it in sheet settings. See more.
If you have enabled support for DELETE
endpoint, you can delete rows from the spreadsheet using the GET method on your sheet endpoint.
#
Deleting with _id
The simplest way to delete row is by providing _id
query parameter, which can either be a single number or multiple numbers separated with comma.
Note indexes
Indexes start from 0
and not 1
. So if you want to delete the first row in your sheet, you'll need to pass 0
as _id
parameter.
#
Deleting single row
curl -X DELETE \
"https://sheetrest.com/api/v1/sheets/SHEET_ID?_id=0"
#
Deleting multiple rows
curl -X DELETE \
"https://sheetrest.com/api/v1/sheets/SHEET_ID?_id=0,1,2"
#
Deleting with filers
You can use the same filters as you would use for GET
method to delete rows. Read more about filters here.
For example, if you want to delete rows where name
is John
and age
is greater than 30
, you can do it like this:
curl -X DELETE \
"https://sheetrest.com/api/v1/SHEET_ID?Name=John&Age=__gt(30)"
#
Propagating to Google Sheets
If you're deleting rows from the spreadsheet imported from Google Sheets, your changes will be propagated to the original spreadsheet.
Google Sheets API has rate limiting, so if you're deleting a lot of rows, you might get 429 Too Many Requests
error. In this case, you can try to delete rows in smaller batches.