Create or rebuild a preview deployment for a specific branch programmatically.
curl --request POST \
--url https://api.mintlify.com/v1/project/preview/{projectId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch": "<string>"
}
'{
"statusId": "<string>",
"previewUrl": "<string>"
}The Authorization header expects a Bearer token. Use an admin API key (prefixed with mint_). This is a server-side secret key. Generate one on the API keys page in your dashboard.
The name of the branch to create a preview deployment for.
1Preview deployment queued successfully
The status ID of the triggered preview deployment. Use this with the Get deployment status endpoint to poll for progress.
The URL where the preview deployment will be accessible.
Was this page helpful?
curl --request POST \
--url https://api.mintlify.com/v1/project/preview/{projectId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch": "<string>"
}
'{
"statusId": "<string>",
"previewUrl": "<string>"
}