Hanzo
OpenapiSync

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

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

PATCH /v1/sync/{id}

Addresshttps://api.hanzo.ai/v1/sync/{id}
MethodPATCH
Operationpatch_sync_by_id
AuthAuthorization: Bearer $HANZO_API_KEY

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.

Request

14 fields, body application/json (required).

FieldInTypeRequiredDescription
idpathstringyesID is the sync to update, from the path.
actorbodystringActor is the loop-guard identity the sync writes as.
directionbodystringDirection is both, pull, push or off.
idbodystringID is the sync to update, from the path.
kindbodystringKind names a different kind of sync, and is refused, for the same reason.
sourcebodyendpointReq
source.connectorbodystringConnector names the stored credential to reach this endpoint with.
source.locatorbodystringLocator addresses the resource. For a git source it is the https clone URL on the provider's own host, with no embedded credentials; for a native target it is…
source.providerbodystringProvider is the platform: github or gitlab for a source; a target defaults to the native Hanzo Git plane.
targetbodyendpointReq
target.connectorbodystringConnector names the stored credential to reach this endpoint with.
target.locatorbodystringLocator addresses the resource. For a git source it is the https clone URL on the provider's own host, with no embedded credentials; for a native target it is…
target.providerbodystringProvider is the platform: github or gitlab for a source; a target defaults to the native Hanzo Git plane.
triggerbodystringTrigger is webhook, poll or manual.

Response

StatusBodyMeaning
200syncViewok

200 body — 15 fields.

FieldInTypeAlwaysDescription
actorbodystringActor is the identity a reconcile writes AS.
createdAtbodystringCreatedAt is when the link was first declared, RFC3339 in UTC.
directionbodystringDirection is which way work flows: "both", "pull" (target ← source), "push" (source → target), or "off" — which keeps the link declared and moves nothing.
idbodystringID is the link's handle, derived from its source and target — which is what makes re-declaring the same pair an update rather than a duplicate.
kindbodystringKind is what is being synced.
sourcebodyendpointView
source.connectorbodystringConnector names a connected account from the org's connector registry, when the endpoint reaches its provider through one.
source.locatorbodystringLocator addresses the thing INSIDE that provider, in the provider's own terms — an https clone URL for a hosted forge, a bare repository name for hanzo-git.
source.providerbodystringProvider is the concrete integration: "github", "gitlab" or "hanzo-git".
targetbodyendpointView
target.connectorbodystringConnector names a connected account from the org's connector registry, when the endpoint reaches its provider through one.
target.locatorbodystringLocator addresses the thing INSIDE that provider, in the provider's own terms — an https clone URL for a hosted forge, a bare repository name for hanzo-git.
target.providerbodystringProvider is the concrete integration: "github", "gitlab" or "hanzo-git".
triggerbodystringTrigger is what starts a reconcile: "webhook" (the provider tells us), "poll" (we ask on a schedule), or "manual" (only an explicit call).
updatedAtbodystringUpdatedAt is bumped by every reconcile, so it reads as the LAST-SYNCED time rather than the last edit.

Failure carries the platform error shape — see Errors.

Examples

hanzo sync update <id>

Sync API · All Hanzo APIs · Interactive reference

How is this guide?

On this page