Skip to main content

Update status check 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 required status checks requires admin or owner permissions to the repository and branch protection to be enabled.

PATCH/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks
Source
github-v3-rest.json
Revision
f5f067c1e6f6
Active snapshot
85e53e3d0d65

Request

Path Parameters
owner string
required
repo string
required
branch string
required

The name of the branch.

Body Params
optional
application/jsonobject
contexts array[string]
optionaldeprecated

The list of status checks to require in order to merge into this branch

strict boolean
optional

Require branches to be up to date before merging.

Responses

application/json Status Check Policy object

Response

contexts array[string]
required
Example:
[
  "continuous-integration/travis-ci"
]
contexts_url string<uri>
required
Example:
https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts
strict boolean
required

Example: true

url string<uri>
required
Example:
https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks
application/json Basic Error object

Resource not found

documentation_url string
optional
message string
optional
status string
optional
url string
optional
application/json Validation Error object

Validation failed

documentation_url string
required
errors array[object]
optional
items object
code string
required
field string
optional
index integer
optional
message string
optional
resource string
optional
value
optional
message string
required