Create Preview Deployment
API server
https://app.coolify.io/api/v1Open a preview deployment for a pull request and queue its deployment. When the preview already exists, it is redeployed. Git based applications need git_type unless they use a GitHub or GitLab App source; Bitbucket also needs commit. Docker Image applications need docker_tag for a new preview.
Authorization
bearerAuth Go to Keys & Tokens / API tokens and create a new token. Use the token as the bearer token.
In: header
Path Parameters
UUID of the application.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
1 <= value <= 2147483647Git provider that hosts the pull request. Sets the ref Coolify fetches (pull/{id}/head or merge-requests/{id}/head).
"github" | "gitlab" | "gitea" | "bitbucket"Commit SHA to deploy. Required for Bitbucket.
Docker image tag. Docker Image applications only.
Rebuild without cache.
falseQueue a deployment. Set to false to only create the preview, for example to set its domains first.
trueResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://app.coolify.io/api/v1/applications/string/previews" \ -H "Content-Type: application/json" \ -d '{ "pull_request_id": 42 }'{ "message": "string", "deployment_uuid": "string", "preview": { "uuid": "string", "pull_request_id": 0, "pull_request_html_url": "string", "git_type": "string", "status": "string", "domains": "string", "docker_compose_domains": [ { "name": "string", "domain": "string", "redirect": "string" } ], "domain_port_overrides": {}, "docker_registry_image_tag": "string", "last_online_at": "string", "created_at": "string", "updated_at": "string" }}{ "message": "string", "deployment_uuid": "string", "preview": { "uuid": "string", "pull_request_id": 0, "pull_request_html_url": "string", "git_type": "string", "status": "string", "domains": "string", "docker_compose_domains": [ { "name": "string", "domain": "string", "redirect": "string" } ], "domain_port_overrides": {}, "docker_registry_image_tag": "string", "last_online_at": "string", "created_at": "string", "updated_at": "string" }}{ "message": "Invalid token."}{ "message": "Unauthenticated."}{ "message": "Resource not found."}{ "message": "Validation error.", "errors": { "name": [ "The name field is required." ], "api_url": [ "The api url field is required.", "The api url format is invalid." ] }}