REST-API-Endpunkte für die Teamsynchronisierung
Mit der REST-API kannst du Verbindungen zwischen GitHub Enterprise Cloud-Teams und externen Identitätsanbietergruppen verwalten.
Informationen zur Teamsynchronisierung
Um diese Endpunkte verwenden zu können, müssen authentifizierte Benutzer entweder Teambetreuer oder Besitzer der Organisation sein, die dem Team zugeordnet ist. Das Token, das du zum Authentifizieren verwendest, muss auch für die Verwendung mit deinem IdP-Anbieter (SSO) autorisiert werden. Weitere Informationen findest du unter Ein persönliches Zugriffstoken für die Verwendung mit SAML Single Sign-On autorisieren.
Du kannst GitHub Enterprise Cloud-Teammitglieder über deinen Identitätsanbieter mithilfe der Teamsynchronisierung verwalten. Teamsynchronisierung muss aktiviert sein, um diese Endpunkte verwenden zu können. Weitere Informationen findest du unter Verwalten der Teamsynchronisierung für deine Organisation.
Hinweis: Diese Endpunkte können nicht gemeinsam mit Enterprise Managed Users verwendet werden. Weitere Informationen zum Verwalten einer Organisation mit verwalteten Benutzer*innen findest du unter REST-API-Endpunkte für externe Gruppen.
List IdP groups for an organization
Lists IdP groups available in an organization.
Differenzierte Zugriffstoken für "List IdP groups for an organization"
Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:
- GitHub-App-Benutzerzugriffstoken
- Zugriffstoken für GitHub App-Installation
- Differenzierte persönliche Zugriffstoken
Das differenzierte Token muss einen der folgenden Berechtigungssätze aufweisen.:
- "Members" organization permissions (write)
Parameter für „List IdP groups for an organization“
Name, type, BESCHREIBUNG |
---|
accept string Setting to |
Name, type, BESCHREIBUNG |
---|
org string ErforderlichThe organization name. The name is not case sensitive. |
Name, type, BESCHREIBUNG |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Standard: |
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 |
HTTP-Antwortstatuscodes für „List IdP groups for an organization“
Statuscode | BESCHREIBUNG |
---|---|
200 | OK |
Codebeispiele für „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
.
Anforderungsbeispiel
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
.
Parameter für „List IdP groups for a team“
Name, type, BESCHREIBUNG |
---|
accept string Setting to |
Name, type, BESCHREIBUNG |
---|
org string ErforderlichThe organization name. The name is not case sensitive. |
team_slug string ErforderlichThe slug of the team name. |
HTTP-Antwortstatuscodes für „List IdP groups for a team“
Statuscode | BESCHREIBUNG |
---|---|
200 | OK |
Codebeispiele für „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
.
Anforderungsbeispiel
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
.
Parameter für „Create or update IdP group connections“
Name, type, BESCHREIBUNG |
---|
accept string Setting to |
Name, type, BESCHREIBUNG |
---|
org string ErforderlichThe organization name. The name is not case sensitive. |
team_slug string ErforderlichThe slug of the team name. |
Name, type, BESCHREIBUNG | ||||
---|---|---|---|---|
groups array of objects The IdP groups you want to connect to a GitHub team. When updating, the new | ||||
Properties of |
Name, type, BESCHREIBUNG |
---|
group_id string ErforderlichID of the IdP group. |
group_name string ErforderlichName of the IdP group. |
group_description string ErforderlichDescription of the IdP group. |
HTTP-Antwortstatuscodes für „Create or update IdP group connections“
Statuscode | BESCHREIBUNG |
---|---|
200 | OK |
Codebeispiele für „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
.
Anforderungsbeispiel
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.
Parameter für „List IdP groups for a team (Legacy)“
Name, type, BESCHREIBUNG |
---|
accept string Setting to |
Name, type, BESCHREIBUNG |
---|
team_id integer ErforderlichThe unique identifier of the team. |
HTTP-Antwortstatuscodes für „List IdP groups for a team (Legacy)“
Statuscode | BESCHREIBUNG |
---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
Codebeispiele für „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
.
Anforderungsbeispiel
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.
Parameter für „Create or update IdP group connections (Legacy)“
Name, type, BESCHREIBUNG |
---|
accept string Setting to |
Name, type, BESCHREIBUNG |
---|
team_id integer ErforderlichThe unique identifier of the team. |
Name, type, BESCHREIBUNG | |||||||
---|---|---|---|---|---|---|---|
groups array of objects ErforderlichThe IdP groups you want to connect to a GitHub team. When updating, the new | |||||||
Properties of |
Name, type, BESCHREIBUNG |
---|
group_id string ErforderlichID of the IdP group. |
group_name string ErforderlichName of the IdP group. |
group_description string ErforderlichDescription of the IdP group. |
id string |
name string |
description string |
synced_at
string HTTP-Antwortstatuscodes für „Create or update IdP group connections (Legacy)“
Statuscode | BESCHREIBUNG |
---|---|
200 | OK |
403 | Forbidden |
422 | Validation failed, or the endpoint has been spammed. |
Codebeispiele für „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
.
Anforderungsbeispiel
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."
}
]
}