---
title: "Create or update IdP group connections (Legacy)"
method: PATCH
path: "/teams/{team_id}/team-sync/group-mappings"
tags: ["teams"]
deprecated: true
---

# Create or update IdP group connections (Legacy)

`PATCH /teams/{team_id}/team-sync/group-mappings`

> **Deprecated.**

> [!WARNING]
> **Endpoint 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`](https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections) endpoint.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-cloud@latest/github/getting-started-with-github/githubs-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.

## Path parameters

- `team_id` integer, required

## Request body

- object
  - `groups` object[], 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.
    - `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.
    - `id` string
    - `name` string
    - `description` string
  - `synced_at` string

## Response `200`

Response

- GroupMapping — External Groups to be mapped to a team for membership
  - `groups` object[] — Array of groups to be mapped to this team
    - `group_id` string, required — The ID of the group
    - `group_name` string, required — The name of the group
    - `group_description` string, required — a description of the group
    - `status` string — synchronization status for this group mapping
    - `synced_at` string, nullable — the time of the last sync for this group-mapping

## Other responses

- `403` — Forbidden
- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-2.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-2/versions/8ae6d0c8716e/schema)
