# Update LDAP mapping for a team

From **GitHub v3 REST API**.

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

Updates the [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. [LDAP synchronization](https://docs.github.com/enterprise/admin/guides/user-management/using-ldap/#enabling-ldap-sync) must be enabled to map LDAP entries to a team. Use the [Create a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#create-a-team) endpoint to create a team with LDAP mapping.

If you pass the `hellcat-preview` media type, you can also update the LDAP mapping of a child team.

## Parameters

### `team_id`

- Location: path
- Required: true
- Type: `integer`

## Request body

- Required: true
### `application/json`

- Type: `object`

```json
{
  "ldap_dn": "cn=Enterprise Ops,ou=teams,dc=github,dc=com"
}
```

```json
{"properties":{"ldap_dn":{"description":"The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team.","type":"string"}},"required":["ldap_dn"],"type":"object"}
```

## Responses

### `200`

Response

### `application/json`

- Type: `object`

```json
{
  "description": "A great team.",
  "html_url": "https://github.com/orgs/github/teams/justice-league",
  "id": 1,
  "ldap_dn": "cn=Enterprise Ops,ou=teams,dc=github,dc=com",
  "members_url": "https://api.github.com/teams/1/members{/member}",
  "name": "Justice League",
  "node_id": "MDQ6VGVhbTE=",
  "parent": null,
  "permission": "admin",
  "privacy": "closed",
  "repositories_url": "https://api.github.com/teams/1/repos",
  "slug": "justice-league",
  "url": "https://api.github.com/teams/1"
}
```

```json
{"properties":{"description":{"nullable":true,"type":"string"},"html_url":{"type":"string"},"id":{"type":"integer"},"ldap_dn":{"type":"string"},"members_url":{"type":"string"},"name":{"type":"string"},"node_id":{"type":"string"},"parent":{"nullable":true},"permission":{"type":"string"},"privacy":{"type":"string"},"repositories_url":{"type":"string"},"slug":{"type":"string"},"url":{"type":"string"}},"type":"object"}
```

## Request examples

### cURL

```shell
curl --request PATCH \
  --url {protocol}://{hostname}/api/v3/admin/ldap/teams/{team_id}/mapping \
  --header 'content-type: application/json' \
  --data '{
  "ldap_dn": "cn=Enterprise Ops,ou=teams,dc=github,dc=com"
}'
```
