{"meta":{"title":"Points de terminaison d’API REST pour la synchronisation d’équipe","intro":"Utilisez l’API REST pour gérer les connexions entre GitHub les équipes et les groupes de fournisseurs d’identité externes.","product":"API REST","breadcrumbs":[{"href":"/fr/enterprise-cloud@latest/rest","title":"API REST"},{"href":"/fr/enterprise-cloud@latest/rest/teams","title":"Équipes"},{"href":"/fr/enterprise-cloud@latest/rest/teams/team-sync","title":"Synchronisation d’équipe"}],"documentType":"article"},"body":"# Points de terminaison d’API REST pour la synchronisation d’équipe\n\nUtilisez l’API REST pour gérer les connexions entre GitHub les équipes et les groupes de fournisseurs d’identité externes.\n\n## À propos de la synchronisation d’équipe\n\nPour utiliser ces points de terminaison, l’utilisateur authentifié doit être un responsable d’équipe ou un propriétaire de l’organisation associée à l’équipe. Le jeton que vous utilisez pour l’authentification doit également être autorisé à être utilisé avec votre fournisseur d’identité (SSO). Pour plus d’informations, consultez « [Autorisation d’un jeton d’accès personnel à utiliser avec l’authentification unique](/fr/enterprise-cloud@latest/authentication/authenticating-with-single-sign-on/authorizing-a-personal-access-token-for-use-with-single-sign-on) ».\n\nVous pouvez gérer les membres de l'équipe GitHub via votre fournisseur d'identité grâce à la synchronisation des équipes. La synchronisation d’équipe doit être activée pour utiliser ces points de terminaison. Pour plus d’informations, consultez « [Gestion de la synchronisation des équipes pour votre organisation](/fr/enterprise-cloud@latest/organizations/managing-saml-single-sign-on-for-your-organization/managing-team-synchronization-for-your-organization) ».\n\n> \\[!NOTE]\n> Ces points de terminaison ne peuvent pas être utilisés avec Enterprise Managed Users. Pour en savoir plus sur la gestion d’un organisation avec utilisateurs managés, consultez [Points de terminaison d’API REST pour les groupes externes](/fr/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)."}