Skip to main content

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.

Scopeconnectors:write (sensitive)
AsynchronousNo
MCP toolreplace_github_repository_branch_mappings
Portal permissionsmanage_github_branch_mappings

Parameters​

NameInTypeRequiredDescription
github_repository_idpathstringRequired
Docwize-Versionheaderstring (date)Optional
If-MatchheaderstringOptional

Request body​

Content typeType
application/jsonGitHubBranchMappingSetRequestInput

Responses​

StatusDescriptionBody
200Success.application/json GitHubBranchMappingSet or object
400invalid_version, malformed_jsonapplication/problem+json Problem
401token_expired, unauthenticatedapplication/problem+json Problem
403forbidden, insufficient_scope, token_owner_inactiveapplication/problem+json Problem
404not_foundapplication/problem+json Problem
405method_not_allowedapplication/problem+json Problem
406not_acceptableapplication/problem+json Problem
412precondition_failedapplication/problem+json Problem
413payload_too_largeapplication/problem+json Problem
415unsupported_media_typeapplication/problem+json Problem
421wrong_regionapplication/problem+json Problem
422validation_failedapplication/problem+json Problem
500internal_errorapplication/problem+json Problem
503tenant_unavailable, unavailableapplication/problem+json Problem
504timeoutapplication/problem+json Problem

Errors​

The problem codes this operation can answer with. Each code links to its page.

Schemas​

GitHubBranchMapping​

FieldTypeRequiredDescription
branch_namestringRequired
github_branch_mapping_idstringRequired
github_repository_idstringRequired
is_enabledbooleanRequired
last_synced_atstring (date-time) or nullRequired
last_synced_shastring or nullRequired
number_prefixstring or nullRequiredEmpty falls back to the repository's prefix.

GitHubBranchMappingInputInput​

FieldTypeRequiredDescription
branch_namestringRequired
is_enabledboolean or nullOptionalDefaults to true.
number_prefixstring or nullOptionalEmpty falls back to the repository's prefix.

GitHubBranchMappingSet​

FieldTypeRequiredDescription
countintegerRequired≥ -2147483648; ≤ 2147483647
github_repository_idstringRequired
itemsarray of GitHubBranchMappingRequired

GitHubBranchMappingSetRequestInput​

FieldTypeRequiredDescription
itemsarray of GitHubBranchMappingInputInputOptional