v52

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2026-08-03134119177.4 KB
repositories

put/repositories/{repository}/settings/branch_protection

Headers

If-Matchstring

if provided, the branch protection rules will be updated only if the current ETag match the provided value

Request body

patternstring required

fnmatch pattern for the branch name, supporting * and ? wildcards

Example request

[
  {
    "pattern": "stable_*"
  }
]

Response

branch protection rule created successfully