Skip to content

Deploys

Deploys build the project and ship it to Cloudflare. A deploy is asynchronous: create returns immediately with a QUEUED status, then you poll for completion.

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

Body: optional force (boolean) to override an in-progress or stale deploy. Returns { deploy: { status: "QUEUED" } } with 202. Responds 409 deploy_in_progress if one is already running (and not stale or forced).

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 one of QUEUED, CHECKING, BUILDING, DEPLOYING, READY, ERROR.

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)