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 Autorisieren eines personal access tokens für die Verwendung mit einer SAML-SSO-Organisation.
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 organization with managed users findest du unter Externe Gruppen.
List IdP groups for an organization
Lists IdP groups available in an organization.
Parameters
Headers |
---|
Name, Type, BESCHREIBUNG |
accept stringSetting to |
Path parameters |
Name, Type, BESCHREIBUNG |
org stringRequiredThe organization name. The name is not case sensitive. |
Query parameters |
Name, Type, BESCHREIBUNG |
per_page integerThe number of results per page (max 100). Default: |
page stringPage token |
q stringFilters the results to return only those that begin with the value specified by this parameter. For example, a value of |
HTTP response status codes
Status code | BESCHREIBUNG |
---|---|
200 | OK |
Code samples
curl \
-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
.
Parameters
Headers |
---|
Name, Type, BESCHREIBUNG |
accept stringSetting to |
Path parameters |
Name, Type, BESCHREIBUNG |
org stringRequiredThe organization name. The name is not case sensitive. |
team_slug stringRequiredThe slug of the team name. |
HTTP response status codes
Status code | BESCHREIBUNG |
---|---|
200 | OK |
Code samples
curl \
-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
.
Parameters
Headers | |||||||
---|---|---|---|---|---|---|---|
Name, Type, BESCHREIBUNG | |||||||
accept stringSetting to | |||||||
Path parameters | |||||||
Name, Type, BESCHREIBUNG | |||||||
org stringRequiredThe organization name. The name is not case sensitive. | |||||||
team_slug stringRequiredThe slug of the team name. | |||||||
Body parameters | |||||||
Name, Type, BESCHREIBUNG | |||||||
groups array of objectsThe IdP groups you want to connect to a GitHub team. When updating, the new | |||||||
Properties of |
Name, Type, BESCHREIBUNG |
---|
group_id stringRequiredID of the IdP group. |
group_name stringRequiredName of the IdP group. |
group_description stringRequiredDescription of the IdP group. |
HTTP response status codes
Status code | BESCHREIBUNG |
---|---|
200 | OK |
Code samples
curl \
-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)
Deprecation Notice: This endpoint route is deprecated 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.
Parameters
Headers |
---|
Name, Type, BESCHREIBUNG |
accept stringSetting to |
Path parameters |
Name, Type, BESCHREIBUNG |
team_id integerRequiredThe unique identifier of the team. |
HTTP response status codes
Status code | BESCHREIBUNG |
---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
Code samples
curl \
-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)
Deprecation Notice: This endpoint route is deprecated 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.
Parameters
Headers | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Name, Type, BESCHREIBUNG | ||||||||||
accept stringSetting to | ||||||||||
Path parameters | ||||||||||
Name, Type, BESCHREIBUNG | ||||||||||
team_id integerRequiredThe unique identifier of the team. | ||||||||||
Body parameters | ||||||||||
Name, Type, BESCHREIBUNG | ||||||||||
groups array of objectsRequiredThe IdP groups you want to connect to a GitHub team. When updating, the new | ||||||||||
Properties of |
Name, Type, BESCHREIBUNG |
---|
group_id stringRequiredID of the IdP group. |
group_name stringRequiredName of the IdP group. |
group_description stringRequiredDescription of the IdP group. |
id string |
name string |
description string |
synced_at
stringHTTP response status codes
Status code | BESCHREIBUNG |
---|---|
200 | OK |
403 | Forbidden |
422 | Validation failed, or the endpoint has been spammed. |
Code samples
curl \
-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."
}
]
}