
# List previews

List the site's active previews.

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

Requires the `deploy` scope.

## Usage

```bash
curl "https://sitepaste.com/api/v1/public/sites/default/previews" \
  -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). |

## Query parameters

This collection is returned whole. It takes no `limit` or `offset`, and sending either answers 422.

## Response

```json
{
  "previews": [
    {
      "id": "pv7k3q9r2m4x",
      "visibility": "public",
      "hasPassword": false,
      "status": "ready",
      "hasBeenBuilt": true,
      "url": "https://preview-pv7k3q9r2m4x.sitepaste.com",
      "expiresAt": "2026-09-07T12:00:00Z",
      "createdAt": "2026-08-31T12:00:00Z",
      "createdByName": "ci-token"
    }
  ]
}
```

| Field | Type | Description |
|-------|------|-------------|
| id | string | Preview ID. |
| visibility | string | `public`, `password`, or `workspace`. |
| hasPassword | boolean | Whether a password is set. |
| status | string | `building` or `ready`. Only active previews are listed, so `failed`, `promoted`, and `expired` never appear here. [Read the item](/api/previews/get-previews-previewid) to see those. |
| hasBeenBuilt | boolean | Whether a build of the preview has succeeded before. It stays `true` while a rebuild runs, so a `building` preview with `hasBeenBuilt` is being rebuilt rather than built for the first time. |
| url | string | Where the preview is served. |
| authUrl | string | Sign-in link for a preview whose visibility is `workspace`. Always omitted for a token, which is not a workspace member. Create the preview as `public` or `password` if you need to fetch it back. |
| expiresAt | string | RFC 3339. Previews expire after seven days. |
| createdAt | string | RFC 3339. |
| createdByName | string | The name of the API token or dashboard user that created the preview, as `triggeredByName` names a deploy's. Omitted when unknown. |