Preview

Create a reusable external preview link

POST/projects/{projectSlug}/datasets/{datasetSlug}/preview-link

Requires a project token (Dashboard → Settings → API tokens), sent as Authorization: Bearer <token>. Keep it server-side — never prefix it with NEXT_PUBLIC_.

Path parameters

projectSlug*string
datasetSlug*string

Responses

200An opaque, revocable credential that can be reused until its chosen expiry
400Invalid expiry or document scope
404Unknown project/dataset, or documentId doesn't exist

Request

curl -X POST "https://api.cairn.press/projects/my-project/datasets/staging/preview-link" \
  -H "Authorization: Bearer $CAIRN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Response · 200

{
  "token": "string",
  "expiresAt": "2026-01-15T09:24:00.000Z"
}