Skip to main content
The REST API is now versioned. For more information, see "About API versioning."

Sincronización de equipos

Usa la API de REST para administrar las conexiones entre los equipos de GitHub Enterprise Cloud y los grupos del proveedor de identidad (IdP) externo.

Acerca de la sincronización de equipo

Para utilizar estos puntos de conexión, el usuario autenticado debe ser un mantenedor del equipo o un propietario de la organización asociada con este. El token que utilizas para autenticarte también necesitará autorizarse para su uso con tu proveedor IdP (SSO). Para obtener más información, consulta "Autorización de un personal access token para su uso con una organización de inicio de sesión único de SAML".

Puedes administrar a los miembros del equipo de GitHub Enterprise Cloud a través de tu IdP con la sincronización de equipos. La sincronización de equipos debe estar habilitada para usar estos puntos de conexión. Para más información, vea "Administración de la sincronización de equipos para la organización".

Nota: Estos puntos de conexión no se pueden usar con Enterprise Managed Users. Para más información sobre cómo administrar una instancia de organization with managed users, consulta "Grupos externos".

List IdP groups for an organization

Works with GitHub Apps

Lists IdP groups available in an organization.

Parameters

Headers
Nombre, Type, Descripción
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Nombre, Type, Descripción
orgstringRequired

The organization name. The name is not case sensitive.

Query parameters
Nombre, Type, Descripción
per_pageinteger

The number of results per page (max 100).

Default: 30

pagestring

Page token

qstring

Filters the results to return only those that begin with the value specified by this parameter. For example, a value of ab will return results that begin with "ab".

HTTP response status codes

Status codeDescripción
200

OK

Code samples

get/orgs/{org}/team-sync/groups
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
Nombre, Type, Descripción
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Nombre, Type, Descripción
orgstringRequired

The organization name. The name is not case sensitive.

team_slugstringRequired

The slug of the team name.

HTTP response status codes

Status codeDescripción
200

OK

Code samples

get/orgs/{org}/teams/{team_slug}/team-sync/group-mappings
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
Nombre, Type, Descripción
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Nombre, Type, Descripción
orgstringRequired

The organization name. The name is not case sensitive.

team_slugstringRequired

The slug of the team name.

Body parameters
Nombre, Type, Descripción
groupsarray of objects

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.

Nombre, Type, Descripción
group_idstringRequired

ID of the IdP group.

group_namestringRequired

Name of the IdP group.

group_descriptionstringRequired

Description of the IdP group.

HTTP response status codes

Status codeDescripción
200

OK

Code samples

patch/orgs/{org}/teams/{team_slug}/team-sync/group-mappings
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
Nombre, Type, Descripción
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Nombre, Type, Descripción
team_idintegerRequired

The unique identifier of the team.

HTTP response status codes

Status codeDescripción
200

OK

403

Forbidden

404

Resource not found

Code samples

get/teams/{team_id}/team-sync/group-mappings
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
Nombre, Type, Descripción
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Nombre, Type, Descripción
team_idintegerRequired

The unique identifier of the team.

Body parameters
Nombre, Type, Descripción
groupsarray of objectsRequired

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.

Nombre, Type, Descripción
group_idstringRequired

ID of the IdP group.

group_namestringRequired

Name of the IdP group.

group_descriptionstringRequired

Description of the IdP group.

idstring
namestring
descriptionstring
synced_atstring

HTTP response status codes

Status codeDescripción
200

OK

403

Forbidden

422

Validation failed, or the endpoint has been spammed.

Code samples

patch/teams/{team_id}/team-sync/group-mappings
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." } ] }