{"meta":{"title":"Puntos de conexión de la API de REST para la sincronización de equipos","intro":"Use la API REST para administrar las conexiones entre GitHub equipos y grupos de proveedor de identidades externos (IdP).","product":"REST API","breadcrumbs":[{"href":"/es/enterprise-cloud@latest/rest","title":"REST API"},{"href":"/es/enterprise-cloud@latest/rest/teams","title":"Teams"},{"href":"/es/enterprise-cloud@latest/rest/teams/team-sync","title":"Sincronización de equipos"}],"documentType":"article"},"body":"# Puntos de conexión de la API de REST para la sincronización de equipos\n\nUse la API REST para administrar las conexiones entre GitHub equipos y grupos de proveedor de identidades externos (IdP).\n\n## Acerca de la sincronización de equipo\n\nPara 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 más información, consulta [Autorización de un token de acceso personal para su uso con el inicio de sesión único](/es/enterprise-cloud@latest/authentication/authenticating-with-single-sign-on/authorizing-a-personal-access-token-for-use-with-single-sign-on).\n\nPuede administrar los miembros del equipo GitHub mediante su 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, consulta [Administración de la sincronización de equipos para su organización](/es/enterprise-cloud@latest/organizations/managing-saml-single-sign-on-for-your-organization/managing-team-synchronization-for-your-organization).\n\n> \\[!NOTE]\n> Estos puntos de conexión no se pueden usar con Enterprise Managed Users. Para más información sobre cómo administrar un organización con usuarios administrados, consulte [Puntos de conexión de la API de REST para grupos externos](/es/enterprise-cloud@latest/rest/teams/external-groups).\n\n> \\[!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## List IdP groups for an organization\n\n```\nGET /orgs/{org}/team-sync/groups\n```\n\nLists IdP groups available in an organization.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (string)\n  Page token\n\n* **`q`** (string)\n  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\".\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/orgs/ORG/team-sync/groups\n```\n\n**Response schema (Status: 200):**\n\n* `groups`: array of objects:\n  * `group_id`: required, string\n  * `group_name`: required, string\n  * `group_description`: required, string\n  * `status`: string\n  * `synced_at`: string or null\n\n## List IdP groups for a team\n\n```\nGET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings\n```\n\nList IdP groups connected to a team on GitHub Enterprise Cloud.\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.\nNote\n\nYou 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`team_slug`** (string) (required)\n  The slug of the team name.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **422** - Unprocessable entity if you attempt to modify an enterprise team at the organization level.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/team-sync/group-mappings\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List IdP groups for an organization](#list-idp-groups-for-an-organization).\n\n## Create or update IdP group connections\n\n```\nPATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings\n```\n\nCreates, 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.\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.\nNote\n\nYou 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`team_slug`** (string) (required)\n  The slug of the team name.\n\n#### Body parameters\n\n* **`groups`** (array of objects)\n  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.\n  * **`group_id`** (string) (required)\n    ID of the IdP group.\n  * **`group_name`** (string) (required)\n    Name of the IdP group.\n  * **`group_description`** (string) (required)\n    Description of the IdP group.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **422** - Unprocessable entity if you attempt to modify an enterprise team at the organization level.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/team-sync/group-mappings \\\n  -d '{\n  \"groups\": [\n    {\n      \"group_id\": \"123\",\n      \"group_name\": \"Octocat admins\",\n      \"group_description\": \"string\"\n    }\n  ]\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List IdP groups for an organization](#list-idp-groups-for-an-organization).\n\n## List IdP groups for a team (Legacy)\n\n```\nGET /teams/{team_id}/team-sync/group-mappings\n```\n\nWarning\n\nEndpoint 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.\n\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.\nList IdP groups connected to a team on GitHub Enterprise Cloud.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`team_id`** (integer) (required)\n  The unique identifier of the team.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/teams/TEAM_ID/team-sync/group-mappings\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List IdP groups for an organization](#list-idp-groups-for-an-organization).\n\n## Create or update IdP group connections (Legacy)\n\n```\nPATCH /teams/{team_id}/team-sync/group-mappings\n```\n\nWarning\n\nEndpoint 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.\n\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.\nCreates, 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`team_id`** (integer) (required)\n  The unique identifier of the team.\n\n#### Body parameters\n\n* **`groups`** (array of objects) (required)\n  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.\n  * **`group_id`** (string) (required)\n    ID of the IdP group.\n  * **`group_name`** (string) (required)\n    Name of the IdP group.\n  * **`group_description`** (string) (required)\n    Description of the IdP group.\n  * **`id`** (string)\n  * **`name`** (string)\n  * **`description`** (string)\n\n* **`synced_at`** (string)\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **403** - Forbidden\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  https://api.github.com/teams/TEAM_ID/team-sync/group-mappings \\\n  -d '{\n  \"groups\": [\n    {\n      \"group_id\": \"123\",\n      \"group_name\": \"Octocat admins\",\n      \"description\": \"The people who configure your octoworld.\",\n      \"group_description\": \"string\"\n    }\n  ]\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List IdP groups for an organization](#list-idp-groups-for-an-organization)."}