Pontos de extremidade da API REST para organizações de equipes empresariais
Use a API REST para criar e gerenciar atribuições de organização para equipes empresariais em sua empresa GitHub enterprise.
Sobre organizações de 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:.
Get organization assignments
Get all organizations assigned to an enterprise team
Fine-grained access tokens for "Get organization assignments"
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 "Get organization assignments"
| Nome, Tipo, Descrição |
|---|
accept string Setting to |
| Nome, Tipo, Descrição |
|---|
enterprise string ObrigatórioThe slug version of the enterprise name. |
enterprise-team string ObrigatórioThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
| 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: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Padrão: |
HTTP response status codes for "Get organization assignments"
| Status code | Descrição |
|---|---|
200 | An array of organizations the team is assigned to |
Code samples for "Get organization assignments"
Request example
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/organizationsAn array of organizations the team is assigned to
Status: 200{
"login": "github",
"id": 1,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
"url": "https://HOSTNAME/orgs/github",
"repos_url": "https://HOSTNAME/orgs/github/repos",
"events_url": "https://HOSTNAME/orgs/github/events",
"hooks_url": "https://HOSTNAME/orgs/github/hooks",
"issues_url": "https://HOSTNAME/orgs/github/issues",
"members_url": "https://HOSTNAME/orgs/github/members{/member}",
"public_members_url": "https://HOSTNAME/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization"
}Add organization assignments
Assign an enterprise team to multiple organizations.
Fine-grained access tokens for "Add organization assignments"
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 organization assignments"
| Nome, Tipo, Descrição |
|---|
accept string Setting to |
| Nome, Tipo, Descrição |
|---|
enterprise string ObrigatórioThe slug version of the enterprise name. |
enterprise-team string ObrigatórioThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
| Nome, Tipo, Descrição |
|---|
organization_slugs array of strings ObrigatórioOrganization slug to assign the team to. |
HTTP response status codes for "Add organization assignments"
| Status code | Descrição |
|---|---|
200 | Successfully assigned the enterprise team to organizations. |
Code samples for "Add organization assignments"
Request example
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/organizations/add \
-d '{"organization_slugs":["github"]}'Successfully assigned the enterprise team to organizations.
Status: 200[
{
"login": "github",
"id": 1,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
"url": "https://HOSTNAME/orgs/github",
"repos_url": "https://HOSTNAME/orgs/github/repos",
"events_url": "https://HOSTNAME/orgs/github/events",
"hooks_url": "https://HOSTNAME/orgs/github/hooks",
"issues_url": "https://HOSTNAME/orgs/github/issues",
"members_url": "https://HOSTNAME/orgs/github/members{/member}",
"public_members_url": "https://HOSTNAME/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization"
}
]Remove organization assignments
Unassign an enterprise team from multiple organizations.
Fine-grained access tokens for "Remove organization assignments"
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 organization assignments"
| Nome, Tipo, Descrição |
|---|
accept string Setting to |
| Nome, Tipo, Descrição |
|---|
enterprise string ObrigatórioThe slug version of the enterprise name. |
enterprise-team string ObrigatórioThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
| Nome, Tipo, Descrição |
|---|
organization_slugs array of strings ObrigatórioOrganization slug to unassign the team from. |
HTTP response status codes for "Remove organization assignments"
| Status code | Descrição |
|---|---|
204 | Successfully unassigned the enterprise team from organizations. |
Code samples for "Remove organization assignments"
Request example
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/organizations/remove \
-d '{"organization_slugs":["github"]}'Successfully unassigned the enterprise team from organizations.
Status: 204Get organization assignment
Check if an enterprise team is assigned to an organization
Fine-grained access tokens for "Get organization assignment"
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 "Get organization assignment"
| Nome, Tipo, Descrição |
|---|
accept string Setting to |
| Nome, Tipo, Descrição |
|---|
enterprise string ObrigatórioThe slug version of the enterprise name. |
enterprise-team string ObrigatórioThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
org string ObrigatórioThe organization name. The name is not case sensitive. |
HTTP response status codes for "Get organization assignment"
| Status code | Descrição |
|---|---|
200 | The team is assigned to the organization |
404 | The team is not assigned to the organization |
Code samples for "Get organization assignment"
Request example
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/organizations/ORGThe team is assigned to the organization
Status: 200{
"login": "github",
"id": 1,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
"url": "https://HOSTNAME/orgs/github",
"repos_url": "https://HOSTNAME/orgs/github/repos",
"events_url": "https://HOSTNAME/orgs/github/events",
"hooks_url": "https://HOSTNAME/orgs/github/hooks",
"issues_url": "https://HOSTNAME/orgs/github/issues",
"members_url": "https://HOSTNAME/orgs/github/members{/member}",
"public_members_url": "https://HOSTNAME/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization"
}Add an organization assignment
Assign an enterprise team to an organization.
Fine-grained access tokens for "Add an organization assignment"
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 an organization assignment"
| Nome, Tipo, Descrição |
|---|
accept string Setting to |
| Nome, Tipo, Descrição |
|---|
enterprise string ObrigatórioThe slug version of the enterprise name. |
enterprise-team string ObrigatórioThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
org string ObrigatórioThe organization name. The name is not case sensitive. |
HTTP response status codes for "Add an organization assignment"
| Status code | Descrição |
|---|---|
201 | Successfully assigned the enterprise team to the organization. |
Code samples for "Add an organization assignment"
Request example
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/organizations/ORGSuccessfully assigned the enterprise team to the organization.
Status: 201{
"login": "github",
"id": 1,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
"url": "https://HOSTNAME/orgs/github",
"repos_url": "https://HOSTNAME/orgs/github/repos",
"events_url": "https://HOSTNAME/orgs/github/events",
"hooks_url": "https://HOSTNAME/orgs/github/hooks",
"issues_url": "https://HOSTNAME/orgs/github/issues",
"members_url": "https://HOSTNAME/orgs/github/members{/member}",
"public_members_url": "https://HOSTNAME/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization"
}Delete an organization assignment
Unassign an enterprise team from an organization.
Fine-grained access tokens for "Delete an organization assignment"
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 "Delete an organization assignment"
| Nome, Tipo, Descrição |
|---|
accept string Setting to |
| Nome, Tipo, Descrição |
|---|
enterprise string ObrigatórioThe slug version of the enterprise name. |
enterprise-team string ObrigatórioThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
org string ObrigatórioThe organization name. The name is not case sensitive. |
HTTP response status codes for "Delete an organization assignment"
| Status code | Descrição |
|---|---|
204 | Successfully unassigned the enterprise team from the organization. |
Code samples for "Delete an organization assignment"
Request example
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/organizations/ORGSuccessfully unassigned the enterprise team from the organization.
Status: 204