POST/applications/{uuid}/previews

Create a preview deployment

Creates or redeploys a preview deployment for a pull request on an application. Provide pull_request_id and the relevant source details: Git-based applications need git_type unless they use a GitHub or GitLab App source, and Bitbucket also needs commit. For a new Docker Image preview, provide docker_tag; set instant_deploy to false to create the preview without queuing deployment, such as when you need to configure domains first.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 7 body fields
uuidstringrequired
The UUID of the application for which to create or redeploy the preview.

Preview deployment details for a pull request. Include the source-specific fields required for the application type.

commitstringoptional
Commit SHA to deploy. Required for Bitbucket.
docker_tagstringoptional
Docker image tag. Docker Image applications only.
forcebooleanoptional
Rebuild without cache.
Default:false
git_typestringoptional
Git provider that hosts the pull request. Sets the ref Coolify fetches (pull/{id}/head or merge-requests/{id}/head).
Allowed:githubgitlabgiteabitbucket
instant_deploybooleanoptional
Queue a deployment. Set to false to only create the preview, for example to set its domains first.
Default:true
pull_request_html_urlstringoptional
The URL of the pull request.
pull_request_idintegerrequired
The pull request identifier. Must be between 1 and 2147483647.

7 status codes
200Returns the updated preview deployment, its deployment UUID when available, and a message.
deployment_uuidstringoptional
messagestringoptional
previewobjectoptional
201Returns the created preview deployment, its deployment UUID when available, and a message.
deployment_uuidstringoptional
messagestringoptional
previewobjectoptional
400Returned when the token is invalid.
messagestringoptional
401Returned when the request is unauthenticated.
messagestringoptional
404Returned when a required resource is not found.
messagestringoptional
422Returned when request validation fails.
errorsobjectoptional
messagestringoptional
429Returned when the deployment queue is full.

Error handling

A 400 is returned for an invalid token, and a 401 when the request is unauthenticated. A 404 indicates a missing resource, a 422 indicates validation failed, and a 429 means the deployment queue is full; pull_request_id is required and must be between 1 and 2147483647. The uuid path parameter must identify an existing application.