Hanzo
OpenapiGit

Returns one file's bytes at one revision.

Returns one file's bytes at one revision. Text comes back verbatim, binary comes back base64, and a file past the 1 MiB view cap comes back marked…

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

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

Returns one file's bytes at one revision. Text comes back verbatim, binary comes back base64, and a file past the 1 MiB view cap comes back marked truncated with NO content — the client is expected to clone instead.

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
200blobJSONok

200 body — 6 fields.

FieldInTypeAlwaysDescription
binarybodybooleanBinary marks content git could not treat as text; it comes back base64.
contentbodystringContent is the file's bytes, empty when Truncated.
encodingbodystringEncoding is how Content is carried: "utf8" verbatim, or "base64".
pathbodystringPath is the file's repo-relative path.
sizebodyintegerSize is the file's byte length in the repo, whatever was returned below.
truncatedbodybooleanTruncated marks a file past the 1 MiB view cap.

Failure carries the platform error shape — see Errors.

Examples

hanzo git repos blob <name>

Git API · All Hanzo APIs · Interactive reference

How is this guide?

On this page