Hanzo
OpenapiProjects

Promotes a build output into a new release AND goes live with it —…

Promotes a build output into a new release AND goes live with it — create+activate in one call, which is the 99% path.

POST /v1/projects/{slug}/publish

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

Promotes a build output into a new release AND goes live with it — create+activate in one call, which is the 99% path.

It is exactly the two halves in sequence with no extra semantics, so the staged flow and the one-shot flow can never drift apart: source is promoted under the same org-relative rule and the same guards CreateRelease applies, then the site's pointer is flipped to it, the public host is claimed and the edge is purged. Idempotent on unchanged bytes — same manifest, same release id, no copy — and billed once, after 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
200projectsReleaseok

200 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