For the complete documentation index, see llms.txt. This page is also available as Markdown.

Generate a temporary preview URL for a site's published content

Generates a time-limited URL (valid for 1 hour) to preview how a site will look when published. Use this to verify changes before making the site publicly accessible.

Available in MCP
get
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
organizationIdstringRequired

A unique entity identifier

Pattern: ^[a-zA-Z0-9_-]+$
siteIdstringRequired

The unique id of the site

Query parameters
siteSpacestringOptional

ID of the site-space to preview. If not provided, the default site-space will be used.

claimsstringOptional

Rison encoded string of attributes/assertions about the visitor for which we want to preview the site.

countrystringOptional

ISO 3166-1 alpha-2 code of the country of the visitor for which we want to preview the site. It is matched against the regions of the site adaptive schema to resolve visitor.region.

visitorAuthenticatedbooleanOptional

Whether the visitor for which we want to preview the site is signed in, as visitor.isAuthenticated reports it. Claims outside unsigned already imply a signed-in visitor; set this to preview one that is signed in while carrying no claim.

draftbooleanOptional

Whether to include draft content in the preview. Defaults to true

Default: true
targetstringOptional

Target URL of the preview. If not provided, the default site preview URL will be used.

Responses
200

OK

application/json
urlstring · uri · max: 2048Required
get/orgs/{organizationId}/sites/{siteId}/publishing/preview
GET /v1/orgs/{organizationId}/sites/{siteId}/publishing/preview HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "url": "https://example.com"
}

Last updated

Was this helpful?