# Get access restrictions

From **GitHub v3 REST API**.

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

## Parameters

### `owner`

- Location: path
- Required: true
- Type: `string`

### `repo`

- Location: path
- Required: true
- Type: `string`

### `branch`

- Location: path
- Required: true
- Type: `string`

The name of the branch.

## Responses

### `200`

Response

### `application/json`

- Type: `object`

Branch Restriction Policy

```json
{
  "apps": [
    {
      "created_at": "2017-07-08T16:18:44-04:00",
      "description": "",
      "events": [
        "push",
        "pull_request"
      ],
      "external_url": "https://example.com",
      "html_url": "https://github.com/apps/octoapp",
      "id": 1,
      "name": "Octocat App",
      "node_id": "MDExOkludGVncmF0aW9uMQ==",
      "owner": {
        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
        "description": "A great organization",
        "events_url": "https://api.github.com/orgs/github/events",
        "hooks_url": "https://api.github.com/orgs/github/hooks",
        "id": 1,
        "issues_url": "https://api.github.com/orgs/github/issues",
        "login": "github",
        "members_url": "https://api.github.com/orgs/github/members{/member}",
        "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
        "public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
        "repos_url": "https://api.github.com/orgs/github/repos",
        "url": "https://api.github.com/orgs/github"
      },
      "permissions": {
        "contents": "read",
        "issues": "write",
        "metadata": "read",
        "single_file": "write"
      },
      "slug": "octoapp",
      "updated_at": "2017-07-08T16:18:44-04:00"
    }
  ],
  "apps_url": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/teams",
  "teams": [
    {
      "description": "A great team.",
      "html_url": "https://github.com/orgs/github/teams/justice-league",
      "id": 1,
      "members_url": "https://api.github.com/teams/1/members{/member}",
      "name": "Justice League",
      "node_id": "MDQ6VGVhbTE=",
      "parent": null,
      "permission": "admin",
      "privacy": "closed",
      "repositories_url": "https://api.github.com/teams/1/repos",
      "slug": "justice-league",
      "url": "https://api.github.com/teams/1"
    }
  ],
  "teams_url": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/teams",
  "url": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions",
  "users": [
    {
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "followers_url": "https://api.github.com/users/octocat/followers",
      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
      "gravatar_id": "",
      "html_url": "https://github.com/octocat",
      "id": 1,
      "login": "octocat",
      "node_id": "MDQ6VXNlcjE=",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "site_admin": false,
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "type": "User",
      "url": "https://api.github.com/users/octocat"
    }
  ],
  "users_url": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/users"
}
```

```json
{"description":"Branch Restriction Policy","properties":{"apps":{"items":{"properties":{"created_at":{"type":"string"},"description":{"type":"string"},"events":{"items":{"type":"string"},"type":"array"},"external_url":{"type":"string"},"html_url":{"type":"string"},"id":{"type":"integer"},"name":{"type":"string"},"node_id":{"type":"string"},"owner":{"properties":{"avatar_url":{"type":"string"},"description":{"type":"string"},"events_url":{"type":"string"},"followers_url":{"example":"\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/followers\"","type":"string"},"following_url":{"example":"\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/following{/other_user}\"","type":"string"},"gists_url":{"example":"\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/gists{/gist_id}\"","type":"string"},"gravatar_id":{"example":"\"\"","type":"string"},"hooks_url":{"type":"string"},"html_url":{"example":"\"https://github.com/testorg-ea8ec76d71c3af4b\"","type":"string"},"id":{"type":"integer"},"issues_url":{"type":"string"},"login":{"type":"string"},"members_url":{"type":"string"},"node_id":{"type":"string"},"organizations_url":{"example":"\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/orgs\"","type":"string"},"public_members_url":{"type":"string"},"received_events_url":{"example":"\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/received_events\"","type":"string"},"repos_url":{"type":"string"},"site_admin":{"example":false,"type":"boolean"},"starred_url":{"example":"\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/starred{/owner}{/repo}\"","type":"string"},"subscriptions_url":{"example":"\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/subscriptions\"","type":"string"},"type":{"example":"\"Organization\"","type":"string"},"url":{"type":"string"}},"type":"object"},"permissions":{"properties":{"contents":{"type":"string"},"issues":{"type":"string"},"metadata":{"type":"string"},"single_file":{"type":"string"}},"type":"object"},"slug":{"type":"string"},"updated_at":{"type":"string"}},"type":"object"},"type":"array"},"apps_url":{"format":"uri","type":"string"},"teams":{"items":{"properties":{"description":{"nullable":true,"type":"string"},"html_url":{"type":"string"},"id":{"type":"integer"},"members_url":{"type":"string"},"name":{"type":"string"},"node_id":{"type":"string"},"parent":{"nullable":true,"type":"string"},"permission":{"type":"string"},"privacy":{"type":"string"},"repositories_url":{"type":"string"},"slug":{"type":"string"},"url":{"type":"string"}},"type":"object"},"type":"array"},"teams_url":{"format":"uri","type":"string"},"url":{"format":"uri","type":"string"},"users":{"items":{"properties":{"avatar_url":{"type":"string"},"events_url":{"type":"string"},"followers_url":{"type":"string"},"following_url":{"type":"string"},"gists_url":{"type":"string"},"gravatar_id":{"type":"string"},"html_url":{"type":"string"},"id":{"type":"integer"},"login":{"type":"string"},"node_id":{"type":"string"},"organizations_url":{"type":"string"},"received_events_url":{"type":"string"},"repos_url":{"type":"string"},"site_admin":{"type":"boolean"},"starred_url":{"type":"string"},"subscriptions_url":{"type":"string"},"type":{"type":"string"},"url":{"type":"string"}},"type":"object"},"type":"array"},"users_url":{"format":"uri","type":"string"}},"required":["url","users_url","teams_url","apps_url","users","teams","apps"],"title":"Branch Restriction Policy","type":"object"}
```

### `404`

Resource not found

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

## Request examples

### cURL

```shell
curl --request GET \
  --url {protocol}://{hostname}/api/v3/repos/{owner}/{repo}/branches/{branch}/protection/restrictions
```
