# LDAP에 대한 REST API 엔드포인트

REST API를 사용하여 GitHub Enterprise Server 사용자 또는 팀과 연결된 LDAP 항목 사이의 계정 관계를 업데이트하거나 새 동기화를 대기열에 추가합니다.

## LDAP 정보

이 엔드포인트를 사용하면 사용자 또는 팀이 매핑하는 DN(고유 이름)을 업데이트할 수 있습니다. 대부분의 경우 어플라이언스에 [대해 LDAP 동기화를 사용하도록 설정](/ko/enterprise-server@3.22/admin/managing-iam/using-ldap-for-enterprise-iam/using-ldap) 해야 합니다 GitHub Enterprise Server .
[사용자에 대한 LDAP 매핑 업데이트](#update-ldap-mapping-for-a-user) 엔드포인트는 LDAP 동기화가 사용하지 않도록 설정된 경우에도 LDAP를 사용할 때 사용할 수 있습니다.

> \[!NOTE]
> 이러한 엔드포인트는 personal access token (classic)을(를) 사용하는 인증만 지원합니다. 자세한 내용은 [개인용 액세스 토큰 관리](/ko/enterprise-server@3.22/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic)을(를) 참조하세요.

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

## Update LDAP mapping for a team

```
PATCH /admin/ldap/teams/{team_id}/mapping
```

Updates the distinguished name (DN) of the LDAP entry to map to a team. LDAP synchronization must be enabled to map LDAP entries to a team. Use the Create a team endpoint to create a team with LDAP mapping.

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

* **`ldap_dn`** (string) (required)
  The distinguished name (DN) of the LDAP entry to map to a team.

### HTTP response status codes

* **200** - OK

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X PATCH \
  http(s)://HOSTNAME/api/v3/admin/ldap/teams/TEAM_ID/mapping \
  -d '{
  "ldap_dn": "cn=Enterprise Ops,ou=teams,dc=github,dc=com"
}'
```

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

* `ldap_dn`: string
* `id`: integer
* `node_id`: string
* `url`: string
* `html_url`: string
* `name`: string
* `slug`: string
* `description`: string or null
* `privacy`: string
* `notification_setting`: string
* `permission`: string
* `members_url`: string
* `repositories_url`: string
* `parent`: null
* `type`: string
* `organization_id`: integer
* `enterprise_id`: integer

## Sync LDAP mapping for a team

```
POST /admin/ldap/teams/{team_id}/sync
```

Note that this API call does not automatically initiate an LDAP sync. Rather, if a 201 is returned, the sync job is queued successfully, and is performed when the instance is ready.

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

* **201** - Created

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X POST \
  http(s)://HOSTNAME/api/v3/admin/ldap/teams/TEAM_ID/sync
```

**Response schema (Status: 201):**

* `status`: string

## Update LDAP mapping for a user

```
PATCH /admin/ldap/users/{username}/mapping
```

### Parameters

#### Headers

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

#### Path and query parameters

* **`username`** (string) (required)
  The handle for the GitHub user account.

#### Body parameters

* **`ldap_dn`** (string) (required)
  The distinguished name (DN) of the LDAP entry to map to a team.

### HTTP response status codes

* **200** - OK

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X PATCH \
  http(s)://HOSTNAME/api/v3/admin/ldap/users/USERNAME/mapping \
  -d '{
  "ldap_dn": "uid=asdf,ou=users,dc=github,dc=com"
}'
```

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

* `ldap_dn`: string
* `login`: required, string
* `id`: required, integer, format: int64
* `node_id`: required, string
* `avatar_url`: required, string, format: uri
* `gravatar_id`: required, string or null
* `url`: required, string, format: uri
* `html_url`: required, string, format: uri
* `followers_url`: required, string, format: uri
* `following_url`: required, string
* `gists_url`: required, string
* `starred_url`: required, string
* `subscriptions_url`: required, string, format: uri
* `organizations_url`: required, string, format: uri
* `repos_url`: required, string, format: uri
* `events_url`: required, string
* `received_events_url`: required, string, format: uri
* `type`: required, string
* `site_admin`: required, boolean
* `name`: required, string or null
* `company`: required, string or null
* `blog`: required, string or null
* `location`: required, string or null
* `email`: required, string or null, format: email
* `hireable`: required, boolean or null
* `bio`: required, string or null
* `twitter_username`: string or null
* `public_repos`: required, integer
* `public_gists`: required, integer
* `followers`: required, integer
* `following`: required, integer
* `created_at`: required, string, format: date-time
* `updated_at`: required, string, format: date-time
* `private_gists`: required, integer
* `total_private_repos`: required, integer
* `owned_private_repos`: required, integer
* `disk_usage`: required, integer
* `collaborators`: required, integer
* `two_factor_authentication`: required, boolean
* `plan`: object:
  * `collaborators`: required, integer
  * `name`: required, string
  * `space`: required, integer
  * `private_repos`: required, integer
* `suspended_at`: string, format: date-time
* `business_plus`: boolean
* `user_view_type`: string

## Sync LDAP mapping for a user

```
POST /admin/ldap/users/{username}/sync
```

Note that this API call does not automatically initiate an LDAP sync. Rather, if a 201 is returned, the sync job is queued successfully, and is performed when the instance is ready.

### Parameters

#### Headers

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

#### Path and query parameters

* **`username`** (string) (required)
  The handle for the GitHub user account.

### HTTP response status codes

* **201** - Created

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X POST \
  http(s)://HOSTNAME/api/v3/admin/ldap/users/USERNAME/sync
```

**Response schema (Status: 201):**

Same response schema as [Sync LDAP mapping for a team](#sync-ldap-mapping-for-a-team).