Trigger preview deployment
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.
Use this endpoint to programmatically create or update a preview deployment for a Git branch. If a preview already exists for the specified branch, the endpoint triggers a redeployment instead of creating a duplicate.
The response includes a statusId that you can pass to Get deployment status to track the deployment progress.
Branch requirements
The branch must exist in the repository connected to your Mintlify project and you must have the Mintlify GitHub App installed. This endpoint does not support branches on forks. See Fork pull requests for how to preview changes from a fork.
Use cases
Access to previews
By default, previews created with this endpoint are publicly accessible unless you enable authentication for your previews. See Restrict access to preview deployments.
To restrict access to a specific preview, pass an auth object in the request body. Mintlify applies the access setting to the preview before queuing the deployment. If you omit auth, the preview keeps its current access settings.
Setting auth has these requirements:
Rate limits
This endpoint allows up to 5 requests per minute per organization.
Authorizations
The Authorization header expects a Bearer token. Use an admin API key. This is a server-side secret key. Generate one on the API keys page in your dashboard.
Path Parameters
Your project ID. Can be copied from the API keys page in your dashboard.
Body
application/jsonThe name of the Git branch to create a preview deployment for.
Minimum string length: 1
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.
Password-protect the preview. Anyone with the password can view it.
Available options: password
The password reviewers enter to view the preview. Must be at least 8 characters. Replaces any existing password on the preview.
Minimum string length: 8
Response
Preview deployment queued successfully.
The status ID for tracking the preview deployment. Use this with the Get deployment status endpoint.
The URL where the preview deployment is hosted.