---
title: "Get access restrictions"
method: GET
path: "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
tags: ["repos"]
---

# Get access restrictions

`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.

## Path parameters

- `owner` string, required
- `repo` string, required
- `branch` string, required

## Response `200`

Response

- BranchRestrictionPolicy — Branch Restriction Policy
  - `url` string, uri, required
  - `users_url` string, uri, required
  - `teams_url` string, uri, required
  - `apps_url` string, uri, required
  - `users` object[], required
    - `login` string
    - `id` integer
    - `node_id` string
    - `avatar_url` string
    - `gravatar_id` string
    - `url` string
    - `html_url` string
    - `followers_url` string
    - `following_url` string
    - `gists_url` string
    - `starred_url` string
    - `subscriptions_url` string
    - `organizations_url` string
    - `repos_url` string
    - `events_url` string
    - `received_events_url` string
    - `type` string
    - `site_admin` boolean
    - `user_view_type` string
  - `teams` Team[], required
    - `id` integer, required
    - `node_id` string, required
    - `name` string, required
    - `slug` string, required
    - `description` string, nullable, required
    - `privacy` string
    - `notification_setting` string
    - `permission` string, required
    - `permissions` object
      - `pull` boolean, required
      - `triage` boolean, required
      - `push` boolean, required
      - `maintain` boolean, required
      - `admin` boolean, required
    - `url` string, uri, required
    - `html_url` string, uri, required
    - `members_url` string, required
    - `repositories_url` string, uri, required
    - `type` 'enterprise' | 'organization', required — The ownership type of the team
    - `access_source` 'direct' | 'organization' | 'enterprise' — How the team's access to the repository was granted. This property is only present when the team is returned in a repository context, such as `GET /repos/{owner}/{repo}/teams`.
    - `organization_id` integer — Unique identifier of the organization to which this team belongs
    - `enterprise_id` integer — Unique identifier of the enterprise to which this team belongs
    - `parent` NullableTeamSimple, nullable, required — Groups of organization members that gives permissions on specified repositories.
      - `id` integer, required — Unique identifier of the team
      - `node_id` string, required
      - `url` string, uri, required — URL for the team
      - `members_url` string, required
      - `name` string, required — Name of the team
      - `description` string, nullable, required — Description of the team
      - `permission` string, required — Permission that the team will have for its repositories
      - `privacy` string — The level of privacy this team should have
      - `notification_setting` string — The notification setting the team has set
      - `html_url` string, uri, required
      - `repositories_url` string, uri, required
      - `slug` string, required
      - `ldap_dn` string — Distinguished Name (DN) that team maps to within LDAP environment
      - `type` 'enterprise' | 'organization', required — The ownership type of the team
      - `organization_id` integer — Unique identifier of the organization to which this team belongs
      - `enterprise_id` integer — Unique identifier of the enterprise to which this team belongs
  - `apps` object[], required
    - `id` integer
    - `slug` string
    - `node_id` string
    - `owner` object
      - `login` string
      - `id` integer
      - `node_id` string
      - `url` string
      - `repos_url` string
      - `events_url` string
      - `hooks_url` string
      - `issues_url` string
      - `members_url` string
      - `public_members_url` string
      - `avatar_url` string
      - `description` string
      - `gravatar_id` string
      - `html_url` string
      - `followers_url` string
      - `following_url` string
      - `gists_url` string
      - `starred_url` string
      - `subscriptions_url` string
      - `organizations_url` string
      - `received_events_url` string
      - `type` string
      - `site_admin` boolean
      - `user_view_type` string
    - `name` string
    - `client_id` string
    - `description` string
    - `external_url` string
    - `html_url` string
    - `created_at` string
    - `updated_at` string
    - `permissions` object
      - `metadata` string
      - `contents` string
      - `issues` string
      - `single_file` string
    - `events` string[]

## Other responses

- `404` — Resource not found

---

[API](https://skmtc.net/github/apis/github-v3-rest-api.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api/versions/a367f7028301/schema)
