deployments
Create deployment
Create a deployment for an app in a project.
Provide exactly one source:
- image: deploy a prebuilt Docker image as-is (no build).
- git: build and deploy from the app's connected GitHub repository, a branch, a specific commit, or a fork commit. Requires the app to have a repository connected.
- deployment: re-run an existing deployment by its id. Git-connected apps rebuild from the recorded commit; other apps reuse the recorded image.
Returns immediately with a deploymentId. The build and rollout run asynchronously — poll deployments.getDeployment to watch status until it is ready.
Authentication: requires a root key with permission to create deployments.
post/v2/deployments.createDeployment
Request body
Example request
{
"project": "proj_1234abcd",
"app": "proj_1234abcd",
"environment": "proj_1234abcd",
"git": {
"branch": "main",
"commitSha": "9f2c1a7",
"repository": "contributor/acme-api"
},
"image": {
"dockerImage": "ghcr.io/acme/api:v1.2.3"
},
"deployment": {
"deploymentId": "proj_1234abcd"
}
}Response
Deployment created successfully
Example response
{
"meta": {
"requestId": "req_123"
},
"data": {
"deploymentId": "d_abc123xyz"
}
}