Points de terminaison d’API REST pour les organisations d’équipe d’entreprise
Utilisez l’API REST pour créer et gérer des affectations d’organisation pour les équipes d’entreprise dans votre GitHub enterprise.
À propos des organisations d’équipe d’entreprise
Remarque
Ces points de terminaison se trouvent actuellement en préversion publique et peuvent être amenés à changer.
Cette documentation API est destinée aux entreprises sur GitHub Enterprise Cloud.
Si votre entreprise utilise Copilot Business pour un environnement non-GHE, veuillez vous référer au lien de documentation en accès anticipé qui vous a été communiqué précédemment.
Ces points de terminaison ne sont disponibles que pour les membres authentifiés de l’entreprise de l’équipe d’entreprise, disposant de personal access tokens classiques avec l’étendue read:enterprise pour les API GET et admin:enterprise pour les autres API.
Ces points de terminaison ne sont pas compatibles avec fine-grained personal access tokens ni avec les jetons d’accès GitHub App.
GitHub génère le slug de l’équipe d’entreprise à partir de l’équipe name et ajoute le préfixe ent:.
Get organization assignments
Get all organizations assigned to an enterprise team
Jetons d'accès granulaires pour «Get organization assignments»
Ce point de terminaison fonctionne avec les types de tokens à granularité fine suivants:
- jetons d’accès utilisateur de l’application GitHub
- jetons d’accès d’installation de l’application GitHub
Le token à granularité fine doit disposer de l’ensemble d’autorisations suivant:
- "Enterprise teams" enterprise permissions (read)
Paramètres pour «Get organization assignments »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
enterprise string RequisThe slug version of the enterprise name. |
enterprise-team string RequisThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
| Nom, Type, Description |
|---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Par défaut: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Par défaut: |
Codes d’état de réponse HTTP pour «Get organization assignments »
| Code de statut | Description |
|---|---|
200 | An array of organizations the team is assigned to |
Exemples de code pour «Get organization assignments »
Exemple de requête
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/ENTERPRISE-TEAM/organizationsAn array of organizations the team is assigned to
Status: 200{
"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"
}Add organization assignments
Assign an enterprise team to multiple organizations.
Jetons d'accès granulaires pour «Add organization assignments»
Ce point de terminaison fonctionne avec les types de tokens à granularité fine suivants:
- jetons d’accès utilisateur de l’application GitHub
- jetons d’accès d’installation de l’application GitHub
Le token à granularité fine doit disposer de l’ensemble d’autorisations suivant:
- "Enterprise teams" enterprise permissions (write)
Paramètres pour «Add organization assignments »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
enterprise string RequisThe slug version of the enterprise name. |
enterprise-team string RequisThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
| Nom, Type, Description |
|---|
organization_slugs array of strings RequisOrganization slug to assign the team to. |
Codes d’état de réponse HTTP pour «Add organization assignments »
| Code de statut | Description |
|---|---|
200 | Successfully assigned the enterprise team to organizations. |
Exemples de code pour «Add organization assignments »
Exemple de requête
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/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://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"
}
]Remove organization assignments
Unassign an enterprise team from multiple organizations.
Jetons d'accès granulaires pour «Remove organization assignments»
Ce point de terminaison fonctionne avec les types de tokens à granularité fine suivants:
- jetons d’accès utilisateur de l’application GitHub
- jetons d’accès d’installation de l’application GitHub
Le token à granularité fine doit disposer de l’ensemble d’autorisations suivant:
- "Enterprise teams" enterprise permissions (write)
Paramètres pour «Remove organization assignments »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
enterprise string RequisThe slug version of the enterprise name. |
enterprise-team string RequisThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
| Nom, Type, Description |
|---|
organization_slugs array of strings RequisOrganization slug to unassign the team from. |
Codes d’état de réponse HTTP pour «Remove organization assignments »
| Code de statut | Description |
|---|---|
204 | Successfully unassigned the enterprise team from organizations. |
Exemples de code pour «Remove organization assignments »
Exemple de requête
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/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
Jetons d'accès granulaires pour «Get organization assignment»
Ce point de terminaison fonctionne avec les types de tokens à granularité fine suivants:
- jetons d’accès utilisateur de l’application GitHub
- jetons d’accès d’installation de l’application GitHub
Le token à granularité fine doit disposer de l’ensemble d’autorisations suivant:
- "Enterprise teams" enterprise permissions (read)
Paramètres pour «Get organization assignment »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
enterprise string RequisThe slug version of the enterprise name. |
enterprise-team string RequisThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
org string RequisThe organization name. The name is not case sensitive. |
Codes d’état de réponse HTTP pour «Get organization assignment »
| Code de statut | Description |
|---|---|
200 | The team is assigned to the organization |
404 | The team is not assigned to the organization |
Exemples de code pour «Get organization assignment »
Exemple de requête
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/ENTERPRISE-TEAM/organizations/ORGThe team is assigned to the organization
Status: 200{
"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"
}Add an organization assignment
Assign an enterprise team to an organization.
Jetons d'accès granulaires pour «Add an organization assignment»
Ce point de terminaison fonctionne avec les types de tokens à granularité fine suivants:
- jetons d’accès utilisateur de l’application GitHub
- jetons d’accès d’installation de l’application GitHub
Le token à granularité fine doit disposer de l’ensemble d’autorisations suivant:
- "Enterprise teams" enterprise permissions (write)
Paramètres pour «Add an organization assignment »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
enterprise string RequisThe slug version of the enterprise name. |
enterprise-team string RequisThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
org string RequisThe organization name. The name is not case sensitive. |
Codes d’état de réponse HTTP pour «Add an organization assignment »
| Code de statut | Description |
|---|---|
201 | Successfully assigned the enterprise team to the organization. |
Exemples de code pour «Add an organization assignment »
Exemple de requête
curl -L \
-X PUT \
-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/ENTERPRISE-TEAM/organizations/ORGSuccessfully assigned the enterprise team to the organization.
Status: 201{
"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"
}Delete an organization assignment
Unassign an enterprise team from an organization.
Jetons d'accès granulaires pour «Delete an organization assignment»
Ce point de terminaison fonctionne avec les types de tokens à granularité fine suivants:
- jetons d’accès utilisateur de l’application GitHub
- jetons d’accès d’installation de l’application GitHub
Le token à granularité fine doit disposer de l’ensemble d’autorisations suivant:
- "Enterprise teams" enterprise permissions (write)
Paramètres pour «Delete an organization assignment »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
enterprise string RequisThe slug version of the enterprise name. |
enterprise-team string RequisThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
org string RequisThe organization name. The name is not case sensitive. |
Codes d’état de réponse HTTP pour «Delete an organization assignment »
| Code de statut | Description |
|---|---|
204 | Successfully unassigned the enterprise team from the organization. |
Exemples de code pour «Delete an organization assignment »
Exemple de requête
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/ENTERPRISE-TEAM/organizations/ORGSuccessfully unassigned the enterprise team from the organization.
Status: 204