/v1/git-connections/github-app/branchesReturns the branches of a repository the GitHub App can access. The connection used is the one whose GitHub account matches the repository's owner. Only the first 100 branches that GitHub returns are included.
Requires the secrets read permission (owner, admin or developer role).
Authentication
Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.
Query parameters
repostringRequiredRepository in owner/name form, as in full_name from List GitHub repositories. Must not contain spaces.
Headers
X-Workspace-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
Response
The repository's branches.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataarray of objectsShow item attributesHide item attributes
namestringRequiredBranch name.
commit_shastringSHA of the branch's latest commit.
defaultbooleanRequiredMeant to flag the default branch, but currently always false. Use default_branch from List GitHub repositories instead.
Errors
| Status | Meaning |
|---|---|
400 | repo is missing or contains spaces. |
401 | The API key is missing, invalid, expired or revoked. |
403 | You cannot access the workspace, your role does not allow this action, or the account is suspended. |
404 | No GitHub account is connected, or none matches the repository's owner. |
500 | GitHub could not be reached, or the repository is not accessible to the app. |
Errors use the standard error format.