Skip to content

Commits and branches API

Grant: API_COMMITS_READ.

GET /v1/repos/{username}/{repo_name}/branches

Section titled “GET /v1/repos/{username}/{repo_name}/branches”
{
"default_branch": "main",
"branches": [
{
"name": "main",
"commit": {
"id": "uuid",
"hexsha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"message": "Initial commit",
"author": { "name": "You", "email": "you@example.com" },
"committer": { "name": "You", "email": "you@example.com" }
}
}
]
}

404 if the repo is missing or has no commits yet.

GET /v1/repos/{username}/{repo_name}/commits

Section titled “GET /v1/repos/{username}/{repo_name}/commits”

Lists commits on the repository default branch, newest walk from the tip.

Query: page (default 0), limit.

Returns { "branch", "commits", "pagination" }. 404 if there is no commit on the default branch.