GET
/repos/{owner}/{repo}/branches/{branch}/protection/restrictionsGet access restrictions
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.
Lists who has access to this protected branch.
[!NOTE] Users, apps, and teams
restrictionsare only available for organization-owned repositories.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
branchstringrequired
The name of the branch. Cannot contain wildcard characters. To use wildcard characters in branch names, use [the GraphQL API](https://docs.github.com/graphql).
200Response
urlstringrequired
users_urlstringrequired
teams_urlstringrequired
apps_urlstringrequired
usersarray<object>required
teamsarray<Team>required
appsarray<object>required
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
Error handling
A 404 is returned: Resource not found.