Hanzo
OpenapiPlatform

Triggers a native build — an image, or the binaries a repo declares.

Triggers a native build — an image, or the binaries a repo declares. The fabric's own build trigger, and what `hanzo build` and git-push-to-deploy call.

POST /v1/platform/runner

Addresshttps://api.hanzo.ai/v1/platform/runner
MethodPOST
Operationpost_platform_runner
AuthAuthorization: Bearer $HANZO_API_KEY

Triggers a native build — an image, or the binaries a repo declares.

The fabric's own build trigger, and what hanzo build and git-push-to-deploy call. It answers 202 with the build job id: a queued build, not a pushed artifact.

Two lanes, and a build is exactly one of them. The IMAGE lane takes repo and the output image and launches a BuildKit Job that pushes it. The ARTIFACT lane takes binaries — the same recipe the repo's hanzo.yml declares — and publishes to object storage instead; it must carry no image, because a build produces binaries or an image, never both.

PRIVILEGED, and A BUILD BELONGS TO THE ORGANIZATION ITS CREDENTIAL NAMES. Two credentials, never a third:

  • one that NAMES an organization — a person who administers it (the hanzo build path, so one IAM login authorizes a build with no separate build token), or that organization's own machine identity (the pipeline path). The build is attributed to that org and confined to what it owns.
  • the shared build-callback token, compared in constant time. It names NO organization, which is both why the fabric's own release can publish across brands with it and why anything that CAN name one is read first.

Both are bounded by the owned-registry allowlist. The org path is bounded again, by the org: the image's registry namespace must be one that organization owns, so it publishes into its own brand and can never overwrite another's through the shared push credential. The same confinement applies to the artifact lane's repo owner. There is no request field naming an organization — the attribution is read off the credential, so there is nothing for a caller to write it with.

The output image is parsed and validated as a single well-formed OCI ref before any authorization decision reads it, so a crafted ref cannot smuggle a build-exporter attribute past the check.

Request

22 fields, body application/json (required).

FieldInTypeRequiredDescription
archbodystringArch is the target architecture for the artifact lane.
argsbodyobjectArgs are --build-arg values. They are what lets several images off ONE Dockerfile mean different things — the sandbox classes are three entries differing only…
args.*bodystring
binariesbodybinarySpec[]Binaries selects the ARTIFACT lane (artifact.go): build what the repo's hanzo.yml binaries: block declares — a Go binary, an npm tarball, a Rust binary — and…
binaries[].imagebodystringImage is the toolchain image the recipe runs in, a Go bookworm image by default.
binaries[].ldflagsbodystringLdflags are the Go linker flags, -s -w when the recipe names none, on one line.
binaries[].mainbodystringMain is the Go package to build, repo-relative (. or ./cmd/x), and it selects the GO LANE.
binaries[].namebodystringName is the artifact's base name: the prefix of every file published for this entry, and the name a host later asks for.
binaries[].outbodystringOut is the glob of files run produced, relative to the repo root; matching nothing FAILS the build rather than publishing an empty entry.
binaries[].platformsbodystring[]Platforms are the <os>/<arch> pairs the Go lane cross-compiles, [linux/amd64] by default.
binaries[].runbodystringRun is any other toolchain's build command, run by sh -c in this entry's image, and it selects the OTHER LANE.
branchbodystringBranch is the branch to build when no SHA or Ref is given.
bucketbodystringBucket mirrors hanzo.yml's bucket: — where the artifact lane publishes.
contextbodystringContext is the build context path within the repo.
dockerTargetbodystringDockerTarget is the multi-stage build target to stop at.
dockerfilebodystringDockerfile is the path to build from; empty uses the zero-config frontend.
imagebodystringImage is the output image ref to push.
osbodystringOS is the target operating system for the artifact lane.
refbodystringRef is the git ref to build when no SHA is given.
repobodystringRepo is the repository clone URL to build.
shabodystringSHA is the commit to pin; it wins over Ref and Branch.
tagbodystringTag is the publish path segment, so both front doors write ONE index at ONE URL.

Response

StatusBodyMeaning
202runnerBuildRespaccepted

202 body — 6 fields.

FieldInTypeAlwaysDescription
buildJobIdbodystringBuildJobID is the queued build's id, and what its progress is read by.
imagebodystringImage is the ref the image lane will push.
indexbodystringIndex is the binaries.json URL the artifact lane will publish.
runnerPoolbodystringRunnerPool is the runner class the build was placed on.
statusbodystringStatus is queued — the build was accepted and has not finished.
targetbodystringTarget is the multi-stage build target, echoed back.

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.


Platform API · All Hanzo APIs · Interactive reference

How is this guide?

On this page