Delete several media files

Delete the files named in the query. To delete a single file, address it directly.

DELETE https://sitepaste.com/api/v1/public/media?fileIds=abc123.jpg,def456.png

Requires the media scope.

Usage

curl -X DELETE "https://sitepaste.com/api/v1/public/media?fileIds=abc123.jpg,def456.png" \
  -H "Authorization: Bearer $TOKEN"

Authorizations

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token (Authorization: Bearer sp_...). Created in the dashboard under Account > Tokens. See authentication.

Query parameters

ParameterTypeRequiredDescription
fileIdsstringYesThe files to delete, up to 100 distinct ids per request. Repeat the parameter (?fileIds=a&fileIds=b) or comma-join it (?fileIds=a,b); both work. A repeated id counts once.

Response

200 OK with the number of files deleted.

{ "deleted": 2 }

An id that matches no file in your workspace is skipped rather than failing the request, so deleted can be lower than the number of ids you sent.

Errors

CodeMeaning
422fileIds is missing, empty, or holds more than 100 distinct ids