Mint a short-lived, asset-scoped preview token for secure.cdn.cairn.press
GET/projects/{projectSlug}/preview/asset-tokenRequires an active preview session — either the cairn_preview cookie set by createPreviewHandler, or a preview session token sent as Authorization: Bearer <token>.
Path parameters
projectSlug* | string | The project's slug |
Query parameters
token | string | Preview token, as a fallback for callers that can't set an Authorization header (e.g. a WebSocket handshake) |
Responses
| 200 | Safe to embed directly in a browser-facing <img src> - grants only preview-asset reads for this project, nothing else |
| 401 | Missing, invalid, expired, or revoked preview session |
Request
curl "https://api.cairn.press/projects/my-project/preview/asset-token?token=token" \
-H "Authorization: Bearer $CAIRN_PREVIEW_TOKEN"Response · 200
{
"token": "string",
"expiresAt": "2026-01-15T09:24:00.000Z"
}