API reference
The public content-delivery API - what @cairn-cms/client and cairn typegen read from a deployed project.
Base URL
https://api.cairn.pressPublished
Read published content from a project's dataset. No token needed for a public project - this is what a deployed site calls at request or build time.
Preview
Read unpublished drafts through a short-lived preview session. Grants are minted server-side with a project token, then exchanged for a session cookie by the preview route in your app.
POSTMint a preview grant/projects/{projectSlug}/datasets/{datasetSlug}/preview-tokenPOSTCreate a reusable external preview link/projects/{projectSlug}/datasets/{datasetSlug}/preview-linkPOSTExchange a single-use preview grant for an ongoing preview session/projects/{projectSlug}/preview/sessionGETMint a short-lived, asset-scoped preview token for secure.cdn.cairn.press/projects/{projectSlug}/preview/asset-tokenGETResolve the current preview session to a dataset + view + optional document/projects/{projectSlug}/preview/resolveGETList documents of a type, through the preview session's view (draft or published)/projects/{projectSlug}/preview/types/{type}/documentsGETGet a single document through the preview session's view/projects/{projectSlug}/preview/types/{type}/documents/{id}GETGet a singleton document through the preview session's view/projects/{projectSlug}/preview/types/{type}/singletonSchema
Read a project's published document and block types. Consumed by `cairn typegen` to generate TypeScript interfaces - rarely called directly.