Hanzo
OpenapiGit

Registers a downstream remote the repo's advanced refs are pushed to whenever a…

Registers a downstream remote the repo's advanced refs are pushed to whenever a push lands here. Answers 201.

POST /v1/git/repos/{name}/mirrors

Addresshttps://api.hanzo.ai/v1/git/repos/{name}/mirrors
MethodPOST
Operationpost_git_repos_by_name_mirrors
AuthAuthorization: Bearer $HANZO_API_KEY

Registers a downstream remote the repo's advanced refs are pushed to whenever a push lands here. Answers 201. The URL must be https to a host on the mirror allowlist (github.com / gitlab.com): the same set the mirror credential may be sent to, so a target can never capture the shared token or point the push at an internal service. Any embedded userinfo is stripped — credentials ride env-only at push time and never enter the stored URL. One mirror per host per repo; a second is a 409.

Request

4 fields, body application/json (required).

FieldInTypeRequiredDescription
namepathstringyesName is the repo whose advanced refs are pushed downstream, from the :name path segment.
hostbodystringHost is an optional assertion of the target's hostname.
namebodystringName is the repo whose advanced refs are pushed downstream, from the :name path segment.
urlbodystringURL is the downstream https git remote.

Response

StatusBodyMeaning
201mirrorTargetViewcreated

201 body — 5 fields.

FieldInTypeAlwaysDescription
createdAtbodystringCreatedAt is RFC 3339 UTC.
hostbodystringHost is the target's lowercased hostname, taken from URL and never the body.
idbodystringID is the target's identifier ("mir_…"), the handle to remove it by.
repobodystringRepo is the repo whose advanced refs are pushed downstream.
urlbodystringURL is the canonical https remote, with any embedded credentials stripped.

Failure carries the platform error shape — see Errors.

Examples

hanzo git repos mirrors create <name>

Git API · All Hanzo APIs · Interactive reference

How is this guide?

On this page