Delete a preview

Expire a preview so its URL no longer serves it.

DELETE https://sitepaste.com/api/v1/public/sites/{siteId}/previews/{previewId}

Requires the deploy scope.

Usage

curl -X DELETE "https://sitepaste.com/api/v1/public/sites/default/previews/pv7k3q9r2m4x" \
  -H "Authorization: Bearer $TOKEN"

Authorizations

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

Response

204 No Content. The preview is no longer served; the live site is untouched.

400 when {previewId} is malformed. 404 when no preview on this site has that id. A preview belonging to a different site of the same workspace is a 404 here too, as on read a preview.

409 when the preview is not building, ready, or failed. An already promoted or expired preview cannot be deleted.