Hanzo
OpenapiGit

Lists the immediate children of one directory at one revision, directories…

Lists the immediate children of one directory at one revision, directories before files.

GET /v1/git/repos/{name}/tree

Addresshttps://api.hanzo.ai/v1/git/repos/{name}/tree
MethodGET
Operationget_git_repos_by_name_tree
AuthAuthorization: Bearer $HANZO_API_KEY

Lists the immediate children of one directory at one revision, directories before files. It does not recurse — walk down a level at a time.

Request

3 fields.

FieldInTypeRequiredDescription
namepathstringyesName is the repo to read, from the :name path segment.
refquerystringRef is a branch, tag or commit; empty means the repo's HEAD.
pathquerystringPath is repo-relative; empty is the tree root.

Response

StatusBodyMeaning
200treeJSONok

200 body — 6 fields.

FieldInTypeAlwaysDescription
entriesbodytreeEntryJSON[]Entries are the immediate children, directories before files.
entries[].modebodystringMode is the octal git file mode ("100644", "040000", "120000").
entries[].namebodystringName is the entry's own name, no directory part.
entries[].pathbodystringPath is the entry's full repo-relative path.
entries[].sizebodyintegerSize is the file's byte length; 0 for a directory.
entries[].typebodystringType is "tree" for a directory, "blob" for a file.

Failure carries the platform error shape — see Errors.

Examples

hanzo git repos tree <name>

Git API · All Hanzo APIs · Interactive reference

How is this guide?

On this page