GET
/repos/{owner}/{repo}/branchesList branches in a repository
Lists branches in a repository, including each branch's commit and protection status. Use protected to filter for protected or unprotected branches, or omit it to include all branches; use page and per_page to paginate the results.
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The repository name without the `.git` extension. The name is not case sensitive.
protectedbooleanoptional
Filter branches by protection status: `true` returns protected branches, and `false` returns unprotected branches. Omit to return all branches.
per_pageintegeroptional
Number of results per page, up to 100. Defaults to 30 when omitted.
pageintegeroptional
Page number of the results to fetch. Defaults to 1 when omitted.
200Returns an array of branches with each branch's name, commit, and protection status.
namestringrequired
commitobjectrequired
protectedbooleanrequired
protectionobjectoptional
Branch Protection
protection_urlstringoptional
404Returned when the repository cannot be found.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
Error handling
A 404 is returned when the repository cannot be found. The owner and repo path parameters must identify the repository whose branches you want to list.