v50

latestOpenAPI 3.0.3MITraw.githubusercontent.com2024-01-0382859610.0 MB
repos

Get 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 restrictions are only available for organization-owned repositories.

get/repos/{owner}/{repo}/branches/{branch}/protection/restrictions

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.

Response

Response

urlstring uri required
users_urlstring uri required
teams_urlstring uri required
apps_urlstring uri required

Example response

{
  "apps": [
    {
      "owner": {
        "gravatar_id": "\"\"",
        "html_url": "\"https://github.com/testorg-ea8ec76d71c3af4b\"",
        "followers_url": "\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/followers\"",
        "following_url": "\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/following{/other_user}\"",
        "gists_url": "\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/gists{/gist_id}\"",
        "starred_url": "\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/starred{/owner}{/repo}\"",
        "subscriptions_url": "\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/subscriptions\"",
        "organizations_url": "\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/orgs\"",
        "received_events_url": "\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/received_events\"",
        "type": "\"Organization\""
      }
    }
  ]
}