Hanzo
OpenapiGit

Provisions an empty bare repository in the caller's scope and returns it with…

Provisions an empty bare repository in the caller's scope and returns it with its clone URLs. Answers 201.

POST /v1/git/repos

Addresshttps://api.hanzo.ai/v1/git/repos
MethodPOST
Operationpost_git_repos
AuthAuthorization: Bearer $HANZO_API_KEY

Provisions an empty bare repository in the caller's scope and returns it with its clone URLs. Answers 201. The name must be unique within the scope — a repeat is a 409, never a silent overwrite of an existing repo. The org comes from the validated principal, so a repo is always born owned by the caller's own tenant.

Request

4 fields, body application/json (required).

FieldInTypeRequiredDescription
descriptionbodystringDescription is a free-form blurb, max 4KiB.
namebodystringName is the repo's handle, unique within the scope, and the last segment of both clone URLs.
projectbodystringProject narrows the repo to a sub-scope of the org.
publicbodybooleanPublic grants ANONYMOUS read (fetch) only; push and the whole control plane stay org-authed.

Response

StatusBodyMeaning
201repoViewcreated

201 body — 14 fields.

FieldInTypeAlwaysDescription
branchesbodystring[]Branches are the repo's branch names.
cloneUrlbodystringCloneURL is the HTTPS smart-HTTP remote git clone takes.
createdAtbodystringCreatedAt is RFC 3339 UTC.
defaultBranchbodystringDefaultBranch is where HEAD points on a fresh repo ("main").
descriptionbodystringDescription is the caller-supplied blurb (max 4KiB).
headbodystringHead is the resolved HEAD commit, empty on an empty repo.
idbodystringID is the repo's stable, prefixed identifier ("repo_" + 128 random bits).
namebodystringName is the org-unique handle, and the last path segment of both URLs below.
orgbodystringOrg owns the repo — the gateway-minted X-Org-Id, and the isolation key.
projectbodystringProject is the optional sub-scope the repo lives in; absent for the org's default scope.
publicbodybooleanPublic grants ANONYMOUS read (fetch) only; push and the whole control plane stay org-authed.
sizeBytesbodyintegerSizeBytes is the repo's measured on-disk size, re-measured on create, after each push, and after a gc.
sshUrlbodystringSSHURL is the scp-style SSH remote (git@host:org/repo.git).
updatedAtbodystringUpdatedAt is RFC 3339 UTC, empty until the first write.

Failure carries the platform error shape — see Errors.

Examples

hanzo git repos create

Git API · All Hanzo APIs · Interactive reference

How is this guide?

On this page