Create Preview Deployment

API server

https://app.coolify.io/api/v1

Choose where to send API requests

This changes the request URL and code examples on every endpoint page.

API server type

Requests will use

https://app.coolify.io/api/v1

Use only a Coolify URL you trust. Sending a test request also sends the API token you enter.

POST
/applications/{uuid}/previews

Open 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
AuthorizationBearer <token>

Go to Keys & Tokens / API tokens and create a new token. Use the token as the bearer token.

In: header

Path Parameters

uuid*string

UUID of the application.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

pull_request_id*integer
Range1 <= value <= 2147483647
pull_request_html_url?string|null
git_type?|

Git provider that hosts the pull request. Sets the ref Coolify fetches (pull/{id}/head or merge-requests/{id}/head).

Value in"github" | "gitlab" | "gitea" | "bitbucket"
commit?|

Commit SHA to deploy. Required for Bitbucket.

docker_tag?|

Docker image tag. Docker Image applications only.

force?boolean

Rebuild without cache.

Defaultfalse
instant_deploy?boolean

Queue a deployment. Set to false to only create the preview, for example to set its domains first.

Defaulttrue

Response 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."    ]  }}
Empty