Points de terminaison d’API REST pour la synchronisation d’équipe
Utilisez l’API REST pour gérer les connexions entre les équipes GitHub Enterprise Cloud et les groupes de fournisseurs d’identité externes.
À propos de la synchronisation d’équipe
Pour utiliser ces points de terminaison, l’utilisateur authentifié doit être un responsable d’équipe ou un propriétaire de l’organisation associée à l’équipe. Le jeton que vous utilisez pour l’authentification doit également être autorisé à être utilisé avec votre fournisseur d’identité (SSO). Pour plus d’informations, consultez « Autorisation d’un jeton d’accès personnel à utiliser avec l’authentification unique SAML ».
Vous pouvez gérer les membres de l’équipe GitHub Enterprise Cloud via votre fournisseur d’identité avec la synchronisation d’équipe. La synchronisation d’équipe doit être activée pour utiliser ces points de terminaison. Pour plus d’informations, consultez « Gestion de la synchronisation des équipes pour votre organisation ».
Remarque : Ces points de terminaison ne peuvent pas être utilisés avec Enterprise Managed Users. Pour en savoir plus sur la gestion d’une organisation avec utilisateurs managés, consultez « Points de terminaison d’API REST pour les groupes externes ».
List IdP groups for an organization
Lists IdP groups available in an organization.
Jetons d’accès affinés pour « List IdP groups for an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Members" organization permissions (write)
Paramètres pour « List IdP groups for an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
Nom, Type, Description |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Default: |
page string Page token |
q string Filters the results to return only those that begin with the value specified by this parameter. For example, a value of |
Codes d’état de la réponse HTTP pour « List IdP groups for an organization »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « List IdP groups for an organization »
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Exemple de requête
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/team-sync/groups
Response
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
},
{
"group_id": "456",
"group_name": "Octocat docs members",
"group_description": "The people who make your octoworld come to life."
}
]
}
List IdP groups for a team
List IdP groups connected to a team on GitHub Enterprise Cloud.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
Note
You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/team-sync/group-mappings
.
Paramètres pour « List IdP groups for a team »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
team_slug string ObligatoireThe slug of the team name. |
Codes d’état de la réponse HTTP pour « List IdP groups for a team »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « List IdP groups for a team »
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Exemple de requête
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/team-sync/group-mappings
Response
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
},
{
"group_id": "456",
"group_name": "Octocat docs members",
"group_description": "The people who make your octoworld come to life."
}
]
}
Create or update IdP group connections
Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty groups
array will remove all connections for a team.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
Note
You can also specify a team by org_id
and team_id
using the route PATCH /organizations/{org_id}/team/{team_id}/team-sync/group-mappings
.
Paramètres pour « Create or update IdP group connections »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
team_slug string ObligatoireThe slug of the team name. |
Nom, Type, Description | ||||
---|---|---|---|---|
groups array of objects The IdP groups you want to connect to a GitHub team. When updating, the new | ||||
Properties of |
Nom, Type, Description |
---|
group_id string ObligatoireID of the IdP group. |
group_name string ObligatoireName of the IdP group. |
group_description string ObligatoireDescription of the IdP group. |
Codes d’état de la réponse HTTP pour « Create or update IdP group connections »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Create or update IdP group connections »
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Exemple de requête
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/team-sync/group-mappings \
-d '{"groups":[{"group_id":"123","group_name":"Octocat admins","group_description":"string"}]}'
Response
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
},
{
"group_id": "456",
"group_name": "Octocat docs members",
"group_description": "The people who make your octoworld come to life."
}
]
}
List IdP groups for a team (Legacy)
Warning
Endpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new List IdP groups for a team
endpoint.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
List IdP groups connected to a team on GitHub Enterprise Cloud.
Paramètres pour « List IdP groups for a team (Legacy) »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
team_id integer ObligatoireThe unique identifier of the team. |
Codes d’état de la réponse HTTP pour « List IdP groups for a team (Legacy) »
Code d’état | Description |
---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « List IdP groups for a team (Legacy) »
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Exemple de requête
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/team-sync/group-mappings
Response
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
},
{
"group_id": "456",
"group_name": "Octocat docs members",
"group_description": "The people who make your octoworld come to life."
}
]
}
Create or update IdP group connections (Legacy)
Warning
Endpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new Create or update IdP group connections
endpoint.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty groups
array will remove all connections for a team.
Paramètres pour « Create or update IdP group connections (Legacy) »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
team_id integer ObligatoireThe unique identifier of the team. |
Nom, Type, Description | |||||||
---|---|---|---|---|---|---|---|
groups array of objects ObligatoireThe IdP groups you want to connect to a GitHub team. When updating, the new | |||||||
Properties of |
Nom, Type, Description |
---|
group_id string ObligatoireID of the IdP group. |
group_name string ObligatoireName of the IdP group. |
group_description string ObligatoireDescription of the IdP group. |
id string |
name string |
description string |
synced_at
string Codes d’état de la réponse HTTP pour « Create or update IdP group connections (Legacy) »
Code d’état | Description |
---|---|
200 | OK |
403 | Forbidden |
422 | Validation failed, or the endpoint has been spammed. |
Exemples de code pour « Create or update IdP group connections (Legacy) »
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Exemple de requête
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/team-sync/group-mappings \
-d '{"groups":[{"group_id":"123","group_name":"Octocat admins","description":"The people who configure your octoworld.","group_description":"string"}]}'
Response
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
}
]
}