Team synchronization
- List IdP groups in an organization
- List IdP groups for a team
- Create or update IdP group connections
The Team Synchronization API allows you to manage connections between GitHub teams and external identity provider (IdP) groups. To use this API, the authenticated user must be a team maintainer or an owner of the organization associated with the team. The token you use to authenticate will also need to be authorized for use with your IdP (SSO) provider. For more information, see "Authorizing a personal access token for use with a SAML single sign-on organization" in the GitHub Help documentation.
You can manage GitHub team members through your IdP with team synchronization. Team synchronization must be enabled to use the Team Synchronization API. For more information, see "Synchronizing teams between your identity provider and GitHub" in the GitHub Help documentation.
Note: The Team Synchronization API is currently in public beta and subject to change. Azure AD is the only supported IdP for the initial public beta release.
List IdP groups in an organization
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
Note: Configuring connections between GitHub teams and IdP groups in the Team Synchronization API is currently available for developers to preview. To access this new API during the preview period, you must provide a custom media type in the Accept header:
application/vnd.github.team-sync-preview+json
Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub Support.
List IdP groups available in an organization.
GET /orgs/:org/team-sync/groups
Response
Status: 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
{
"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
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
Note: Configuring connections between GitHub teams and IdP groups in the Team Synchronization API is currently available for developers to preview. To access this new API during the preview period, you must provide a custom media type in the Accept header:
application/vnd.github.team-sync-preview+json
Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub Support.
List IdP groups connected to a team on GitHub.
GET /teams/:team_id/team-sync/group-mappings
Response
Status: 200 OK
{
"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
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
Note: Configuring connections between GitHub teams and IdP groups in the Team Synchronization API is currently available for developers to preview. To access this new API during the preview period, you must provide a custom media type in the Accept header:
application/vnd.github.team-sync-preview+json
Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub Support.
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.
PATCH /teams/:team_id/team-sync/group-mappings
Parameters
| Name | Type | Description |
|---|---|---|
groups |
array of objects |
Required. The IdP groups you want to connect to a GitHub team. When updating, the new groups object will replace the original one. You must include any existing groups that you don't want to remove. |
groups object
| Name | Type | Description |
|---|---|---|
group_id |
string |
Required. ID of the IdP group. |
group_name |
string |
Required. Name of the IdP group. |
group_description |
string |
Required. Description of the IdP group. |
Example
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"description": "The people who configure your octoworld."
}
]
}
Response
Status: 200 OK
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
}
]
}

