Hanzo

Sync

Package sync is data sync: link two endpoints and keep them in step, on a webhook, on a schedule, or on demand.

Package sync is data sync: link two endpoints and keep them in step, on a webhook, on a schedule, or on demand.

Base URLhttps://api.hanzo.ai
Operations6
AuthAuthorization: Bearer $HANZO_API_KEY

sync

POST /v1/sync/{id}/run

Run reconciles one sync now — the manual re-sync, and the initial import for a link created without run=true. The work is handed to a bounded background worker and the call answers 202 immediately, so a large mirror-in never holds the request open; queued=true means accepted, not finished.

ParameterInTypeRequiredDescription
idpathstringyesID is the sync to act on, from the path.

Get returns one sync by id.

GET /v1/sync/{id}

Get returns one sync by id. It is org-scoped: an id belonging to another tenant is the same 404 an unknown id gives, so a probe learns nothing about what exists.

ParameterInTypeRequiredDescription
idpathstringyesID is the sync to act on, from the path.

Patch updates one sync's mutable policy — direction, trigger and actor — in place.

PATCH /v1/sync/{id}

Patch updates one sync's mutable policy — direction, trigger and actor — in place. The endpoints and the kind are immutable: re-pointing a sync is a delete and a create, so a link can never silently start syncing somewhere else. A field the request omits is left as it was. Changing the direction immediately reconciles the derived outbound mirror, so turning push off stops the upstream being written to rather than merely recording the intent.

ParameterInTypeRequiredDescription
idpathstringyesID is the sync to update, from the path.

Request bodyapplication/json (required)

FieldTypeRequiredDescription
actorstringActor is the loop-guard identity the sync writes as.
directionstringDirection is both, pull, push or off.
idstringID is the sync to update, from the path.
triggerstringTrigger is webhook, poll or manual.

Delete removes one sync and tears down the outbound mirror it derived, answering 204.

DELETE /v1/sync/{id}

Delete removes one sync and tears down the outbound mirror it derived, answering 204. The teardown is the point: without it an unsynced repository would keep force-pushing to the upstream it is no longer linked to. Org-scoped, so another tenant's id is the same 404 an unknown id gives.

ParameterInTypeRequiredDescription
idpathstringyesID is the sync to act on, from the path.

GET /v1/sync

List returns every sync link the caller's org has, each with its two endpoints, its direction and trigger policy, and the time it last reconciled. Scoped to the caller's own org — another tenant's links are structurally unreachable.

Create declares a sync between two endpoints and returns it.

POST /v1/sync

Create declares a sync between two endpoints and returns it. It is an UPSERT: re-declaring the same source and target updates that link rather than piling up duplicates, so a console that re-submits is safe. The org comes from the validated principal, never from the request, so a sync can only ever bind endpoints inside the caller's own org. A git source must be an https clone URL on the provider's own host with no embedded credentials; a target left empty is derived as a native repository named after the source. With run=true the first reconcile is queued in the background, so a large initial import never blocks this response.

Request bodyapplication/json (required)

FieldTypeRequiredDescription
actorstringActor is the identity the sync writes as, used as the loop guard so its own writes do not re-trigger it.
directionstringDirection is both (the default), pull, push or off.
kindstringKind is what is being synced.
runbooleanRun reconciles once immediately after the upsert, in the background.
sourcecloud_endpointReqSource is the upstream end.
targetcloud_endpointReqTarget is the downstream end. Optional for git: a native repository named after the source is derived when it is omitted
triggerstringTrigger is what starts a reconcile: webhook (the default), poll or manual.

All Hanzo APIs · Interactive reference

How is this guide?

On this page