# LDAP endpoints (Admin API)

> 5 FeatherPanel Admin API endpoints from admin/ldap.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Source: https://featherpanel.com/docs/api/reference/admin/ldap/

Defined in [`backend/app/routes/admin/ldap.php`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/ldap.php). Authentication used here: **Admin**. Read [Authentication](https://featherpanel.com/docs/api/authentication/) for how to send credentials and [Rate limits and errors](https://featherpanel.com/docs/api/rate-limits-and-errors/) for the response envelope.

Paths, methods, permissions and rate limits come from the route file. Summaries, parameters and response codes come from the OpenAPI annotations on the controllers; endpoints without annotations show only what the route file declares.

## Endpoints

### GET `/api/admin/ldap/providers`

- Auth: Admin
- Permission: `admin.settings.view`
- Route name: `admin-ldap-providers-index`
- Controller: [`LdapProvidersController::index`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/LdapProvidersController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/ldap.php#L26)

**List all LDAP providers**

| Response `data` field | Type | Description |
| --- | --- | --- |
| `providers` | LdapProvider\[\] |  |

```bash
curl -X GET "$PANEL_URL/api/admin/ldap/providers" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` List of LDAP providers

### PUT `/api/admin/ldap/providers`

- Auth: Admin
- Permission: `admin.settings.edit`
- Route name: `admin-ldap-providers-create`
- Controller: [`LdapProvidersController::create`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/LdapProvidersController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/ldap.php#L37)

**Create a new LDAP provider**

Request body: [`LdapProvider`](https://featherpanel.com/docs/api/schemas/#schema-ldapprovider) (application/json)

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer | no |  |
| `uuid` | string | no |  |
| `name` | string | no |  |
| `host` | string | no |  |
| `port` | integer | no |  |
| `use_tls` | string | no |  |
| `use_ssl` | string | no |  |
| `bind_dn` | string | no |  |
| `base_dn` | string | no |  |
| `user_filter` | string | no |  |
| `username_attribute` | string | no |  |
| `email_attribute` | string | no |  |
| `auto_provision` | string | no |  |
| `enabled` | string | no |  |

```bash
curl -X PUT "$PANEL_URL/api/admin/ldap/providers" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"id":0,"uuid":"","name":"","host":"","port":0,"use_tls":"","use_ssl":"","bind_dn":"","base_dn":"","user_filter":"","username_attribute":"","email_attribute":"","auto_provision":"","enabled":""}'
```

Plugin events: [`featherpanel:ldap:provider:create`](https://featherpanel.com/docs/plugins/events/ldap-providers/#ldap-provider-created)

Responses: `200` Provider created successfully · `400` Bad request - Missing required fields · `500` Internal server error

### POST `/api/admin/ldap/providers/{uuid}`

- Auth: Admin
- Permission: `admin.settings.edit`
- Route name: `admin-ldap-providers-update`
- Controller: [`LdapProvidersController::update`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/LdapProvidersController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/ldap.php#L49)

**Update an LDAP provider**

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuid` | path | string | yes |  |

Request body: [`LdapProvider`](https://featherpanel.com/docs/api/schemas/#schema-ldapprovider) (application/json)

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer | no |  |
| `uuid` | string | no |  |
| `name` | string | no |  |
| `host` | string | no |  |
| `port` | integer | no |  |
| `use_tls` | string | no |  |
| `use_ssl` | string | no |  |
| `bind_dn` | string | no |  |
| `base_dn` | string | no |  |
| `user_filter` | string | no |  |
| `username_attribute` | string | no |  |
| `email_attribute` | string | no |  |
| `auto_provision` | string | no |  |
| `enabled` | string | no |  |

```bash
curl -X POST "$PANEL_URL/api/admin/ldap/providers/$UUID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"id":0,"uuid":"","name":"","host":"","port":0,"use_tls":"","use_ssl":"","bind_dn":"","base_dn":"","user_filter":"","username_attribute":"","email_attribute":"","auto_provision":"","enabled":""}'
```

Plugin events: [`featherpanel:ldap:provider:update`](https://featherpanel.com/docs/plugins/events/ldap-providers/#ldap-provider-updated)

Responses: `200` Provider updated successfully · `404` Provider not found · `500` Internal server error

### DELETE `/api/admin/ldap/providers/{uuid}`

- Auth: Admin
- Permission: `admin.settings.edit`
- Route name: `admin-ldap-providers-delete`
- Controller: [`LdapProvidersController::delete`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/LdapProvidersController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/ldap.php#L66)

**Delete an LDAP provider**

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuid` | path | string | yes |  |

```bash
curl -X DELETE "$PANEL_URL/api/admin/ldap/providers/$UUID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Plugin events: [`featherpanel:ldap:provider:delete`](https://featherpanel.com/docs/plugins/events/ldap-providers/#ldap-provider-deleted)

Responses: `200` Provider deleted successfully · `404` Provider not found · `500` Internal server error

### POST `/api/admin/ldap/providers/{uuid}/test`

- Auth: Admin
- Permission: `admin.settings.view`
- Route name: `admin-ldap-providers-test`
- Controller: [`LdapProvidersController::testConnection`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/LdapProvidersController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/ldap.php#L83)

**Test LDAP provider connection**

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuid` | path | string | yes |  |

```bash
curl -X POST "$PANEL_URL/api/admin/ldap/providers/$UUID/test" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Connection test result · `404` Provider not found
