Skip to main content

Enterprise Server 3.21 está disponível no momento como versão candidata a lançamento.

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

Endpoints da API REST para membros das equipes empresariais

Utilize a API REST para criar e gerenciar a participação de equipes da empresa em sua GitHub empresa.

Sobre os membros da equipe corporativa

Observação

Esses pontos de extremidade estão em 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 members in an enterprise team

Lists all team members in an enterprise team.

Fine-grained access tokens for "List members in an enterprise team"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Enterprise teams" enterprise permissions (read)

Parâmetros para "List members in 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.

enterprise-team string Obrigatório

The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.

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

HTTP response status codes for "List members in an enterprise team"

Status codeDescrição
200

OK

Code samples for "List members in an enterprise team"

Request example

get/enterprises/{enterprise}/teams/{enterprise-team}/memberships
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/memberships

Response

Status: 200
[ { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://HOSTNAME/users/octocat/followers", "following_url": "https://HOSTNAME/users/octocat/following{/other_user}", "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}", "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions", "organizations_url": "https://HOSTNAME/users/octocat/orgs", "repos_url": "https://HOSTNAME/users/octocat/repos", "events_url": "https://HOSTNAME/users/octocat/events{/privacy}", "received_events_url": "https://HOSTNAME/users/octocat/received_events", "type": "User", "site_admin": false } ]

Bulk add team members

Add multiple team members to an enterprise team.

Fine-grained access tokens for "Bulk add team members"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Enterprise teams" enterprise permissions (write)

Parâmetros para "Bulk add team members"

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.

enterprise-team string Obrigatório

The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.

Parâmetros do corpo
Nome, Tipo, Descrição
usernames array of strings Obrigatório

The GitHub user handles to add to the team.

HTTP response status codes for "Bulk add team members"

Status codeDescrição
200

Successfully added team members.

Code samples for "Bulk add team members"

Request example

post/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/memberships/add \ -d '{"usernames":["monalisa","octocat"]}'

Successfully added team members.

Status: 200
[ { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://HOSTNAME/users/octocat/followers", "following_url": "https://HOSTNAME/users/octocat/following{/other_user}", "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}", "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions", "organizations_url": "https://HOSTNAME/users/octocat/orgs", "repos_url": "https://HOSTNAME/users/octocat/repos", "events_url": "https://HOSTNAME/users/octocat/events{/privacy}", "received_events_url": "https://HOSTNAME/users/octocat/received_events", "type": "User", "site_admin": false } ]

Bulk remove team members

Remove multiple team members from an enterprise team.

Fine-grained access tokens for "Bulk remove team members"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Enterprise teams" enterprise permissions (write)

Parâmetros para "Bulk remove team members"

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.

enterprise-team string Obrigatório

The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.

Parâmetros do corpo
Nome, Tipo, Descrição
usernames array of strings Obrigatório

The GitHub user handles to be removed from the team.

HTTP response status codes for "Bulk remove team members"

Status codeDescrição
200

Successfully removed team members.

Code samples for "Bulk remove team members"

Request example

post/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/memberships/remove \ -d '{"usernames":["monalisa","octocat"]}'

Successfully removed team members.

Status: 200
[ { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://HOSTNAME/users/octocat/followers", "following_url": "https://HOSTNAME/users/octocat/following{/other_user}", "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}", "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions", "organizations_url": "https://HOSTNAME/users/octocat/orgs", "repos_url": "https://HOSTNAME/users/octocat/repos", "events_url": "https://HOSTNAME/users/octocat/events{/privacy}", "received_events_url": "https://HOSTNAME/users/octocat/received_events", "type": "User", "site_admin": false } ]

Add team member

Add a team member to an enterprise team.

Fine-grained access tokens for "Add team member"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Enterprise teams" enterprise permissions (write)

Parâmetros para "Add team member"

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.

enterprise-team string Obrigatório

The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.

username string Obrigatório

The handle for the GitHub user account.

HTTP response status codes for "Add team member"

Status codeDescrição
201

Successfully added team member

Code samples for "Add team member"

Request example

put/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/memberships/USERNAME

Successfully added team member

Status: 201
{ "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://HOSTNAME/users/octocat/followers", "following_url": "https://HOSTNAME/users/octocat/following{/other_user}", "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}", "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions", "organizations_url": "https://HOSTNAME/users/octocat/orgs", "repos_url": "https://HOSTNAME/users/octocat/repos", "events_url": "https://HOSTNAME/users/octocat/events{/privacy}", "received_events_url": "https://HOSTNAME/users/octocat/received_events", "type": "User", "site_admin": false }

Remove team membership

Remove membership of a specific user from a particular team in an enterprise.

Fine-grained access tokens for "Remove team membership"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Enterprise teams" enterprise permissions (write)

Parâmetros para "Remove team membership"

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.

enterprise-team string Obrigatório

The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.

username string Obrigatório

The handle for the GitHub user account.

HTTP response status codes for "Remove team membership"

Status codeDescrição
204

No Content

403

Forbidden

Code samples for "Remove team membership"

Request example

delete/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/memberships/USERNAME

Response

Status: 204