Skip to main content

Sincronización de equipos

The Team synchronization API allows you to manage connections between GitHub Enterprise Cloud teams and external identity provider (IdP) groups.

About the Team synchronization API

Para utilizar esta API, el usuario autenticado debe ser un mantenedor del equipo o un propietario de la organización asociada con éste. 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 la sección "Autorizar un token de acceso personal para su uso con una organización que tiene inicio de sesión único de SAML".

Puedes administrar a los miembros del equipo de GitHub a través de tu IdP con la sincronización de equipos. Ésta se debe habilitar para usar la API de Sincronización de Equipos. Para obtener más información, consulta la sección "Sincronizar equipos entre tu proveedor de identidad y GitHub".

Nota: La API de sincronización de equipos no puede utilizarse con Usuarios Administrados de Enterprise. Para aprender más sobre cómo administrar una organización con usuarios administrados, consulta la sección "API de grupos externos".

List IdP groups for an organization

Funciona con GitHub Apps

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 available in an organization. You can limit your page results using the per_page parameter. GitHub generates a url-encoded page token using a cursor value for where the next page begins. For more information on cursor pagination, see "Offset and Cursor Pagination explained."

Parámetros

Encabezados
Nombre, Tipo, Descripción
acceptstring

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

Parámetros de ruta
Nombre, Tipo, Descripción
orgstringRequerido

The organization name. The name is not case sensitive.

Parámetros de consulta
Nombre, Tipo, Descripción
per_pageinteger

The number of results per page (max 100).

Predeterminado: 30

pagestring

Page token

Códigos de estado de respuesta HTTP

Código de estadoDescripción
200

OK

Ejemplos de código

get/orgs/{org}/team-sync/groups
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ 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

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.

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.

Parámetros

Encabezados
Nombre, Tipo, Descripción
acceptstring

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

Parámetros de ruta
Nombre, Tipo, Descripción
orgstringRequerido

The organization name. The name is not case sensitive.

team_slugstringRequerido

The slug of the team name.

Códigos de estado de respuesta HTTP

Código de estadoDescripción
200

OK

Ejemplos de código

get/orgs/{org}/teams/{team_slug}/team-sync/group-mappings
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ 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

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.

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.

Parámetros

Encabezados
Nombre, Tipo, Descripción
acceptstring

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

Parámetros de ruta
Nombre, Tipo, Descripción
orgstringRequerido

The organization name. The name is not case sensitive.

team_slugstringRequerido

The slug of the team name.

Parámetros de cuerpo
Nombre, Tipo, 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, Tipo, Descripción
group_idstringRequerido

ID of the IdP group.

group_namestringRequerido

Name of the IdP group.

group_descriptionstringRequerido

Description of the IdP group.

Códigos de estado de respuesta HTTP

Código de estadoDescripción
200

OK

Ejemplos de código

patch/orgs/{org}/teams/{team_slug}/team-sync/group-mappings
curl \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ 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.

Parámetros

Encabezados
Nombre, Tipo, Descripción
acceptstring

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

Parámetros de ruta
Nombre, Tipo, Descripción
team_idintegerRequerido

The unique identifier of the team.

Códigos de estado de respuesta HTTP

Código de estadoDescripción
200

OK

403

Forbidden

404

Resource not found

Ejemplos de código

get/teams/{team_id}/team-sync/group-mappings
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ 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.

Parámetros

Encabezados
Nombre, Tipo, Descripción
acceptstring

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

Parámetros de ruta
Nombre, Tipo, Descripción
team_idintegerRequerido

The unique identifier of the team.

Parámetros de cuerpo
Nombre, Tipo, Descripción
groupsarray of objectsRequerido

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, Tipo, Descripción
group_idstringRequerido

ID of the IdP group.

group_namestringRequerido

Name of the IdP group.

group_descriptionstringRequerido

Description of the IdP group.

idstring
namestring
descriptionstring
synced_atstring

Códigos de estado de respuesta HTTP

Código de estadoDescripción
200

OK

403

Forbidden

422

Validation failed

Ejemplos de código

patch/teams/{team_id}/team-sync/group-mappings
curl \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ 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." } ] }