# 팀 동기화를 위한 REST API 엔드포인트

REST API를 사용하여 팀과 IdP(외부 ID 공급자) 그룹 간의 GitHub 연결을 관리합니다.

## 팀 동기화 정보

이러한 엔드포인트를 사용하려면 인증된 사용자가 팀 유지 관리자이거나 팀과 연결된 조직의 소유자여야 합니다. 인증에 사용하는 토큰도 IdP(SSO) 공급자와 함께 사용할 수 있는 권한을 부여받아야 합니다. 자세한 내용은 [Single Sign-On에 사용할 개인용 액세스 토큰 권한 부여](/ko/enterprise-cloud@latest/authentication/authenticating-with-single-sign-on/authorizing-a-personal-access-token-for-use-with-single-sign-on)을(를) 참조하세요.

팀 동기화를 사용하여 IdP를 통해 팀 구성원을 관리할 GitHub 수 있습니다. 이러한 엔드포인트를 사용하려면 팀 동기화를 사용하도록 설정해야 합니다. 자세한 내용은 [조직의 팀 동기화 관리](/ko/enterprise-cloud@latest/organizations/managing-saml-single-sign-on-for-your-organization/managing-team-synchronization-for-your-organization)을(를) 참조하세요.

> \[!NOTE]
> 이러한 엔드포인트는 .와 함께 Enterprise Managed Users사용할 수 없습니다. 관리에 대한 자세한 내용은 관리형 사용자가 있는 조직을 [](/ko/enterprise-cloud@latest/rest/teams/external-groups)참조하세요.

> \[!NOTE]
> 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.

## List IdP groups for an organization

```
GET /orgs/{org}/team-sync/groups
```

Lists IdP groups available in an organization.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`org`** (string) (required)
  The organization name. The name is not case sensitive.

* **`per_page`** (integer)
  The number of results per page (max 100). For more information, see "Using pagination in the REST API."
  Default: `30`

* **`page`** (string)
  Page token

* **`q`** (string)
  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

* **200** - OK

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/team-sync/groups
```

**Response schema (Status: 200):**

* `groups`: array of objects:
  * `group_id`: required, string
  * `group_name`: required, string
  * `group_description`: required, string
  * `status`: string
  * `synced_at`: string or null

## List IdP groups for a team

```
GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings
```

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

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`org`** (string) (required)
  The organization name. The name is not case sensitive.

* **`team_slug`** (string) (required)
  The slug of the team name.

### HTTP response status codes

* **200** - OK

* **422** - Unprocessable entity if you attempt to modify an enterprise team at the organization level.

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/team-sync/group-mappings
```

**Response schema (Status: 200):**

Same response schema as [List IdP groups for an organization](#list-idp-groups-for-an-organization).

## Create or update IdP group connections

```
PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings
```

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

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`org`** (string) (required)
  The organization name. The name is not case sensitive.

* **`team_slug`** (string) (required)
  The slug of the team name.

#### Body parameters

* **`groups`** (array 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.
  * **`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.

### HTTP response status codes

* **200** - OK

* **422** - Unprocessable entity if you attempt to modify an enterprise team at the organization level.

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X PATCH \
  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 schema (Status: 200):**

Same response schema as [List IdP groups for an organization](#list-idp-groups-for-an-organization).

## List IdP groups for a team (Legacy)

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

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 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

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`team_id`** (integer) (required)
  The unique identifier of the team.

### HTTP response status codes

* **200** - OK

* **403** - Forbidden

* **404** - Resource not found

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  https://api.github.com/teams/TEAM_ID/team-sync/group-mappings
```

**Response schema (Status: 200):**

Same response schema as [List IdP groups for an organization](#list-idp-groups-for-an-organization).

## Create or update IdP group connections (Legacy)

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

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 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

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`team_id`** (integer) (required)
  The unique identifier of the team.

#### Body parameters

* **`groups`** (array of objects) (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)

### HTTP response status codes

* **200** - OK

* **403** - Forbidden

* **422** - Validation failed, or the endpoint has been spammed.

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X PATCH \
  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 schema (Status: 200):**

Same response schema as [List IdP groups for an organization](#list-idp-groups-for-an-organization).