Skip to main content

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](https://docs.github.com/github/getting-started-with-github/githubs-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
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 Branch Restriction Policy object

Response

apps array[object]
required
items object
created_at string
optional
description string
optional
events array[string]
optional
external_url string
optional
html_url string
optional
id integer
optional
name string
optional
node_id string
optional
owner object
optional
avatar_url string
optional
description string
optional
events_url string
optional
followers_url string
optional

Example: "https://api.github.com/users/testorg-ea8ec76d71c3af4b/followers"

following_url string
optional

Example: "https://api.github.com/users/testorg-ea8ec76d71c3af4b/following{/other_user}"

gists_url string
optional

Example: "https://api.github.com/users/testorg-ea8ec76d71c3af4b/gists{/gist_id}"

gravatar_id string
optional

Example: ""

hooks_url string
optional
html_url string
optional

Example: "https://github.com/testorg-ea8ec76d71c3af4b"

id integer
optional
issues_url string
optional
login string
optional
members_url string
optional
node_id string
optional
organizations_url string
optional

Example: "https://api.github.com/users/testorg-ea8ec76d71c3af4b/orgs"

public_members_url string
optional
received_events_url string
optional

Example: "https://api.github.com/users/testorg-ea8ec76d71c3af4b/received_events"

repos_url string
optional
site_admin boolean
optional

Example: false

starred_url string
optional

Example: "https://api.github.com/users/testorg-ea8ec76d71c3af4b/starred{/owner}{/repo}"

subscriptions_url string
optional

Example: "https://api.github.com/users/testorg-ea8ec76d71c3af4b/subscriptions"

type string
optional

Example: "Organization"

url string
optional
permissions object
optional
contents string
optional
issues string
optional
metadata string
optional
single_file string
optional
slug string
optional
updated_at string
optional
apps_url string<uri>
required
teams array[object]
required
items object
description string
optionalnullable
html_url string
optional
id integer
optional
members_url string
optional
name string
optional
node_id string
optional
parent string
optionalnullable
permission string
optional
privacy string
optional
repositories_url string
optional
slug string
optional
url string
optional
teams_url string<uri>
required
url string<uri>
required
users array[object]
required
items object
avatar_url string
optional
events_url string
optional
followers_url string
optional
following_url string
optional
gists_url string
optional
gravatar_id string
optional
html_url string
optional
id integer
optional
login string
optional
node_id string
optional
organizations_url string
optional
received_events_url string
optional
repos_url string
optional
site_admin boolean
optional
starred_url string
optional
subscriptions_url string
optional
type string
optional
url string
optional
users_url string<uri>
required
application/json Basic Error object

Resource not found

documentation_url string
optional
message string
optional
status string
optional
url string
optional