Hanzo AI
OpenapiProject

Deploy project

Takes a built site live at `https://<slug>.hanzo.app` in one call.

POST /v1/project/{slug}/deploy

Addresshttps://api.hanzo.ai/v1/project/{slug}/deploy
MethodPOST
Operationpost_project_by_slug_deploy
AuthAuthorization: Bearer $HANZO_API_KEY

Takes a built site live at https://<slug>.hanzo.app in one call. The body is the site itself — a zip or tar.gz holding index.html at its root (or a single wrapper directory that does), sent raw or as a multipart file part. It is unpacked to the site's own storage prefix and served immediately, answering the finished deployment.

It is bounded by the edge body limit (16 MiB by default), and that bound is the whole reason the other path exists: an oversized POST is refused by the server BEFORE any handler runs and surfaces as an opaque 400 Error when parsing request that reads like a malformed payload rather than a size cap. A site too large for one archive opens a deployment with POST /v1/project/{slug}/deployments instead and writes its files straight to storage against the scoped grant that answers with — no body limit, and no bytes through this API at all.

Billing is fail-closed and fails FIRST: the hosting gate runs before anything is parsed or uploaded, so an unfunded org is 402 and an unreachable commerce is 503 with nothing written. The debit lands only on success — a failed upload is never billed and never flips the live site — and a redeploy answers the SAME URL, because slug and apex are stable.

Scope: a validated principal is required (401 without one) and the site is resolved within that principal's org, so another tenant's slug is a 404. Object storage must be configured (503); an archive that does not walk is a 400 and one over the size cap is a 413.

Request

2 fields, body application/octet-stream.

FieldInTypeRequiredDescription
slugpathstringyes
(body)bodystring (binary)yes

Response

StatusBodyMeaning
2XXprojectsDeploymentSuccess

2XX body — 21 fields.

FieldInTypeAlwaysDescription
bucketbodystring
bytesbodyinteger
commitbodystring
createdAtbodyinteger
filesbodyinteger
idbodystring
liveUrlbodystring
messagebodystring
prefixbodystring
projectIdbodystring
sourcebodystring
statusbodystring
updatedAtbodyinteger
uploadbodyprojectsUploadGrant
upload.expiresAtbodyinteger
upload.fieldsbodyobject
upload.fields.*bodystring
upload.maxBytesbodyinteger
upload.prefixbodystring
upload.urlbodystring
versionbodyinteger

Failure carries the platform error shape — see Errors.

Examples

hanzo project deploy <slug>

Project API · All Hanzo APIs · Interactive reference

How is this guide?

On this page