Create a reusable external preview link
POST/projects/{projectSlug}/datasets/{datasetSlug}/preview-linkRequires 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
| 200 | An opaque, revocable credential that can be reused until its chosen expiry |
| 400 | Invalid expiry or document scope |
| 404 | Unknown 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"
}