---
title: "Trigger preview deployment"
method: POST
path: "/project/preview/{projectId}"
language: "en"
---

# Trigger preview deployment

`POST /project/preview/{projectId}`

## Request

- Base URL: `https://api.mintlify.com/v1`
- URL: `https://api.mintlify.com/v1/project/preview/{projectId}`
- Auth: HTTP bearer

Creates or updates a preview deployment for a specific branch. If a preview already exists for the branch, it triggers a redeployment. Returns a status ID to track progress and the preview URL.

Authenticate with an admin API key.

## Path parameters

- `projectId` string, required

## Request body

- object
  - `branch` string, required: The name of the Git branch to create a preview deployment for.
  - `auth` union: Access restriction to apply to the preview. Omit to leave the preview's current access settings unchanged. Requires a plan that includes preview authentication, and your site must have authentication or preview authentication enabled.
    - object
      - `type` 'password', required: Password-protect the preview. Anyone with the password can view it.
      - `password` string, required: The password reviewers enter to view the preview. Must be at least 8 characters. Replaces any existing password on the preview.
    - object
      - `type` 'mintlify', required: Restrict the preview to members of your organization signed in to Mintlify.

## Response `202`

Preview deployment queued successfully.

- object
  - `statusId` string: The status ID for tracking the preview deployment. Use this with the [Get deployment status](/api/update/status) endpoint.
  - `previewUrl` string: The URL where the preview deployment is hosted.

## Other responses

- `400`: Invalid request body. The `branch` field is required, and `auth` must match one of the supported shapes.
- `401`: The API key is missing or invalid, or your plan doesn't include API access.
- `403`: Preview deployments aren't available on your current plan, `auth` was provided and preview deployment authentication isn't available on your current plan, your API key doesn't have write access, or your request came from an IP address that isn't on your API key's allowlist.
- `404`: The project doesn't exist or doesn't belong to your organization.
- `409`: `auth` was provided but authentication is not enabled. Enable authentication or preview authentication for your project, and make sure authentication is enabled on the preview, before setting preview auth.
- `429`: You exceeded the rate limit of 5 requests per minute per organization.
- `500`: Mintlify failed to update the preview's authentication settings.

## Changes

- **2026-10-30** `eec808e66c6c`: 3 info
  - added the non-success response with the status `401`
  - added the non-success response with the status `404`
  - added the non-success response with the status `429`
- **2026-10-16** `be44abb9b2a6`: 3 info
  - added the new optional request property `auth`
  - added the non-success response with the status `409`
  - added the non-success response with the status `500`
- **2026-04-21** `1ea8edde71d4`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/mintlify/apis/mintlify-external-api/changes/project/preview/:projectId/post.md)

---

[API](https://skmtc.dev/mintlify/apis/mintlify-external-api.md) - [All operations](https://skmtc.dev/mintlify/apis/mintlify-external-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mintlify/apis/mintlify-external-api/revisions/51e728e9c5eb?raw)
