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 in the GitHub Help documentation.

Lists the teams who have push access to this branch. The list includes child teams.


string The token will be passed in the authorization header.



string branch+ parameter


GET https://api.github.com/repos///branches//protection/restrictions/teams
authorization: bearer undefined
accept: application/vnd.github.v3+json
user-agent: octokit.rest

Example Response

Status: 200
    "id": 1,
    "node_id": "MDQ6VGVhbTE=",
    "url": "https://api.github.com/teams/1",
    "html_url": "https://github.com/orgs/github/teams/justice-league",
    "name": "Justice League",
    "slug": "justice-league",
    "description": "A great team.",
    "privacy": "closed",
    "permission": "admin",
    "members_url": "https://api.github.com/teams/1/members{/member}",
    "repositories_url": "https://api.github.com/teams/1/repos",
    "parent": null

See documentation on GitHub developer guides