> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r28.ai/charter/llms.txt
> Use this file to discover all available pages before exploring further.

# repos_get_branch_protection

> Read a branch's protection rules — required checks, required reviews, linear history — before attempting a write that they would refuse. A 404 means either no such branch or no protection on it; GitHub does not distinguish them.

<div className="tool-route"><span className="tool-row-method" data-method="GET">GET</span><code>{"https://api.github.com/repos/{owner}/{repo}/branches/{branch}/protection"}</code></div>

```python github_repos_get_branch_protection.py theme={null}
from charter.packs import github

result = await github.repos_get_branch_protection.ainvoke({"owner": ..., "repo": ..., "branch": ...})
```

<Note>
  Requires `repo`, `read:user`.
</Note>

## Path parameters

<div className="reference-table">
  | Field                                                          | Type     | Description                                                                                               |
  | -------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------- |
  | `owner` <span className="required" title="required">\*</span>  | `string` | The account owner of the repository. The name is not case sensitive.                                      |
  | `repo` <span className="required" title="required">\*</span>   | `string` | The name of the repository without the `.git` extension. The name is not case sensitive.                  |
  | `branch` <span className="required" title="required">\*</span> | `string` | The name of the branch. Cannot contain wildcard characters. A plain name — `main`, not `refs/heads/main`. |
</div>
