team_slug parameter
Add or update team repository permissions
To add a repository to a team or update the team’s permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a 422 Unprocessable Entity
status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you’ll need to set Content-Length
to zero when calling out to this endpoint. For more information, see “HTTP verbs.”
Note: You can also specify a team by org_id
and team_id
using the route PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}
.
For more information about the permission levels, see “Repository permission levels for an organization”.
Path Parameters
Body
application/json
Body
The permission to grant the team on this repository. Can be one of:
* pull
- team members can pull, but not push to or administer this repository.
* push
- team members can pull and push, but not administer this repository.
* admin
- team members can pull, push and administer this repository.
* maintain
- team members can manage the repository without access to sensitive or destructive actions. Recommended for project managers. Only applies to repositories owned by organizations.
* triage
- team members can proactively manage issues and pull requests without write access. Recommended for contributors who triage a repository. Only applies to repositories owned by organizations.
If no permission is specified, the team’s permission
attribute will be used to determine what permission to grant the team on this repository.
Allowed values:pullpushadminmaintaintriage
Default:push
Response
204
Response
Response
Path Parameters
Body
Remove a repository from a team
If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.
Note: You can also specify a team by org_id
and team_id
using the route DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}
.
Path Parameters
team_slug parameter
Response
204
Response
Response
Path Parameters
List child teams
Lists the child teams of the team specified by {team_slug}
.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/teams
.
Query Parameters
Results per page (max 100)
Default:30
Page number of the results to fetch.
Default:1
Path Parameters
team_slug parameter
Response
200 application/json
Response
if child teams exist
Groups of organization members that gives permissions on specified repositories.
Show Child Parameters
Example:https://github.com/orgs/rails/teams/core
Groups of organization members that gives permissions on specified repositories.
Show Child Parameters
Path Parameters
Query Parameters
Get a team (Legacy)
DEPRECATEDDeprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the Get a team by name endpoint.
Path Parameters
Response
application/json
Response
Response
Full Team
Groups of organization members that gives permissions on specified repositories.
Unique identifier of the team
Example:42
Example:MDQ6VGVhbTE=
URL for the team
Example:https://api.github.com/organizations/1/team/1
Example:https://github.com/orgs/rails/teams/core
Name of the team
Example:Developers
Example:justice-league
Example:A great team.
The level of privacy this team should have
Allowed values:closedsecret
Example:closed
Permission that the team will have for its repositories
Example:push
Example:https://api.github.com/organizations/1/team/1/members{/member}
Example:https://api.github.com/organizations/1/team/1/repos
Groups of organization members that gives permissions on specified repositories.
Show Child Parameters
Example:3
Example:10
Example:2017-07-14T16:53:42Z
Example:2017-08-17T12:37:15Z
Organization Full
Show Child Parameters
Distinguished Name (DN) that team maps to within LDAP environment
Example:uid=example,ou=users,dc=github,dc=com
Path Parameters
Update a team (Legacy)
DEPRECATEDDeprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Update a team endpoint.
To edit a team, the authenticated user must either be an organization owner or a team maintainer.
Note: With nested teams, the privacy
for parent teams cannot be secret
.
Path Parameters
Body
application/json
Body
The name of the team.
The description of the team.
The level of privacy this team should have. Editing teams without specifying this parameter leaves privacy
intact. The options are:
For a non-nested team:
* secret
- only visible to organization owners and members of this team.
* closed
- visible to all members of this organization.
For a parent or child team:
* closed
- visible to all members of this organization.
Allowed values:secretclosed
Deprecated. The permission that new repositories will be added to the team with when none is specified. Can be one of:
* pull
- team members can pull, but not push to or administer newly-added repositories.
* push
- team members can pull and push, but not administer newly-added repositories.
* admin
- team members can pull, push and administer newly-added repositories.
Allowed values:pullpushadmin
Default:pull
The ID of a team to set as the parent team.
Response
application/json
Response
Response
Full Team
Groups of organization members that gives permissions on specified repositories.
Unique identifier of the team
Example:42
Example:MDQ6VGVhbTE=
URL for the team
Example:https://api.github.com/organizations/1/team/1
Example:https://github.com/orgs/rails/teams/core
Name of the team
Example:Developers
Example:justice-league
Example:A great team.
The level of privacy this team should have
Allowed values:closedsecret
Example:closed
Permission that the team will have for its repositories
Example:push
Example:https://api.github.com/organizations/1/team/1/members{/member}
Example:https://api.github.com/organizations/1/team/1/repos
Groups of organization members that gives permissions on specified repositories.
Show Child Parameters
Example:3
Example:10
Example:2017-07-14T16:53:42Z
Example:2017-08-17T12:37:15Z
Organization Full
Show Child Parameters
Distinguished Name (DN) that team maps to within LDAP environment
Example:uid=example,ou=users,dc=github,dc=com