Skip to main content
A API REST agora é versionada. Para obter mais informações, confira "Sobre o controle de versão da API".

Endpoints da API REST para equipes empresariais

Use a API REST para criar e gerenciar equipes corporativas em sua empresa do GitHub.

Sobre as equipes corporativas

Observação

Esses pontos de extremidade estão em versão prévia pública e estão sujeitos a alterações.

Esta documentação de API é para empresas no GitHub Enterprise Cloud.

Se sua empresa for do Copilot Business para não GHE, consulte o link da documentação de acesso antecipado que foi compartilhado com você.

Esses pontos de extremidade só estão disponíveis para membros autenticados da equipe corporativa com o personal access tokens clássico com o escopo read:enterprise para APIs do GET e admin:enterprise para outras APIs.

Esses pontos de extremidade não são compatíveis com fine-grained personal access tokens ou tokens de acesso do Aplicativo GitHub.

O GitHub gera o slug da equipe corporativa com base no name da equipe e adiciona o prefixo ent:.

List enterprise teams

List all teams in the enterprise for the authenticated user

Tokens de acesso granular para "List enterprise teams"

Este endpoint funciona com os seguintes tipos de token granulares:

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

  • "Enterprise teams" enterprise permissions (read)

Parâmetros para "List enterprise 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
enterprise string Obrigatório

The slug version of the enterprise 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 enterprise teams"

Código de statusDescrição
200

OK

403

Forbidden

Exemplos de código para "List enterprise teams"

Exemplo de solicitação

get/enterprises/{enterprise}/teams
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/teams

Response

Status: 200
[ { "id": 1, "name": "Justice League", "description": "A great team.", "slug": "justice-league", "url": "https://api.github.com/enterprises/dc/teams/justice-league", "group_id": "62ab9291-fae2-468e-974b-7e45096d5021", "html_url": "https://github.com/enterprises/dc/teams/justice-league", "members_url": "https://api.github.com/enterprises/dc/teams/justice-league/members{/member}", "created_at": "2019-01-26T19:01:12Z", "updated_at": "2019-01-26T19:14:43Z" } ]

Create an enterprise team

To create an enterprise team, the authenticated user must be an owner of the enterprise.

Tokens de acesso granular para "Create an enterprise team"

Este endpoint funciona com os seguintes tipos de token granulares:

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

  • "Enterprise teams" enterprise permissions (write)

Parâmetros para "Create an enterprise 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
enterprise string Obrigatório

The slug version of the enterprise name.

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

The name of the team.

description string or null

A description of the team.

sync_to_organizations string

Retired: this field is no longer supported. Whether the enterprise team should be reflected in each organization. This value cannot be set.

Padrão: disabled

Pode ser um dos: all, disabled

organization_selection_type string

Specifies which organizations in the enterprise should have access to this team. Can be one of disabled, selected, or all. disabled: The team is not assigned to any organizations. This is the default when you create a new team. selected: The team is assigned to specific organizations. You can then use the add organization assignments API endpoint. all: The team is assigned to all current and future organizations in the enterprise.

Padrão: disabled

Pode ser um dos: disabled, selected, all

group_id string or null

The ID of the IdP group to assign team membership with. You can get this value from the REST API endpoints for SCIM.

Códigos de status de resposta HTTP para "Create an enterprise team"

Código de statusDescrição
201

Created

Exemplos de código para "Create an enterprise team"

Exemplo de solicitação

post/enterprises/{enterprise}/teams
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/teams \ -d '{"name":"Justice League","description":"A great team.","group_id":"62ab9291-fae2-468e-974b-7e45096d5021"}'

Response

Status: 201
{ "id": 1, "name": "Justice League", "description": "A great team.", "slug": "justice-league", "url": "https://api.github.com/enterprises/dc/teams/justice-league", "group_id": "62ab9291-fae2-468e-974b-7e45096d5021", "html_url": "https://github.com/enterprises/dc/teams/justice-league", "members_url": "https://api.github.com/enterprises/dc/teams/justice-league/members{/member}", "created_at": "2019-01-26T19:01:12Z", "updated_at": "2019-01-26T19:14:43Z" }

Get an enterprise team

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

Tokens de acesso granular para "Get an enterprise team"

Este endpoint funciona com os seguintes tipos de token granulares:

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

  • "Enterprise teams" enterprise permissions (read)

Parâmetros para "Get an enterprise 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
enterprise string Obrigatório

The slug version of the enterprise name.

team_slug string Obrigatório

The slug of the team name.

Códigos de status de resposta HTTP para "Get an enterprise team"

Código de statusDescrição
200

OK

403

Forbidden

Exemplos de código para "Get an enterprise team"

Exemplo de solicitação

get/enterprises/{enterprise}/teams/{team_slug}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/teams/TEAM_SLUG

Response

Status: 200
{ "id": 1, "name": "Justice League", "description": "A great team.", "slug": "justice-league", "url": "https://api.github.com/enterprises/dc/teams/justice-league", "group_id": "62ab9291-fae2-468e-974b-7e45096d5021", "html_url": "https://github.com/enterprises/dc/teams/justice-league", "members_url": "https://api.github.com/enterprises/dc/teams/justice-league/members{/member}", "created_at": "2019-01-26T19:01:12Z", "updated_at": "2019-01-26T19:14:43Z" }

Update an enterprise team

To edit a team, the authenticated user must be an enterprise owner.

Tokens de acesso granular para "Update an enterprise team"

Este endpoint funciona com os seguintes tipos de token granulares:

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

  • "Enterprise teams" enterprise permissions (write)

Parâmetros para "Update an enterprise 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
enterprise string Obrigatório

The slug version of the enterprise name.

team_slug string Obrigatório

The slug of the team name.

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

A new name for the team.

description string or null

A new description for the team.

sync_to_organizations string

Retired: this field is no longer supported. Whether the enterprise team should be reflected in each organization. This value cannot be changed.

Padrão: disabled

Pode ser um dos: all, disabled

organization_selection_type string

Specifies which organizations in the enterprise should have access to this team. Can be one of disabled, selected, or all. disabled: The team is not assigned to any organizations. This is the default when you create a new team. selected: The team is assigned to specific organizations. You can then use the add organization assignments API. all: The team is assigned to all current and future organizations in the enterprise.

Padrão: disabled

Pode ser um dos: disabled, selected, all

group_id string or null

The ID of the IdP group to assign team membership with. The new IdP group will replace the existing one, or replace existing direct members if the team isn't currently linked to an IdP group.

Códigos de status de resposta HTTP para "Update an enterprise team"

Código de statusDescrição
200

OK

403

Forbidden

Exemplos de código para "Update an enterprise team"

Exemplo de solicitação

patch/enterprises/{enterprise}/teams/{team_slug}
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/teams/TEAM_SLUG \ -d '{"name":"Justice League","description":"A great team.","group_id":"62ab9291-fae2-468e-974b-7e45096d5021"}'

Response

Status: 200
{ "id": 1, "name": "Justice League", "description": "A great team.", "slug": "justice-league", "url": "https://api.github.com/enterprises/dc/teams/justice-league", "group_id": "62ab9291-fae2-468e-974b-7e45096d5021", "html_url": "https://github.com/enterprises/dc/teams/justice-league", "members_url": "https://api.github.com/enterprises/dc/teams/justice-league/members{/member}", "created_at": "2019-01-26T19:01:12Z", "updated_at": "2019-01-26T19:14:43Z" }

Delete an enterprise team

To delete an enterprise team, the authenticated user must be an enterprise owner.

If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well.

Tokens de acesso granular para "Delete an enterprise team"

Este endpoint funciona com os seguintes tipos de token granulares:

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

  • "Enterprise teams" enterprise permissions (write)

Parâmetros para "Delete an enterprise 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
enterprise string Obrigatório

The slug version of the enterprise name.

team_slug string Obrigatório

The slug of the team name.

Códigos de status de resposta HTTP para "Delete an enterprise team"

Código de statusDescrição
204

No Content

403

Forbidden

Exemplos de código para "Delete an enterprise team"

Exemplo de solicitação

delete/enterprises/{enterprise}/teams/{team_slug}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/teams/TEAM_SLUG

Response

Status: 204