---
title: "Create a Pages preview link"
method: POST
path: "/api/pages/{siteId}/preview-links"
tags: ["pages"]
---

# Create a Pages preview link

`POST /api/pages/{siteId}/preview-links`

## Request

- Base URL: `https://app.goosybear.ai`
- URL: `https://app.goosybear.ai/api/pages/{siteId}/preview-links`
- Auth: HTTP bearer

Creates a time-limited preview link for a site in the API key's workspace. Omit `ttlMinutes` for 4320 minutes; allowed whole-minute values are 5 through 4320. This REST-only endpoint has no MCP-tool equivalent. The returned token is a bearer capability and must be handled as a secret.

## Path parameters

- `siteId` string, uuid, required

## Request body

- object
  - `ttlMinutes` integer
  - `workspace` string

## Response `200`

The request succeeded. Read the `data` Result field.

- object
  - `ok` true, required
  - `data` object, required
    - `siteId` string, uuid, required
    - `revision` string, required
    - `url` string, uri, required
    - `token` string, required
    - `expiresAt` string, date-time, required

## Other responses

- `400`: The site id or JSON request body did not match the endpoint's strict schema.
- `401`: No bearer credential, or one that did not resolve.
- `403`: Programmatic access is unavailable to this holder, the named workspace is outside the key's scope, or the holder lacks `pages.manage` there. `workspace_ambiguous` and `workspace_unreachable` also answer here, and the slugs this key may pass are appended to `error.message`.
- `404`: The site is not in the API key's workspace.
- `409`: The site has no previewable revision.
- `429`: The API key is over its rate limit. Wait for `Retry-After` before retrying.
- `500`: An unexpected server error occurred while handling the request.
- `503`: Preview hosting is temporarily unavailable in this environment.

---

[API](https://skmtc.dev/goosybear/apis/goosy-bear-api.md) · [All operations](https://skmtc.dev/goosybear/apis/goosy-bear-api/llms.txt) · [OpenAPI document](https://skmtc.dev/goosybear/apis/goosy-bear-api/revisions/0e033701d3f7?raw)
