---
title: "Update status check protection"
method: PATCH
path: "/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
tags: ["repos"]
---

# Update status check protection

`PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks`

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.

## Path parameters

- `owner` string, required
- `repo` string, required
- `branch` string, required

## Request body

- object
  - `strict` boolean — Require branches to be up to date before merging.
  - `contexts` string[] — **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.
  - `checks` object[] — The list of status checks to require in order to merge into this branch.
    - `context` string, required — The name of the required check
    - `app_id` integer — The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status.

## Response `200`

Response

- StatusCheckPolicy — Status Check Policy
  - `url` string, uri, required
  - `strict` boolean, required
  - `contexts` string[], required
  - `checks` object[], required
    - `context` string, required
    - `app_id` integer, nullable, required
  - `contexts_url` string, uri, required

## Other responses

- `404` — Resource not found
- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/api-github-com.md) · [All operations](https://skmtc.net/github/apis/api-github-com/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/api-github-com/revisions/a367f7028301/schema)
