Skip to content

Deploys

Deploys build the project on Vercel and make it live. A deploy is asynchronous: create returns immediately with a QUEUED status, then you poll for completion. Deleting the deploy takes the site offline.

POST /api/v1/projects/{id}/deploy

Body: optional force (boolean) to start a deploy while another is running. Returns { deploy: { status: "QUEUED", id, url } } with 202. Responds 409 deploy_in_progress if one is already queued or building and force is not set.

await client.deploys.create(projectId) // { force: true } to override
GET /api/v1/projects/{id}/deploy

Returns { deploy: { status, logs, url, deployed_at, duration_ms } }. status is the Vercel deployment state: QUEUED, INITIALIZING, BUILDING, READY, ERROR or CANCELED.

let deploy = await client.deploys.status(projectId)
while (deploy.status && !['READY', 'ERROR'].includes(deploy.status)) {
await new Promise((r) => setTimeout(r, 3000))
deploy = await client.deploys.status(projectId)
}
console.log(deploy.status, deploy.url, deploy.logs)
DELETE /api/v1/projects/{id}/deploy

Removes the live deployment, as Unpublish does in the app. The project’s Vercel project, domains and env vars stay attached, so deploying again brings the site back. Returns { deployed: false }.

await client.deploys.delete(projectId)