Skip to main content

Get teams with access to the protected branch

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 the teams who have push access to this branch. The list includes child teams.

GET/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams
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 array[Team object]

Response

items Team object

Groups of organization members that gives permissions on specified repositories.

description string
requirednullable
html_url string<uri>
required

Example: https://github.com/orgs/rails/teams/core

id integer
required
members_url string
required
name string
required
node_id string
required
parent Team Simple object
requirednullable

Groups of organization members that gives permissions on specified repositories.

description string
requirednullable

Description of the team

Example: A great team.

html_url string<uri>
required

Example: https://github.com/orgs/rails/teams/core

id integer
required

Unique identifier of the team

Example: 1

ldap_dn string
optional

Distinguished Name (DN) that team maps to within LDAP environment

Example: uid=example,ou=users,dc=github,dc=com

members_url string
required

Example: https://api.github.com/organizations/1/team/1/members{/member}

name string
required

Name of the team

Example: Justice League

node_id string
required

Example: MDQ6VGVhbTE=

permission string
required

Permission that the team will have for its repositories

Example: admin

privacy string
optional

The level of privacy this team should have

Example: closed

repositories_url string<uri>
required

Example: https://api.github.com/organizations/1/team/1/repos

slug string
required

Example: justice-league

url string<uri>
required

URL for the team

Example: https://api.github.com/organizations/1/team/1

permission string
required
permissions object
optional
admin boolean
required
maintain boolean
required
pull boolean
required
push boolean
required
triage boolean
required
privacy string
optional
repositories_url string<uri>
required
slug string
required
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