List the branches of a repository.
POST/api/v1/github-repositories/discover-branchesconnectors:read
Lists one page of a repository's branches, by repository (github_repository_id) or by installation with the owner and name. Nothing is saved.
| Scope | connectors:read (sensitive) |
| Asynchronous | No |
| MCP tool | discover_github_repository_branches |
| Portal permissions | view_github_repositories |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Docwize-Version | header | string (date) | Optional |
Request body
| Content type | Type |
|---|---|
application/json | GitHubDiscoverBranchesRequestInput |
Responses
| Status | Description | Body |
|---|---|---|
200 | Success. | application/json GitHubDiscoveredBranches |
400 | invalid_version, malformed_json | application/problem+json Problem |
401 | token_expired, unauthenticated | application/problem+json Problem |
403 | forbidden, insufficient_scope, token_owner_inactive | application/problem+json Problem |
404 | not_found | application/problem+json Problem |
405 | method_not_allowed | application/problem+json Problem |
406 | not_acceptable | application/problem+json Problem |
413 | payload_too_large | application/problem+json Problem |
415 | unsupported_media_type | application/problem+json Problem |
421 | wrong_region | application/problem+json Problem |
422 | validation_failed | application/problem+json Problem |
500 | internal_error | application/problem+json Problem |
503 | tenant_unavailable, unavailable | application/problem+json Problem |
504 | timeout | application/problem+json Problem |
Errors
The problem codes this operation can answer with. Each code links to its page.
Schemas
GitHubDiscoverBranchesRequestInput
| Field | Type | Required | Description |
|---|---|---|---|
github_installation_id | string or null | Optional | |
github_repository_id | string or null | Optional | |
page | integer or null | Optional | |
repo_name | string or null | Optional | |
repo_owner | string or null | Optional |
GitHubDiscoveredBranch
| Field | Type | Required | Description |
|---|---|---|---|
commit_sha | string | Required | |
name | string | Required |
GitHubDiscoveredBranches
| Field | Type | Required | Description |
|---|---|---|---|
branches | array of GitHubDiscoveredBranch | Required | |
default_branch | string | Required | |
next_page | integer | Required | The next page; 0 at the last page. ≥ -2147483648; ≤ 2147483647 |
page | integer | Required | ≥ -2147483648; ≤ 2147483647 |
repo_name | string | Required | |
repo_owner | string | Required |