Hanzo
OpenapiProjects

Promotes a build output into a new immutable release WITHOUT serving it — the…

Promotes a build output into a new immutable release WITHOUT serving it — the staged half of publishing, for when you want to check a release before it…

POST /v1/projects/{slug}/releases

Addresshttps://api.hanzo.ai/v1/projects/{slug}/releases
MethodPOST
Operationpost_projects_by_slug_releases
AuthAuthorization: Bearer $HANZO_API_KEY

Promotes a build output into a new immutable release WITHOUT serving it — the staged half of publishing, for when you want to check a release before it goes live. Answers 201.

source is a path RELATIVE to your org's own storage space: the org segment is prepended server-side from the validated principal and the bucket is never in the request at all, so a server-side copy can only ever reach bytes your org already owns. The prefix is listed, content-addressed (SHA-256 over the sorted manifest of key/size/etag), and copied into an immutable <org>/.releases/<slug>/<id>/ prefix; the row is written LAST, so a partial copy is unreachable rather than merely unlikely. Re-publishing an unchanged source is idempotent BY CONSTRUCTION — same bytes, same id, no copy at all.

The source must contain index.html at its root and stay under the same file and byte caps an artifact deploy does (413 past them); a source that changes mid-copy is a 409 and the release is abandoned. Each publish also reclaims releases past the retention depth, so a site's release space stays bounded. This is the billable half — the hosting gate runs before any copy, and the debit lands once the release exists.

Scope: a validated principal is required (403 without one) and the site is resolved within that principal's org, so another tenant's slug is a 404.

Request

3 fields, body application/json (required).

FieldInTypeRequiredDescription
slugpathstringyesSlug is the site to publish, from the path.
slugbodystringSlug is the site to publish, from the path.
sourcebodystringSource is the build output to promote, as a path RELATIVE to your org's own storage space — never a URL and never a bucket.

Response

StatusBodyMeaning
201projectsReleasecreated

201 body — 8 fields.

FieldInTypeAlwaysDescription
activebodybooleanActive is whether this is the release the site is SERVING right now.
bytesbodyintegerBytes is their total size in bytes.
createdAtbodyintegerCreatedAt is when the release was cut, as Unix seconds — not when it was last activated.
objectsbodyintegerObjects is how many files the release holds.
releaseIdbodystringReleaseID is derived from a DIGEST of the release's own manifest, so identical content is the same release and a release can never be confused with another…
slugbodystringSlug is the site this release belongs to.
sourcebodystringSource is what the release was cut from — the build output or upload it was promoted out of.
urlbodystringURL is where the site serves.

Failure carries the platform error shape — see Errors.

Examples

hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.


Projects API · All Hanzo APIs · Interactive reference

How is this guide?

On this page