---
title: "Open a version in a preview session"
method: POST
path: "/v1/spaces/{spaceId}/versions/{versionId}/preview-session"
tags: ["Versions"]
---

# Open a version in a preview session

`POST /v1/spaces/{spaceId}/versions/{versionId}/preview-session`

## Request

- Base URL: `https://api.spacefast.com`
- URL: `https://api.spacefast.com/v1/spaces/{spaceId}/versions/{versionId}/preview-session`
- Auth: HTTP bearer

Mints a short-lived URL that opens one page of this version — including a private one — with its stylesheets, scripts and images authorized too. The URL is meant to be framed: following it once exchanges the proof it carries for a cookie on the version's own origin and redirects to the same page without it, so the framed document holds no secret. The session authorizes that version only. Requires the same permission as minting a file link.

## Path parameters

- `spaceId` string, required
- `versionId` string, required

## Request body

- object
  - `landingPath` string: Page to open in the preview. Defaults to the version's root.

## Response `200`

Response for status 200

- object
  - `$schema` string, uri: Canonical JSON Schema URL for this response body. The server also sends it in the `Link: rel="describedby"` response header.
  - `data` object, required
    - `versionId` string, required
    - `origin` string, uri, required
    - `landingPath` string, required
    - `url` string, uri, required: Frame this URL. Following it once exchanges the proof it carries for a cookie and redirects to the same page without it.
    - `expiresAt` string, date-time, required: When the preview session stops working.

## Other responses

- `default`: Problem details (RFC 9457). Any 4xx/5xx response is one `application/problem+json` document.

---

[API](https://skmtc.dev/spacefast/apis/spacefast-api.md) · [All operations](https://skmtc.dev/spacefast/apis/spacefast-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spacefast/apis/spacefast-api/revisions/bd165bc7c983?raw)
