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.
Create a deploy
Section titled “Create a deploy”POST /api/v1/projects/{id}/deployBody: 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 overrideDeploy status
Section titled “Deploy status”GET /api/v1/projects/{id}/deployReturns { 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)Related
Section titled “Related”- Publish / unpublish toggles public availability at the project handle.