Hanzo AI

List branches

Lists a repository's branches, the default first, with prefix search.

GET /v1/provider/github/repos/{owner}/{repo}/branches

Addresshttps://api.hanzo.ai/v1/provider/github/repos/{owner}/{repo}/branches
MethodGET
Operationget_provider_github_repos_by_owner_by_repo_branches
AuthAuthorization: Bearer $HANZO_API_KEY

Lists a repository's branches, the default first, with prefix search. The repository must be one the caller may see — the same set GET /v1/provider/github/repos lists — or it is 404.

Request

5 fields.

FieldInTypeRequiredDescription
ownerpathstringyesOwner is the GitHub account that holds the repository.
repopathstringyesRepo is the repository's name within that account.
qquerystring—Q keeps branches whose name starts with it, matched by GitHub.
limitqueryinteger—Limit is the page size: 1 to 100, and 50 when absent or unreadable.
afterquerystring—After is the next of the previous page.

Response

StatusBodyMeaning
200provider.githubBranchesOutok
defaultproblem-detailsrefused

200 body — 6 fields.

FieldInTypeAlwaysDescription
branchesbodyprovider.githubBranch[]—Branches is this page: the default branch first, then the rest by name.
branches[].commitbodystring—Commit is the sha the branch points at.
branches[].defaultbodyboolean—Default is whether it is the repository's default branch, which always leads the first page when it matches.
branches[].namebodystring—Name is the branch's short name ("main", "feat/login").
nextbodystring—Next is the cursor for the page after this one; empty on the last page.
totalbodyinteger (int64)—Total is how many branches match q, across every page.

Failure carries the platform error shape — see Errors.

Examples

hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.


Provider API · All Hanzo APIs · Interactive reference

How is this guide?

On this page