v56

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,4581,08113.3 MB
repos

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.

get/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams

Path parameters

ownerstring required

The account owner of the repository. The name is not case sensitive.

repostring required

The name of the repository without the .git extension. The name is not case sensitive.

branchstring required

The name of the branch. Cannot contain wildcard characters. To use wildcard characters in branch names, use the GraphQL API.

Response

Response

idinteger required
node_idstring required
namestring required
slugstring required
descriptionstring nullable required
privacystring
notification_settingstring
permissionstring required
urlstring uri required
html_urlstring uri required
members_urlstring required
repositories_urlstring 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_idinteger

Unique identifier of the organization to which this team belongs

enterprise_idinteger

Unique identifier of the enterprise to which this team belongs

Example response

[
  {
    "html_url": "https://github.com/orgs/rails/teams/core",
    "access_source": "direct",
    "organization_id": 37,
    "enterprise_id": 42,
    "parent": {
      "id": 1,
      "node_id": "MDQ6VGVhbTE=",
      "url": "https://api.github.com/organizations/1/team/1",
      "members_url": "https://api.github.com/organizations/1/team/1/members{/member}",
      "name": "Justice League",
      "description": "A great team.",
      "permission": "admin",
      "privacy": "closed",
      "notification_setting": "notifications_enabled",
      "html_url": "https://github.com/orgs/rails/teams/core",
      "repositories_url": "https://api.github.com/organizations/1/team/1/repos",
      "slug": "justice-league",
      "ldap_dn": "uid=example,ou=users,dc=github,dc=com",
      "organization_id": 37,
      "enterprise_id": 42
    }
  }
]