Skip to main content
O controle de versão da API REST já foi feito. Para obter mais informações, confira "Sobre o controle de versão da API".

Pontos de extremidade de API REST para equipes

Use a API REST para criar e gerenciar equipes em sua organização GitHub Enterprise Cloud.

Sobre equipes

Esses pontos de extremidade só estão disponíveis para os membros autenticados da organização da equipe. Os tokens de acesso OAuth exigem o read:orgescopo . O GitHub gera o slug da equipe com base no name da equipe.

List teams

Lists all teams in an organization that are visible to the authenticated user.

Tokens de acesso refinados para "List teams"

Esse ponto de extremidade funciona com os seguintes tipos de token:

O token deve ter os seguintes conjuntos de permissões:

  • members:read

Parâmetros para "List teams"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Padrão: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Padrão: 1

Códigos de status de resposta HTTP para "List teams"

Código de statusDescrição
200

OK

403

Forbidden

Exemplos de código para "List teams"

Exemplo de solicitação

get/orgs/{org}/teams
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams

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", "notification_setting": "notifications_enabled", "permission": "admin", "members_url": "https://api.github.com/teams/1/members{/member}", "repositories_url": "https://api.github.com/teams/1/repos", "parent": null } ]

Create a team

To create a team, the authenticated user must be a member or owner of {org}. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "Setting team creation permissions."

When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of maintainers. For more information, see "About teams".

Tokens de acesso refinados para "Create a team"

Esse ponto de extremidade funciona com os seguintes tipos de token:

O token deve ter os seguintes conjuntos de permissões:

  • members:write

Parâmetros para "Create a team"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

Parâmetros do corpo
Nome, Tipo, Descrição
name string Obrigatório

The name of the team.

description string

The description of the team.

maintainers array of strings

List GitHub IDs for organization members who will become team maintainers.

repo_names array of strings

The full name (e.g., "organization-name/repository-name") of repositories to add the team to.

privacy string

The level of privacy this team should have. 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.
    Default: secret
    For a parent or child team:
  • closed - visible to all members of this organization.
    Default for child team: closed

Pode ser um dos: secret, closed

notification_setting string

The notification setting the team has chosen. The options are:

  • notifications_enabled - team members receive notifications when the team is @mentioned.
  • notifications_disabled - no one receives notifications.
    Default: notifications_enabled

Pode ser um dos: notifications_enabled, notifications_disabled

permission string

Deprecated. The permission that new repositories will be added to the team with when none is specified.

Padrão: pull

Pode ser um dos: pull, push

parent_team_id integer

The ID of a team to set as the parent team.

Códigos de status de resposta HTTP para "Create a team"

Código de statusDescrição
201

Created

403

Forbidden

422

Validation failed, or the endpoint has been spammed.

Exemplos de código para "Create a team"

Exemplo de solicitação

post/orgs/{org}/teams
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams \ -d '{"name":"Justice League","description":"A great team","permission":"push","notification_setting":"notifications_enabled","privacy":"closed"}'

Response

Status: 201
{ "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", "notification_setting": "notifications_enabled", "permission": "admin", "members_url": "https://api.github.com/teams/1/members{/member}", "repositories_url": "https://api.github.com/teams/1/repos", "parent": null, "members_count": 3, "repos_count": 10, "created_at": "2017-07-14T16:53:42Z", "updated_at": "2017-08-17T12:37:15Z", "organization": { "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "repos_url": "https://api.github.com/orgs/github/repos", "events_url": "https://api.github.com/orgs/github/events", "hooks_url": "https://api.github.com/orgs/github/hooks", "issues_url": "https://api.github.com/orgs/github/issues", "members_url": "https://api.github.com/orgs/github/members{/member}", "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "description": "A great organization", "name": "github", "company": "GitHub", "blog": "https://github.com/blog", "location": "San Francisco", "email": "octocat@github.com", "is_verified": true, "has_organization_projects": true, "has_repository_projects": true, "public_repos": 2, "public_gists": 1, "followers": 20, "following": 0, "html_url": "https://github.com/octocat", "created_at": "2008-01-14T04:33:35Z", "updated_at": "2017-08-17T12:37:15Z", "type": "Organization" } }

Get a team by name

Gets a team using the team's slug. To create the slug, GitHub Enterprise Cloud replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a - separator. For example, "My TEam Näme" would become my-team-name.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}.

Parâmetros para "Get a team by name"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

Códigos de status de resposta HTTP para "Get a team by name"

Código de statusDescrição
200

OK

404

Resource not found

Exemplos de código para "Get a team by name"

Exemplo de solicitação

get/orgs/{org}/teams/{team_slug}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG

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", "notification_setting": "notifications_enabled", "permission": "admin", "members_url": "https://api.github.com/teams/1/members{/member}", "repositories_url": "https://api.github.com/teams/1/repos", "parent": null, "members_count": 3, "repos_count": 10, "created_at": "2017-07-14T16:53:42Z", "updated_at": "2017-08-17T12:37:15Z", "organization": { "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "repos_url": "https://api.github.com/orgs/github/repos", "events_url": "https://api.github.com/orgs/github/events", "hooks_url": "https://api.github.com/orgs/github/hooks", "issues_url": "https://api.github.com/orgs/github/issues", "members_url": "https://api.github.com/orgs/github/members{/member}", "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "description": "A great organization", "name": "github", "company": "GitHub", "blog": "https://github.com/blog", "location": "San Francisco", "email": "octocat@github.com", "is_verified": true, "has_organization_projects": true, "has_repository_projects": true, "public_repos": 2, "public_gists": 1, "followers": 20, "following": 0, "html_url": "https://github.com/octocat", "created_at": "2008-01-14T04:33:35Z", "updated_at": "2017-08-17T12:37:15Z", "type": "Organization" } }

Update a team

To edit a team, the authenticated user must either be an organization owner or a team maintainer.

Note: You can also specify a team by org_id and team_id using the route PATCH /organizations/{org_id}/team/{team_id}.

Parâmetros para "Update a team"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

Parâmetros do corpo
Nome, Tipo, Descrição
name string

The name of the team.

description string

The description of the team.

privacy string

The level of privacy this team should have. Editing teams without specifying this parameter leaves privacy intact. When a team is nested, the privacy for parent teams cannot be secret. 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.

Pode ser um dos: secret, closed

notification_setting string

The notification setting the team has chosen. Editing teams without specifying this parameter leaves notification_setting intact. The options are:

  • notifications_enabled - team members receive notifications when the team is @mentioned.
  • notifications_disabled - no one receives notifications.

Pode ser um dos: notifications_enabled, notifications_disabled

permission string

Deprecated. The permission that new repositories will be added to the team with when none is specified.

Padrão: pull

Pode ser um dos: pull, push, admin

parent_team_id integer or null

The ID of a team to set as the parent team.

Códigos de status de resposta HTTP para "Update a team"

Código de statusDescrição
200

Response when the updated information already exists

201

Created

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Exemplos de código para "Update a team"

Exemplos de solicitação

patch/orgs/{org}/teams/{team_slug}
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG \ -d '{"name":"new team name","description":"new team description","privacy":"closed","notification_setting":"notifications_enabled"}'

Response when the updated information already exists

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", "notification_setting": "notifications_enabled", "permission": "admin", "members_url": "https://api.github.com/teams/1/members{/member}", "repositories_url": "https://api.github.com/teams/1/repos", "parent": null, "members_count": 3, "repos_count": 10, "created_at": "2017-07-14T16:53:42Z", "updated_at": "2017-08-17T12:37:15Z", "organization": { "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "repos_url": "https://api.github.com/orgs/github/repos", "events_url": "https://api.github.com/orgs/github/events", "hooks_url": "https://api.github.com/orgs/github/hooks", "issues_url": "https://api.github.com/orgs/github/issues", "members_url": "https://api.github.com/orgs/github/members{/member}", "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "description": "A great organization", "name": "github", "company": "GitHub", "blog": "https://github.com/blog", "location": "San Francisco", "email": "octocat@github.com", "is_verified": true, "has_organization_projects": true, "has_repository_projects": true, "public_repos": 2, "public_gists": 1, "followers": 20, "following": 0, "html_url": "https://github.com/octocat", "created_at": "2008-01-14T04:33:35Z", "updated_at": "2017-08-17T12:37:15Z", "type": "Organization" } }

Delete a team

To delete a team, the authenticated user must be an organization owner or team maintainer.

If you are an organization owner, deleting a parent team will delete all of its child teams as well.

Note: You can also specify a team by org_id and team_id using the route DELETE /organizations/{org_id}/team/{team_id}.

Parâmetros para "Delete a team"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

Códigos de status de resposta HTTP para "Delete a team"

Código de statusDescrição
204

No Content

Exemplos de código para "Delete a team"

Exemplo de solicitação

delete/orgs/{org}/teams/{team_slug}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG

Response

Status: 204

List team projects

Lists the organization projects for a team.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/projects.

Parâmetros para "List team projects"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Padrão: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Padrão: 1

Códigos de status de resposta HTTP para "List team projects"

Código de statusDescrição
200

OK

Exemplos de código para "List team projects"

Exemplo de solicitação

get/orgs/{org}/teams/{team_slug}/projects
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/projects

Response

Status: 200
[ { "owner_url": "https://api.github.com/orgs/octocat", "url": "https://api.github.com/projects/1002605", "html_url": "https://github.com/orgs/api-playground/projects/1", "columns_url": "https://api.github.com/projects/1002605/columns", "id": 1002605, "node_id": "MDc6UHJvamVjdDEwMDI2MDU=", "name": "Organization Roadmap", "body": "High-level roadmap for the upcoming year.", "number": 1, "state": "open", "creator": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "created_at": "2011-04-11T20:09:31Z", "updated_at": "2014-03-04T18:58:10Z", "organization_permission": "write", "private": false, "permissions": { "read": true, "write": true, "admin": false } } ]

Check team permissions for a project

Checks whether a team has read, write, or admin permissions for an organization project. The response includes projects inherited from a parent team.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/projects/{project_id}.

Parâmetros para "Check team permissions for a project"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

project_id integer Obrigatório

The unique identifier of the project.

Códigos de status de resposta HTTP para "Check team permissions for a project"

Código de statusDescrição
200

OK

404

Not Found if project is not managed by this team

Exemplos de código para "Check team permissions for a project"

Exemplo de solicitação

get/orgs/{org}/teams/{team_slug}/projects/{project_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/projects/PROJECT_ID

Response

Status: 200
{ "owner_url": "https://api.github.com/orgs/octocat", "url": "https://api.github.com/projects/1002605", "html_url": "https://github.com/orgs/api-playground/projects/1", "columns_url": "https://api.github.com/projects/1002605/columns", "id": 1002605, "node_id": "MDc6UHJvamVjdDEwMDI2MDU=", "name": "Organization Roadmap", "body": "High-level roadmap for the upcoming year.", "number": 1, "state": "open", "creator": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "created_at": "2011-04-11T20:09:31Z", "updated_at": "2014-03-04T18:58:10Z", "organization_permission": "write", "private": false, "permissions": { "read": true, "write": true, "admin": false } }

Add or update team project permissions

Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have admin permissions for the project. The project and team must be part of the same organization.

Note: You can also specify a team by org_id and team_id using the route PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}.

Parâmetros para "Add or update team project permissions"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

project_id integer Obrigatório

The unique identifier of the project.

Parâmetros do corpo
Nome, Tipo, Descrição
permission string

The permission to grant to the team for this project. Default: the team's permission attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set Content-Length to zero when calling this endpoint. For more information, see "HTTP method."

Pode ser um dos: read, write, admin

Códigos de status de resposta HTTP para "Add or update team project permissions"

Código de statusDescrição
204

No Content

403

Forbidden if the project is not owned by the organization

Exemplos de código para "Add or update team project permissions"

Exemplo de solicitação

put/orgs/{org}/teams/{team_slug}/projects/{project_id}
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/projects/PROJECT_ID \ -d '{"permission":"write"}'

Response

Status: 204

Remove a project from a team

Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have read access to both the team and project, or admin access to the team or project. This endpoint removes the project from the team, but does not delete the project.

Note: You can also specify a team by org_id and team_id using the route DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}.

Parâmetros para "Remove a project from a team"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

project_id integer Obrigatório

The unique identifier of the project.

Códigos de status de resposta HTTP para "Remove a project from a team"

Código de statusDescrição
204

No Content

Exemplos de código para "Remove a project from a team"

Exemplo de solicitação

delete/orgs/{org}/teams/{team_slug}/projects/{project_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/projects/PROJECT_ID

Response

Status: 204

List team repositories

Lists a team's repositories visible to the authenticated user.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/repos.

Parâmetros para "List team repositories"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Padrão: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Padrão: 1

Códigos de status de resposta HTTP para "List team repositories"

Código de statusDescrição
200

OK

Exemplos de código para "List team repositories"

Exemplo de solicitação

get/orgs/{org}/teams/{team_slug}/repos
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/repos

Response

Status: 200
[ { "id": 1296269, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", "name": "Hello-World", "full_name": "octocat/Hello-World", "owner": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "private": false, "html_url": "https://github.com/octocat/Hello-World", "description": "This your first repo!", "fork": false, "url": "https://api.github.com/repos/octocat/Hello-World", "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}", "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}", "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}", "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}", "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}", "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}", "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}", "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}", "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}", "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors", "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments", "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads", "events_url": "https://api.github.com/repos/octocat/Hello-World/events", "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks", "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}", "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}", "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}", "git_url": "git:github.com/octocat/Hello-World.git", "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}", "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}", "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}", "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}", "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}", "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages", "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges", "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}", "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}", "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}", "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}", "ssh_url": "git@github.com:octocat/Hello-World.git", "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers", "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}", "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers", "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription", "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags", "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams", "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}", "clone_url": "https://github.com/octocat/Hello-World.git", "mirror_url": "git:git.example.com/octocat/Hello-World", "hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks", "svn_url": "https://svn.github.com/octocat/Hello-World", "homepage": "https://github.com", "language": null, "forks_count": 9, "stargazers_count": 80, "watchers_count": 80, "size": 108, "default_branch": "master", "open_issues_count": 0, "is_template": false, "topics": [ "octocat", "atom", "electron", "api" ], "has_issues": true, "has_projects": true, "has_wiki": true, "has_pages": false, "has_downloads": true, "has_discussions": false, "archived": false, "disabled": false, "visibility": "public", "pushed_at": "2011-01-26T19:06:43Z", "created_at": "2011-01-26T19:01:12Z", "updated_at": "2011-01-26T19:14:43Z", "permissions": { "admin": false, "push": false, "pull": true }, "security_and_analysis": { "advanced_security": { "status": "enabled" }, "secret_scanning": { "status": "enabled" }, "secret_scanning_push_protection": { "status": "disabled" }, "secret_scanning_validity_checks": { "status": "disabled" } } } ]

Check team permissions for a repository

Checks whether a team has admin, push, maintain, triage, or pull permission for a repository. Repositories inherited through a parent team will also be checked.

You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom media type via the application/vnd.github.v3.repository+json accept header.

If a team doesn't have permission for the repository, you will receive a 404 Not Found response status.

If the repository is private, you must have at least read permission for that repository, and your token must have the repo or admin:org scope. Otherwise, you will receive a 404 Not Found response status.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}.

Parâmetros para "Check team permissions for a repository"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

owner string Obrigatório

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

repo string Obrigatório

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

Códigos de status de resposta HTTP para "Check team permissions for a repository"

Código de statusDescrição
200

Alternative response with repository permissions

204

Response if team has permission for the repository. This is the response when the repository media type hasn't been provded in the Accept header.

404

Not Found if team does not have permission for the repository

Exemplos de código para "Check team permissions for a repository"

Exemplo de solicitação

get/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/repos/OWNER/REPO

Alternative response with repository permissions

Status: 200
{ "id": 1296269, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", "name": "Hello-World", "full_name": "octocat/Hello-World", "owner": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "private": false, "html_url": "https://github.com/octocat/Hello-World", "description": "This your first repo!", "fork": false, "url": "https://api.github.com/repos/octocat/Hello-World", "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}", "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}", "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}", "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}", "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}", "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}", "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}", "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}", "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}", "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors", "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments", "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads", "events_url": "https://api.github.com/repos/octocat/Hello-World/events", "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks", "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}", "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}", "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}", "git_url": "git:github.com/octocat/Hello-World.git", "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}", "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}", "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}", "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}", "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}", "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages", "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges", "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}", "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}", "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}", "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}", "ssh_url": "git@github.com:octocat/Hello-World.git", "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers", "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}", "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers", "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription", "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags", "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams", "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}", "clone_url": "https://github.com/octocat/Hello-World.git", "mirror_url": "git:git.example.com/octocat/Hello-World", "hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks", "svn_url": "https://svn.github.com/octocat/Hello-World", "homepage": "https://github.com", "language": null, "forks_count": 9, "stargazers_count": 80, "watchers_count": 80, "size": 108, "default_branch": "master", "open_issues_count": 0, "is_template": false, "topics": [ "octocat", "atom", "electron", "api" ], "has_issues": true, "has_projects": true, "has_wiki": true, "has_pages": false, "has_downloads": true, "archived": false, "disabled": false, "visibility": "public", "pushed_at": "2011-01-26T19:06:43Z", "created_at": "2011-01-26T19:01:12Z", "updated_at": "2011-01-26T19:14:43Z", "permissions": { "admin": false, "maintain": false, "push": false, "triage": false, "pull": true }, "role_name": "read", "allow_rebase_merge": true, "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O", "allow_squash_merge": true, "allow_auto_merge": false, "delete_branch_on_merge": true, "allow_merge_commit": true, "subscribers_count": 42, "network_count": 0, "license": { "key": "mit", "name": "MIT License", "url": "https://api.github.com/licenses/mit", "spdx_id": "MIT", "node_id": "MDc6TGljZW5zZW1pdA==", "html_url": "https://api.github.com/licenses/mit" }, "forks": 1, "open_issues": 1, "watchers": 1 }

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 method."

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

Parâmetros para "Add or update team repository permissions"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

owner string Obrigatório

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

repo string Obrigatório

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

Parâmetros do corpo
Nome, Tipo, Descrição
permission string

The permission to grant the team on this repository. We accept the following permissions to be set: pull, triage, push, maintain, admin and you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team's permission attribute will be used to determine what permission to grant the team on this repository.

Padrão: push

Códigos de status de resposta HTTP para "Add or update team repository permissions"

Código de statusDescrição
204

No Content

Exemplos de código para "Add or update team repository permissions"

Exemplo de solicitação

put/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/repos/OWNER/REPO \ -d '{"permission":"push"}'

Response

Status: 204

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

Parâmetros para "Remove a repository from a team"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

owner string Obrigatório

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

repo string Obrigatório

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

Códigos de status de resposta HTTP para "Remove a repository from a team"

Código de statusDescrição
204

No Content

Exemplos de código para "Remove a repository from a team"

Exemplo de solicitação

delete/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/repos/OWNER/REPO

Response

Status: 204

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.

Parâmetros para "List child teams"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Padrão: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Padrão: 1

Códigos de status de resposta HTTP para "List child teams"

Código de statusDescrição
200

if child teams exist

Exemplos de código para "List child teams"

Exemplo de solicitação

get/orgs/{org}/teams/{team_slug}/teams
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/teams

if child teams exist

Status: 200
[ { "id": 2, "node_id": "MDQ6VGVhbTI=", "url": "https://api.github.com/teams/2", "name": "Original Roster", "slug": "original-roster", "description": "Started it all.", "privacy": "closed", "notification_setting": "notifications_enabled", "permission": "admin", "members_url": "https://api.github.com/teams/2/members{/member}", "repositories_url": "https://api.github.com/teams/2/repos", "parent": { "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", "notification_setting": "notifications_enabled", "permission": "admin", "members_url": "https://api.github.com/teams/1/members{/member}", "repositories_url": "https://api.github.com/teams/1/repos" }, "html_url": "https://github.com/orgs/rails/teams/core" } ]

Get a team (Legacy)

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

Parâmetros para "Get a team (Legacy)"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
team_id integer Obrigatório

The unique identifier of the team.

Códigos de status de resposta HTTP para "Get a team (Legacy)"

Código de statusDescrição
200

OK

404

Resource not found

Exemplos de código para "Get a team (Legacy)"

Exemplo de solicitação

get/teams/{team_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/teams/TEAM_ID

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", "notification_setting": "notifications_enabled", "permission": "admin", "members_url": "https://api.github.com/teams/1/members{/member}", "repositories_url": "https://api.github.com/teams/1/repos", "parent": null, "members_count": 3, "repos_count": 10, "created_at": "2017-07-14T16:53:42Z", "updated_at": "2017-08-17T12:37:15Z", "organization": { "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "repos_url": "https://api.github.com/orgs/github/repos", "events_url": "https://api.github.com/orgs/github/events", "hooks_url": "https://api.github.com/orgs/github/hooks", "issues_url": "https://api.github.com/orgs/github/issues", "members_url": "https://api.github.com/orgs/github/members{/member}", "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "description": "A great organization", "name": "github", "company": "GitHub", "blog": "https://github.com/blog", "location": "San Francisco", "email": "octocat@github.com", "is_verified": true, "has_organization_projects": true, "has_repository_projects": true, "public_repos": 2, "public_gists": 1, "followers": 20, "following": 0, "html_url": "https://github.com/octocat", "created_at": "2008-01-14T04:33:35Z", "updated_at": "2017-08-17T12:37:15Z", "type": "Organization" } }

Update a team (Legacy)

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

Parâmetros para "Update a team (Legacy)"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
team_id integer Obrigatório

The unique identifier of the team.

Parâmetros do corpo
Nome, Tipo, Descrição
name string Obrigatório

The name of the team.

description string

The description of the team.

privacy string

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.

Pode ser um dos: secret, closed

notification_setting string

The notification setting the team has chosen. Editing teams without specifying this parameter leaves notification_setting intact. The options are:

  • notifications_enabled - team members receive notifications when the team is @mentioned.
  • notifications_disabled - no one receives notifications.

Pode ser um dos: notifications_enabled, notifications_disabled

permission string

Deprecated. The permission that new repositories will be added to the team with when none is specified.

Padrão: pull

Pode ser um dos: pull, push, admin

parent_team_id integer or null

The ID of a team to set as the parent team.

Códigos de status de resposta HTTP para "Update a team (Legacy)"

Código de statusDescrição
200

Response when the updated information already exists

201

Created

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Exemplos de código para "Update a team (Legacy)"

Exemplos de solicitação

patch/teams/{team_id}
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/teams/TEAM_ID \ -d '{"name":"new team name","description":"new team description","privacy":"closed","notification_setting":"notifications_enabled"}'

Response when the updated information already exists

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", "notification_setting": "notifications_enabled", "permission": "admin", "members_url": "https://api.github.com/teams/1/members{/member}", "repositories_url": "https://api.github.com/teams/1/repos", "parent": null, "members_count": 3, "repos_count": 10, "created_at": "2017-07-14T16:53:42Z", "updated_at": "2017-08-17T12:37:15Z", "organization": { "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "repos_url": "https://api.github.com/orgs/github/repos", "events_url": "https://api.github.com/orgs/github/events", "hooks_url": "https://api.github.com/orgs/github/hooks", "issues_url": "https://api.github.com/orgs/github/issues", "members_url": "https://api.github.com/orgs/github/members{/member}", "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "description": "A great organization", "name": "github", "company": "GitHub", "blog": "https://github.com/blog", "location": "San Francisco", "email": "octocat@github.com", "is_verified": true, "has_organization_projects": true, "has_repository_projects": true, "public_repos": 2, "public_gists": 1, "followers": 20, "following": 0, "html_url": "https://github.com/octocat", "created_at": "2008-01-14T04:33:35Z", "updated_at": "2017-08-17T12:37:15Z", "type": "Organization" } }

Delete a team (Legacy)

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 Delete a team endpoint.

To delete a team, the authenticated user must be an organization owner or team maintainer.

If you are an organization owner, deleting a parent team will delete all of its child teams as well.

Parâmetros para "Delete a team (Legacy)"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
team_id integer Obrigatório

The unique identifier of the team.

Códigos de status de resposta HTTP para "Delete a team (Legacy)"

Código de statusDescrição
204

No Content

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Exemplos de código para "Delete a team (Legacy)"

Exemplo de solicitação

delete/teams/{team_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/teams/TEAM_ID

Response

Status: 204

List team projects (Legacy)

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 team projects endpoint.

Lists the organization projects for a team.

Parâmetros para "List team projects (Legacy)"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
team_id integer Obrigatório

The unique identifier of the team.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Padrão: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Padrão: 1

Códigos de status de resposta HTTP para "List team projects (Legacy)"

Código de statusDescrição
200

OK

404

Resource not found

Exemplos de código para "List team projects (Legacy)"

Exemplo de solicitação

get/teams/{team_id}/projects
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/teams/TEAM_ID/projects

Response

Status: 200
[ { "owner_url": "https://api.github.com/orgs/octocat", "url": "https://api.github.com/projects/1002605", "html_url": "https://github.com/orgs/api-playground/projects/1", "columns_url": "https://api.github.com/projects/1002605/columns", "id": 1002605, "node_id": "MDc6UHJvamVjdDEwMDI2MDU=", "name": "Organization Roadmap", "body": "High-level roadmap for the upcoming year.", "number": 1, "state": "open", "creator": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "created_at": "2011-04-11T20:09:31Z", "updated_at": "2014-03-04T18:58:10Z", "organization_permission": "write", "private": false, "permissions": { "read": true, "write": true, "admin": false } } ]

Check team permissions for a project (Legacy)

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 Check team permissions for a project endpoint.

Checks whether a team has read, write, or admin permissions for an organization project. The response includes projects inherited from a parent team.

Parâmetros para "Check team permissions for a project (Legacy)"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
team_id integer Obrigatório

The unique identifier of the team.

project_id integer Obrigatório

The unique identifier of the project.

Códigos de status de resposta HTTP para "Check team permissions for a project (Legacy)"

Código de statusDescrição
200

OK

404

Not Found if project is not managed by this team

Exemplos de código para "Check team permissions for a project (Legacy)"

Exemplo de solicitação

get/teams/{team_id}/projects/{project_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/teams/TEAM_ID/projects/PROJECT_ID

Response

Status: 200
{ "owner_url": "https://api.github.com/orgs/octocat", "url": "https://api.github.com/projects/1002605", "html_url": "https://github.com/orgs/api-playground/projects/1", "columns_url": "https://api.github.com/projects/1002605/columns", "id": 1002605, "node_id": "MDc6UHJvamVjdDEwMDI2MDU=", "name": "Organization Roadmap", "body": "High-level roadmap for the upcoming year.", "number": 1, "state": "open", "creator": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "created_at": "2011-04-11T20:09:31Z", "updated_at": "2014-03-04T18:58:10Z", "organization_permission": "write", "private": false, "permissions": { "read": true, "write": true, "admin": false } }

Add or update team project permissions (Legacy)

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 project permissions endpoint.

Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have admin permissions for the project. The project and team must be part of the same organization.

Parâmetros para "Add or update team project permissions (Legacy)"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
team_id integer Obrigatório

The unique identifier of the team.

project_id integer Obrigatório

The unique identifier of the project.

Parâmetros do corpo
Nome, Tipo, Descrição
permission string

The permission to grant to the team for this project. Default: the team's permission attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set Content-Length to zero when calling this endpoint. For more information, see "HTTP method."

Pode ser um dos: read, write, admin

Códigos de status de resposta HTTP para "Add or update team project permissions (Legacy)"

Código de statusDescrição
204

No Content

403

Forbidden if the project is not owned by the organization

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Exemplos de código para "Add or update team project permissions (Legacy)"

Exemplo de solicitação

put/teams/{team_id}/projects/{project_id}
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/teams/TEAM_ID/projects/PROJECT_ID \ -d '{"permission":"read"}'

Response

Status: 204

Remove a project from a team (Legacy)

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 project from a team endpoint.

Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have read access to both the team and project, or admin access to the team or project. Note: This endpoint removes the project from the team, but does not delete it.

Parâmetros para "Remove a project from a team (Legacy)"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
team_id integer Obrigatório

The unique identifier of the team.

project_id integer Obrigatório

The unique identifier of the project.

Códigos de status de resposta HTTP para "Remove a project from a team (Legacy)"

Código de statusDescrição
204

No Content

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Exemplos de código para "Remove a project from a team (Legacy)"

Exemplo de solicitação

delete/teams/{team_id}/projects/{project_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/teams/TEAM_ID/projects/PROJECT_ID

Response

Status: 204

List team repositories (Legacy)

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 team repositories endpoint.

Parâmetros para "List team repositories (Legacy)"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
team_id integer Obrigatório

The unique identifier of the team.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Padrão: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Padrão: 1

Códigos de status de resposta HTTP para "List team repositories (Legacy)"

Código de statusDescrição
200

OK

404

Resource not found

Exemplos de código para "List team repositories (Legacy)"

Exemplo de solicitação

get/teams/{team_id}/repos
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/teams/TEAM_ID/repos

Response

Status: 200
[ { "id": 1296269, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", "name": "Hello-World", "full_name": "octocat/Hello-World", "owner": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "private": false, "html_url": "https://github.com/octocat/Hello-World", "description": "This your first repo!", "fork": false, "url": "https://api.github.com/repos/octocat/Hello-World", "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}", "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}", "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}", "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}", "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}", "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}", "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}", "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}", "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}", "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors", "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments", "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads", "events_url": "https://api.github.com/repos/octocat/Hello-World/events", "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks", "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}", "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}", "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}", "git_url": "git:github.com/octocat/Hello-World.git", "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}", "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}", "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}", "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}", "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}", "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages", "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges", "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}", "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}", "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}", "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}", "ssh_url": "git@github.com:octocat/Hello-World.git", "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers", "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}", "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers", "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription", "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags", "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams", "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}", "clone_url": "https://github.com/octocat/Hello-World.git", "mirror_url": "git:git.example.com/octocat/Hello-World", "hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks", "svn_url": "https://svn.github.com/octocat/Hello-World", "homepage": "https://github.com", "language": null, "forks_count": 9, "stargazers_count": 80, "watchers_count": 80, "size": 108, "default_branch": "master", "open_issues_count": 0, "is_template": false, "topics": [ "octocat", "atom", "electron", "api" ], "has_issues": true, "has_projects": true, "has_wiki": true, "has_pages": false, "has_downloads": true, "has_discussions": false, "archived": false, "disabled": false, "visibility": "public", "pushed_at": "2011-01-26T19:06:43Z", "created_at": "2011-01-26T19:01:12Z", "updated_at": "2011-01-26T19:14:43Z", "permissions": { "admin": false, "push": false, "pull": true }, "security_and_analysis": { "advanced_security": { "status": "enabled" }, "secret_scanning": { "status": "enabled" }, "secret_scanning_push_protection": { "status": "disabled" }, "secret_scanning_validity_checks": { "status": "disabled" } } } ]

Check team permissions for a repository (Legacy)

Note: Repositories inherited through a parent team will also be checked.

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 Check team permissions for a repository endpoint.

You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom media type via the Accept header:

Parâmetros para "Check team permissions for a repository (Legacy)"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
team_id integer Obrigatório

The unique identifier of the team.

owner string Obrigatório

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

repo string Obrigatório

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

Códigos de status de resposta HTTP para "Check team permissions for a repository (Legacy)"

Código de statusDescrição
200

Alternative response with extra repository information

204

Response if repository is managed by this team

404

Not Found if repository is not managed by this team

Exemplos de código para "Check team permissions for a repository (Legacy)"

Exemplo de solicitação

get/teams/{team_id}/repos/{owner}/{repo}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/teams/TEAM_ID/repos/OWNER/REPO

Alternative response with extra repository information

Status: 200
{ "id": 1296269, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", "name": "Hello-World", "full_name": "octocat/Hello-World", "owner": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "private": false, "html_url": "https://github.com/octocat/Hello-World", "description": "This your first repo!", "fork": false, "url": "https://api.github.com/repos/octocat/Hello-World", "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}", "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}", "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}", "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}", "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}", "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}", "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}", "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}", "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}", "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors", "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments", "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads", "events_url": "https://api.github.com/repos/octocat/Hello-World/events", "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks", "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}", "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}", "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}", "git_url": "git:github.com/octocat/Hello-World.git", "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}", "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}", "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}", "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}", "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}", "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages", "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges", "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}", "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}", "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}", "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}", "ssh_url": "git@github.com:octocat/Hello-World.git", "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers", "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}", "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers", "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription", "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags", "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams", "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}", "clone_url": "https://github.com/octocat/Hello-World.git", "mirror_url": "git:git.example.com/octocat/Hello-World", "hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks", "svn_url": "https://svn.github.com/octocat/Hello-World", "homepage": "https://github.com", "language": null, "forks_count": 9, "stargazers_count": 80, "watchers_count": 80, "size": 108, "default_branch": "master", "open_issues_count": 0, "is_template": false, "topics": [ "octocat", "atom", "electron", "api" ], "has_issues": true, "has_projects": true, "has_wiki": true, "has_pages": false, "has_downloads": true, "archived": false, "disabled": false, "visibility": "public", "pushed_at": "2011-01-26T19:06:43Z", "created_at": "2011-01-26T19:01:12Z", "updated_at": "2011-01-26T19:14:43Z", "permissions": { "admin": false, "maintain": false, "push": false, "triage": false, "pull": true }, "role_name": "read", "allow_rebase_merge": true, "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O", "allow_squash_merge": true, "allow_auto_merge": false, "delete_branch_on_merge": true, "allow_merge_commit": true, "subscribers_count": 42, "network_count": 0, "license": { "key": "mit", "name": "MIT License", "url": "https://api.github.com/licenses/mit", "spdx_id": "MIT", "node_id": "MDc6TGljZW5zZW1pdA==", "html_url": "https://api.github.com/licenses/mit" }, "forks": 1, "open_issues": 1, "watchers": 1 }

Add or update team repository permissions (Legacy)

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 method."

Parâmetros para "Add or update team repository permissions (Legacy)"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
team_id integer Obrigatório

The unique identifier of the team.

owner string Obrigatório

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

repo string Obrigatório

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

Parâmetros do corpo
Nome, Tipo, Descrição
permission string

The permission to grant the team on 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.

Pode ser um dos: pull, push, admin

Códigos de status de resposta HTTP para "Add or update team repository permissions (Legacy)"

Código de statusDescrição
204

No Content

403

Forbidden

422

Validation failed, or the endpoint has been spammed.

Exemplos de código para "Add or update team repository permissions (Legacy)"

Exemplo de solicitação

put/teams/{team_id}/repos/{owner}/{repo}
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/teams/TEAM_ID/repos/OWNER/REPO \ -d '{"permission":"push"}'

Response

Status: 204

Remove a repository from a team (Legacy)

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.

Parâmetros para "Remove a repository from a team (Legacy)"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
team_id integer Obrigatório

The unique identifier of the team.

owner string Obrigatório

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

repo string Obrigatório

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

Códigos de status de resposta HTTP para "Remove a repository from a team (Legacy)"

Código de statusDescrição
204

No Content

Exemplos de código para "Remove a repository from a team (Legacy)"

Exemplo de solicitação

delete/teams/{team_id}/repos/{owner}/{repo}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/teams/TEAM_ID/repos/OWNER/REPO

Response

Status: 204

List child teams (Legacy)

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.

Parâmetros para "List child teams (Legacy)"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
team_id integer Obrigatório

The unique identifier of the team.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Padrão: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Padrão: 1

Códigos de status de resposta HTTP para "List child teams (Legacy)"

Código de statusDescrição
200

if child teams exist

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Exemplos de código para "List child teams (Legacy)"

Exemplo de solicitação

get/teams/{team_id}/teams
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/teams/TEAM_ID/teams

if child teams exist

Status: 200
[ { "id": 2, "node_id": "MDQ6VGVhbTI=", "url": "https://api.github.com/teams/2", "name": "Original Roster", "slug": "original-roster", "description": "Started it all.", "privacy": "closed", "notification_setting": "notifications_enabled", "permission": "admin", "members_url": "https://api.github.com/teams/2/members{/member}", "repositories_url": "https://api.github.com/teams/2/repos", "parent": { "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", "notification_setting": "notifications_enabled", "permission": "admin", "members_url": "https://api.github.com/teams/1/members{/member}", "repositories_url": "https://api.github.com/teams/1/repos" }, "html_url": "https://github.com/orgs/rails/teams/core" } ]

List teams for the authenticated user

List all of the teams across all of the organizations to which the authenticated user belongs.

OAuth app tokens and personal access tokens (classic) need the user, repo, or read:org scope to use this endpoint.

When using a fine-grained personal access token, the resource owner of the token must be a single organization, and the response will only include the teams from that organization.

Tokens de acesso refinados para "List teams for the authenticated user"

Esse ponto de extremidade funciona com os seguintes tipos de token:

O token não requer permissões.

Parâmetros para "List teams for the authenticated user"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Padrão: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Padrão: 1

Códigos de status de resposta HTTP para "List teams for the authenticated user"

Código de statusDescrição
200

OK

304

Not modified

403

Forbidden

404

Resource not found

Exemplos de código para "List teams for the authenticated user"

Exemplo de solicitação

get/user/teams
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/user/teams

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", "notification_setting": "notifications_enabled", "permission": "admin", "members_url": "https://api.github.com/teams/1/members{/member}", "repositories_url": "https://api.github.com/teams/1/repos", "parent": null, "members_count": 3, "repos_count": 10, "created_at": "2017-07-14T16:53:42Z", "updated_at": "2017-08-17T12:37:15Z", "organization": { "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "repos_url": "https://api.github.com/orgs/github/repos", "events_url": "https://api.github.com/orgs/github/events", "hooks_url": "https://api.github.com/orgs/github/hooks", "issues_url": "https://api.github.com/orgs/github/issues", "members_url": "https://api.github.com/orgs/github/members{/member}", "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "description": "A great organization", "name": "github", "company": "GitHub", "blog": "https://github.com/blog", "location": "San Francisco", "email": "octocat@github.com", "is_verified": true, "has_organization_projects": true, "has_repository_projects": true, "public_repos": 2, "public_gists": 1, "followers": 20, "following": 0, "html_url": "https://github.com/octocat", "created_at": "2008-01-14T04:33:35Z", "updated_at": "2017-08-17T12:37:15Z", "type": "Organization" } } ]