The current draft of a document, with a preview token
const url = 'http://localhost:3000/api/v1/preview/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0?token=example';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://localhost:3000/api/v1/preview/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0?token=example'CORS allows only GENGA_PREVIEW_ORIGINS. The answer is never cached. Without GENGA_SECRET on the server, this endpoint answers 404.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”The genga-token parameter of the preview URL. Valid 10 minutes, for this document only.
Responses
Section titled “Responses”The draft. versionId is null.
object
object
The URL of the document on the site.
The published version. Null in a preview.
The field values. A media field is a Media object or null. A richText field is the
TipTap JSON plus html, the sanitized HTML, or null. A blocks field is a list of objects with _id, _type and
the block fields. A relation field is a RelatedDocument or null, or with multiple a list of RelatedDocument:
published targets only.
object
Example generated
{ "document": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "collection": "example", "slug": "example", "path": "example", "versionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "publishedAt": "2026-04-15T12:00:00Z", "data": {} }}Headers
Section titled “Headers”The token is missing, wrong or expired.
object
Example
{ "error": "bad_request"}No such collection, published document or media.
object
Example
{ "error": "bad_request"}Too many requests from this address.
object
Example
{ "error": "bad_request"}