Docs
Previews

Create a preview link

POST/preview-sessionsNeedscontent.view

A link that opens your app with drafts showing — only for whoever opens it, until it expires. launchUrl already has the token appended. The token (cpv_…) is shown once.

Authorization

secretKey
headerAuthorizationBearer <sk_…>

A secret API key from Settings → API keys. It acts with its creator's role.

Request Body

application/json
  1. body
scope*string
Value in"view""edit"
contentRefs?array<>|null
traits?|null
locale?|null
ttlMinutes?|null
siteUrl?|null

Response Body

Created

application/json
  1. response
session*
token*string

cpv_…. Shown once.

launchUrl*|

Open this. null when no URL for your app is known: pass siteUrl.

Shell
curl -X POST 'https://app.cueston.com/api/preview-sessions' \
  -H 'Content-Type: application/json' \
  -d '{
  "scope": "view"
}'
Example Response
JSON
{
  "session": {
    "id": "string",
    "scope": "view",
    "contentRefs": [
      {
        "type": "tour",
        "id": 42
      }
    ],
    "traits": {},
    "locale": "de-DE",
    "expiresAt": "2026-10-26T09:30:00Z",
    "revokedAt": "2026-10-26T09:30:00Z",
    "lastUsedAt": "2026-10-26T09:30:00Z",
    "createdAt": "2026-10-26T09:30:00Z",
    "status": "active"
  },
  "token": "cpv_3fQ9…",
  "launchUrl": "https://app.acme.com/?cueston_preview=cpv_3fQ9…"
}