POST
/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teamsAdd team access restrictions
Grants the specified teams push access to a protected branch, including access for child teams. Provide team slugs in teams to add those teams to the branch's access restrictions.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
ownerstringrequired
The account owner of the repository; the name is not case-sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case-sensitive.
branchstringrequired
The branch name. Wildcard characters are not allowed.
Optional team access restriction data, supplied as an array of team slugs or an object containing teams.
teamsarray<string>required
The slug values for teams
200Returns an array of team objects with their repository access details.
idintegerrequired
node_idstringrequired
namestringrequired
slugstringrequired
descriptionstringrequired
privacystringoptional
notification_settingstringoptional
permissionstringrequired
permissionsobjectoptional
urlstringrequired
html_urlstringrequired
members_urlstringrequired
repositories_urlstringrequired
typestringrequired
The ownership type of the team
access_sourcestringoptional
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_idintegeroptional
Unique identifier of the organization to which this team belongs
enterprise_idintegeroptional
Unique identifier of the enterprise to which this team belongs
parentobjectrequired
Groups of organization members that gives permissions on specified repositories.
422Returned when validation fails or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional
Error handling
A 422 is returned when validation fails or the endpoint has been spammed. If you provide a request body, teams must contain team slugs, either as an array or in an object. The owner path parameter and repo path parameter must identify the repository, and the branch path parameter must name a branch without wildcard characters.