Hanzo
OpenapiPlatform

Receive a push from the forge and trigger its build

The forge's push-to-deploy door. git.hanzo.ai runs as a separate server, so its pushes never reach this fleet's own receive-pack; without this a push to…

POST /v1/platform/hook

Addresshttps://api.hanzo.ai/v1/platform/hook
MethodPOST
Operationpost_platform_hook
AuthAuthorization: Bearer $HANZO_API_KEY

The forge's push-to-deploy door. git.hanzo.ai runs as a separate server, so its pushes never reach this fleet's own receive-pack; without this a push to the host we call canonical builds nothing. A verified push is handed to the SAME two seams a native push travels — the single-registrant deploy trigger, and the many-subscriber lifecycle stream that notifies and indexes — and the build decision itself stays downstream in the one place that knows what a push means.

PUBLIC at the JWT layer, because the forge carries no Hanzo session: AUTHENTICATION IS THE SIGNATURE. The HMAC covers the raw bytes and is verified BEFORE the payload is parsed, so an unauthenticated body is never decoded. The secret is read from KMS; a deployment that cannot read it answers 503 and processes nothing, rather than trusting a delivery it could not check. The body is read UNCOMPRESSED — a request declaring a Content-Encoding is refused 415 before it is touched, because decoding one is unbounded work bought with a few bytes and no credential. A bad signature is 401, a payload over 8 MiB is 413, and a malformed one 400.

A verified push that reaches both seams answers 200 with fired true and the NUMBER OF BUILDS it launched — zero is ordinary, since most pushes track no application, and it is the answer 'fired' cannot give. A push that could not be dispatched answers 500: the delivery page shows it red, and the Replay that prompts reaches a fresh attempt rather than being declined as already landed.

The deliveries deliberately ignored answer 200 with a reason and nothing else: a payload that is not a push, a ref DELETE (a zero after has no commit to build), a BOT-authored push (release automation pushes as the forge's own Actions user, and a release must never rebuild itself), a push from a forge namespace that maps to no org, and a redelivery of a push already fired. Branches and tags both reach the build trigger, because releases are cut by tag and filtering here would silently stop publishing.

Request

11 fields, body application/json.

FieldInTypeRequiredDescription
afterbodystring
beforebodystring
pusherbodyobject
pusher.loginbodystring
pusher.usernamebodystring
refbodystring
repositorybodyobject
repository.namebodystring
repository.ownerbodyobject
repository.owner.loginbodystring
repository.owner.usernamebodystring

Response

StatusBodyMeaning
2XXverdictSuccess

2XX body — 7 fields.

FieldInTypeAlwaysDescription
buildsbodyinteger
commitbodystring
firedbodyboolean
orgbodystring
reasonbodystring
refbodystring
repobodystring

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