Hanzo AI
OpenapiProjects

Complete deployments

CompleteDeployment is the CI completion hook that flips a queued git deployment to live (or error) once CI has synced the built site to S3.

POST /v1/projects/{slug}/deployments/{id}/complete

Addresshttps://api.hanzo.ai/v1/projects/{slug}/deployments/{id}/complete
MethodPOST
Operationpost_projects_by_slug_deployments_by_id_complete
AuthAuthorization: Bearer $HANZO_API_KEY

CompleteDeployment is the CI completion hook that flips a queued git deployment to live (or error) once CI has synced the built site to S3.

status must be live or error. On a LIVE completion the public host is claimed FIRST, so the deployment reports the URL it actually OWNS — a CI-supplied liveUrl is a hint that can refine that URL but can never assert a subdomain another tenant holds. keys is the manifest CI just uploaded, relative to the deployment prefix: cloud reconciles the prefix against it so a page deleted from the build actually stops serving. Omit keys and nothing is deleted — the prefix only grows. Reconciliation runs only on a live completion (pruning against a failed build's manifest would delete the site the last good build is still serving) and is best-effort, so a stale leftover never turns a successful deploy into a 500. A live completion is also the one billable moment on the git path; an error completion bills nothing.

Scope: a validated principal is required (403 without one). CI authenticates with an org-scoped token through the gateway, so the deployment is resolved within that principal's org and another tenant's slug or deployment id is a 404.

Request

11 fields, body application/json (required).

FieldInTypeRequiredDescription
slugpathstringyesSlug is the project the deployment belongs to, from the path.
idpathstringyesID is the queued deployment to complete, from the path.
bytesbodyinteger—Bytes is their total size in bytes.
commitbodystring—Commit is the revision that was built, recorded on the deployment.
filesbodyinteger—Files is how many objects CI published.
idbodystring—ID is the queued deployment to complete, from the path.
keysbodystring[]—Keys is the manifest CI just uploaded, RELATIVE to the deployment prefix.
liveUrlbodystring—LiveURL is a HINT at the address the site should serve at.
messagebodystring—Message is what happened, in words — on an error completion, why it failed.
slugbodystring—Slug is the project the deployment belongs to, from the path.
statusbodystring—Status is how the build ended: live if it succeeded, error if it did not.

Response

StatusBodyMeaning
200projectsDeploymentok

200 body — 21 fields.

FieldInTypeAlwaysDescription
bucketbodystring—Bucket is the object-store bucket its files were written to.
bytesbodyinteger—Bytes is their total size in bytes.
commitbodystring—Commit is the revision that was built, for a deployment that came from a repository.
createdAtbodyinteger—CreatedAt is when the deployment was queued, as Unix seconds.
filesbodyinteger—Files is how many objects the deployment published.
idbodystring—ID identifies this one deployment attempt, and is what CI quotes back to complete it.
liveUrlbodystring—LiveURL is where this deployment serves, once it is live.
messagebodystring—Message is what happened, in words — the build's own note, or on a failure why it failed.
prefixbodystring—Prefix is the key prefix within that bucket holding EXACTLY this deployment's objects — the unit an upload grant is scoped to, so a grant for one deployment…
projectIdbodystring—ProjectID is the project this deployment belongs to.
sourcebodystring—Source is what caused the deployment — a git push, an uploaded artifact, a generated site.
statusbodystring—Status is where the attempt got to — queued, live, or failed.
updatedAtbodyinteger—UpdatedAt is when it last changed state, as Unix seconds — so the gap between the two is how long the build took.
uploadbodyprojectsUploadGrant—
upload.expiresAtbodyinteger—ExpiresAt is when the grant stops being accepted, as Unix seconds.
upload.fieldsbodyobject—Fields are form values every POST must carry VERBATIM, alongside key and file.
upload.fields.*bodystring—
upload.maxBytesbodyinteger—MaxBytes bounds ONE object, not the upload as a whole.
upload.prefixbodystring—Prefix is the only place this grant can write: the deployment's own key prefix.
upload.urlbodystring—URL is the address to POST each object to.
versionbodyinteger—Version counts deployments of this project from 1, so the history reads as an ordered sequence rather than by timestamp.

Failure carries the platform error shape — see Errors.

Examples

hanzo projects deployments complete <slug> <id>

Projects API · All Hanzo APIs · Interactive reference

How is this guide?

On this page