v68

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,21696712.3 MB
repos

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 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

Path parameters

ownerstring required

The account owner of the repository. The name is not case sensitive.

repostring required

The name of the repository without the .git extension. The name is not case sensitive.

branchstring required

The name of the branch. Cannot contain wildcard characters. To use wildcard characters in branch names, use the GraphQL API.

Request body

strictboolean

Require branches to be up to date before merging.

contextsstring[]

Closing down notice: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use checks instead of contexts for more fine-grained control.

Response

Response

urlstring uri required
strictboolean required
contextsstring[] required
contexts_urlstring uri required

Example response

{
  "url": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks",
  "strict": true,
  "contexts": [
    "continuous-integration/travis-ci"
  ],
  "checks": [
    {
      "context": "continuous-integration/travis-ci"
    }
  ],
  "contexts_url": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts"
}