Replace a repository's branch mappings.
POST/api/v1/github-repositories/{github_repository_id}/branch-mappings/replaceconnectors:write
The body is the full set of branches: a listed branch is updated, a mapping left out is removed, a new branch is added. An empty list deletes every mapping.
| Scope | connectors:write (sensitive) |
| Asynchronous | No |
| MCP tool | replace_github_repository_branch_mappings |
| Portal permissions | manage_github_branch_mappings |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
github_repository_id | path | string | Required | |
Docwize-Version | header | string (date) | Optional | |
If-Match | header | string | Optional |
Request body
| Content type | Type |
|---|---|
application/json | GitHubBranchMappingSetRequestInput |
Responses
| Status | Description | Body |
|---|---|---|
200 | Success. | application/json GitHubBranchMappingSet or object |
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 |
412 | precondition_failed | 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
GitHubBranchMapping
| Field | Type | Required | Description |
|---|---|---|---|
branch_name | string | Required | |
github_branch_mapping_id | string | Required | |
github_repository_id | string | Required | |
is_enabled | boolean | Required | |
last_synced_at | string (date-time) or null | Required | |
last_synced_sha | string or null | Required | |
number_prefix | string or null | Required | Empty falls back to the repository's prefix. |
GitHubBranchMappingInputInput
| Field | Type | Required | Description |
|---|---|---|---|
branch_name | string | Required | |
is_enabled | boolean or null | Optional | Defaults to true. |
number_prefix | string or null | Optional | Empty falls back to the repository's prefix. |
GitHubBranchMappingSet
| Field | Type | Required | Description |
|---|---|---|---|
count | integer | Required | ≥ -2147483648; ≤ 2147483647 |
github_repository_id | string | Required | |
items | array of GitHubBranchMapping | Required |
GitHubBranchMappingSetRequestInput
| Field | Type | Required | Description |
|---|---|---|---|
items | array of GitHubBranchMappingInputInput | Optional |