
# Delete a preview

Expire a preview so its URL no longer serves it.

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

Requires the `deploy` scope.

## Usage

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

## Authorizations

| Header | Type | Required | Description |
|--------|------|----------|-------------|
| Authorization | string | Yes | Bearer token (`Authorization: Bearer sp_...`). Created in the dashboard under Account > Tokens. See [authentication](/api/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](/api/previews/get-previews-previewid).

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