Update pull request review protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled. **Note**: Passing new arrays of `users` and `teams` replaces their previous values.
/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews- Source
github-v3-rest.json- Revision
f5f067c1e6f6- Active snapshot
85e53e3d0d65
Request
Path Parameters
- owner stringrequired
- repo stringrequired
- branch stringrequired
The name of the branch.
Body Params
optionalSet to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit.
dismissal_restrictions objectoptionalSpecify which users and teams can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories.
Specify which users and teams can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories.
The list of team `slug`s with dismissal access
The list of user `login`s with dismissal access
Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/) have reviewed.
Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6.
Responses
Response
Example: true
dismissal_restrictions objectoptional
teams array[Team object]optionalThe list of teams with review dismissal access.
The list of teams with review dismissal access.
items Team objectGroups of organization members that gives permissions on specified repositories.
Groups of organization members that gives permissions on specified repositories.
Example: https://github.com/orgs/rails/teams/core
Groups of organization members that gives permissions on specified repositories.
"https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/teams""https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions" users array[Simple User object]optionalThe list of users with review dismissal access.
The list of users with review dismissal access.
items Simple User objectSimple User
Simple User
Example: https://github.com/images/error/octocat_happy.gif
Example: https://api.github.com/users/octocat/events{/privacy}
Example: https://api.github.com/users/octocat/followers
Example: https://api.github.com/users/octocat/following{/other_user}
Example: https://api.github.com/users/octocat/gists{/gist_id}
Example: 41d064eb2195891e12d0413f63227ea7
Example: https://github.com/octocat
Example: 1
Example: octocat
Example: MDQ6VXNlcjE=
Example: https://api.github.com/users/octocat/orgs
Example: https://api.github.com/users/octocat/received_events
Example: https://api.github.com/users/octocat/repos
Example: "2020-07-09T00:17:55Z"
Example: https://api.github.com/users/octocat/starred{/owner}{/repo}
Example: https://api.github.com/users/octocat/subscriptions
Example: User
Example: https://api.github.com/users/octocat
"https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/users"Example: true
Example: 2
https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictionsValidation failed