List previews

List the site’s active previews.

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

Requires the deploy scope.

Usage

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

Authorizations

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

Query parameters

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

Response

{
  "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"
    }
  ]
}
FieldTypeDescription
idstringPreview ID.
visibilitystringpublic, password, or workspace.
hasPasswordbooleanWhether a password is set.
statusstringbuilding or ready. Only active previews are listed, so failed, promoted, and expired never appear here. Read the item to see those.
hasBeenBuiltbooleanWhether 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.
urlstringWhere the preview is served.
authUrlstringSign-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.
expiresAtstringRFC 3339. Previews expire after seven days.
createdAtstringRFC 3339.
createdByNamestringThe name of the API token or dashboard user that created the preview, as triggeredByName names a deploy’s. Omitted when unknown.