Skip to main content

Get admin branch 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.

GET/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins
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.

Responses

application/json Protected Branch Admin Enforced object

Response

enabled boolean
required

Example: true

url string<uri>
required

Example: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins