---
title: "POST /api/v1/docs-sites/{spaceId}/previews"
method: POST
path: "/api/v1/docs-sites/{spaceId}/previews"
---

# POST /api/v1/docs-sites/{spaceId}/previews

`POST /api/v1/docs-sites/{spaceId}/previews`

## Request

- Base URL: `https://falconer.com` (the document declares no server; this is the origin it was published from)
- URL: `https://falconer.com/api/v1/docs-sites/{spaceId}/previews`
- Auth: none declared

## Path parameters

- `spaceId` integer, required: Space id, from GET /spaces.

## Headers

- `x-organization-id` string: Required when using OAuth bearer tokens.

## Request body

- RequestDocsPreviewRequest
  - `documentId` string: Open the preview on this document's page.

## Response `202`

Preview build queued.

- DocsPreview
  - `buildId` string, required
  - `documentId` string, nullable, required: The page previewUrl opens on. Not stored with the build, so pass it again when polling.
  - `status` 'queued' | 'building' | 'succeeded' | 'failed', required
  - `error` string, nullable, required
  - `previewUrl` string, nullable, required: Set once the build succeeded. Opens in a browser signed in to Falconer.
  - `blockedByAnotherBuild` boolean, required
  - `queuedForMs` integer, nullable, required

## Other responses

- `400`: Bad request
- `403`: Public docs are not enabled or permission is missing
- `404`: Docs site or build not found

---

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