GitHub v3 REST API

Add or update team repository permissions (Legacy)

DEPRECATED

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new “Add or update team repository permissions” endpoint.

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.”

put
{protocol}://{hostname}/api/v3/teams/{team_id}/repos/{owner}/{repo}

Path Parameters

team_idintegerrequired
ownerstringrequired
repostringrequired

Body

application/json
permissionstring

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.

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:pullpushadmin

Response

Response

put/teams/{team_id}/repos/{owner}/{repo}

Body

{}
 

Remove a repository from a team (Legacy)

DEPRECATED

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Remove a repository from a team endpoint.

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. NOTE: This does not delete the repository, it just removes it from the team.

delete
{protocol}://{hostname}/api/v3/teams/{team_id}/repos/{owner}/{repo}

Path Parameters

team_idintegerrequired
ownerstringrequired
repostringrequired

Response

204

Response

delete/teams/{team_id}/repos/{owner}/{repo}
 
204

List child teams (Legacy)

DEPRECATED

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List child teams endpoint.

get
{protocol}://{hostname}/api/v3/teams/{team_id}/teams

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

team_idintegerrequired

Response

application/json

if child teams exist

Groups of organization members that gives permissions on specified repositories.

idintegerrequired
node_idstringrequired
namestringrequired
slugstringrequired
descriptionstring | nullrequired
privacystring
permissionstringrequired
permissionsobject
Show Child Parameters
urlstring(uri)required
html_urlstring(uri)required

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

members_urlstringrequired
repositories_urlstring(uri)required
parentobject | nullrequired

Groups of organization members that gives permissions on specified repositories.

Show Child Parameters
get/teams/{team_id}/teams
 
application/json

List teams for the authenticated user

List all of the teams across all of the organizations to which the authenticated user belongs. This method requires user, repo, or read:org scope when authenticating via OAuth.

get
{protocol}://{hostname}/api/v3/user/teams

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

Groups of organization members that gives permissions on specified repositories.

idintegerrequired

Unique identifier of the team

Example:42

node_idstringrequired

Example:MDQ6VGVhbTE=

urlstring(uri)required

URL for the team

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

html_urlstring(uri)required

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

namestringrequired

Name of the team

Example:Developers

slugstringrequired

Example:justice-league

descriptionstring | nullrequired

Example:A great team.

privacystring

The level of privacy this team should have

Allowed values:closedsecret

Example:closed

permissionstringrequired

Permission that the team will have for its repositories

Example:push

members_urlstringrequired

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

repositories_urlstring(uri)required

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

parentobject | null

Groups of organization members that gives permissions on specified repositories.

Show Child Parameters
members_countintegerrequired

Example:3

repos_countintegerrequired

Example:10

created_atstring(date-time)required

Example:2017-07-14T16:53:42Z

updated_atstring(date-time)required

Example:2017-08-17T12:37:15Z

organizationobjectrequired

Organization Full

Show Child Parameters
ldap_dnstring

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

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

get/user/teams
 
application/json

Get the authenticated user

If the authenticated user is authenticated through basic authentication or OAuth with the user scope, then the response lists public and private profile information.

If the authenticated user is authenticated through OAuth without the user scope, then the response lists only public profile information.

get
{protocol}://{hostname}/api/v3/user

Response

application/json

Response

One Of
loginstringrequired

Example:octocat

idintegerrequired

Example:1

node_idstringrequired

Example:MDQ6VXNlcjE=

avatar_urlstring(uri)required

Example:https://github.com/images/error/octocat_happy.gif

gravatar_idstring | nullrequired

Example:41d064eb2195891e12d0413f63227ea7

urlstring(uri)required

Example:https://api.github.com/users/octocat

html_urlstring(uri)required

Example:https://github.com/octocat

followers_urlstring(uri)required

Example:https://api.github.com/users/octocat/followers

following_urlstringrequired

Example:https://api.github.com/users/octocat/following{/other_user}

gists_urlstringrequired

Example:https://api.github.com/users/octocat/gists{/gist_id}

starred_urlstringrequired

Example:https://api.github.com/users/octocat/starred{/owner}{/repo}

subscriptions_urlstring(uri)required

Example:https://api.github.com/users/octocat/subscriptions

organizations_urlstring(uri)required

Example:https://api.github.com/users/octocat/orgs

repos_urlstring(uri)required

Example:https://api.github.com/users/octocat/repos

events_urlstringrequired

Example:https://api.github.com/users/octocat/events{/privacy}

received_events_urlstring(uri)required

Example:https://api.github.com/users/octocat/received_events

typestringrequired

Example:User

site_adminbooleanrequired
namestring | nullrequired

Example:monalisa octocat

companystring | nullrequired

Example:GitHub

blogstring | nullrequired

Example:https://github.com/blog

locationstring | nullrequired

Example:San Francisco

emailstring | null(email)required

Example:octocat@github.com

hireableboolean | nullrequired
biostring | nullrequired

Example:There once was...

public_reposintegerrequired

Example:2

public_gistsintegerrequired

Example:1

followersintegerrequired

Example:20

followingintegerrequired

Example:0

created_atstring(date-time)required

Example:2008-01-14T04:33:35Z

updated_atstring(date-time)required

Example:2008-01-14T04:33:35Z

private_gistsintegerrequired

Example:81

total_private_reposintegerrequired

Example:100

owned_private_reposintegerrequired

Example:100

disk_usageintegerrequired

Example:10000

collaboratorsintegerrequired

Example:8

two_factor_authenticationbooleanrequired

Example:true

planobject
Show Child Parameters
suspended_atstring | null(date-time)
business_plusboolean
ldap_dnstring
get/user
 
application/json