# Subdomains endpoints (Admin API)

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

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

Defined in [`backend/app/routes/admin/subdomains.php`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/subdomains.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/subdomains`

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

**List subdomain manager domains** Retrieve paginated list of subdomain manager domains with spell mappings.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `page` | query | integer | no |  |
| `limit` | query | integer | no |  |
| `search` | query | string | no |  |
| `includeInactive` | query | boolean | no |  |

| Response `data` field | Type | Description |
| --- | --- | --- |
| `domains` | SubdomainManagerDomain\[\] |  |
| `pagination` | object |  |

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

Plugin events: [`featherpanel:admin:subdomains:domains:retrieved`](https://featherpanel.com/docs/plugins/events/subdomains/#subdomain-domains-retrieved)

Responses: `200` Domains retrieved successfully · `403` Forbidden

### GET `/api/admin/subdomains/settings`

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

**Get subdomain manager settings**

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

Responses: `200` Settings retrieved successfully

### PATCH `/api/admin/subdomains/settings`

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

**Get subdomain manager settings**

```bash
curl -X PATCH "$PANEL_URL/api/admin/subdomains/settings" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Settings retrieved successfully

### GET `/api/admin/subdomains/spells`

- Auth: Admin
- Permission: `admin.subdomains.view`
- Route name: `admin-subdomains-spells`
- Controller: [`SubdomainsController::spells`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/SubdomainsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/subdomains.php#L52)

**List spells available for subdomain manager**

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

Responses: `200` Spells retrieved successfully

### GET `/api/admin/subdomains/{uuid}`

- Auth: Admin
- Permission: `admin.subdomains.view`
- Route name: `admin-subdomains-show`
- Controller: [`SubdomainsController::show`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/SubdomainsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/subdomains.php#L63)

**Get subdomain manager domain** Retrieve information about a subdomain manager domain including subdomains.

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

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

Plugin events: [`featherpanel:admin:subdomains:domain:retrieved`](https://featherpanel.com/docs/plugins/events/subdomains/#subdomain-domain-retrieved)

Responses: `200` Domain retrieved successfully · `404` Domain not found

### PUT `/api/admin/subdomains`

- Auth: Admin
- Permission: `admin.subdomains.create`
- Route name: `admin-subdomains-create`
- Controller: [`SubdomainsController::create`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/SubdomainsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/subdomains.php#L79)

**Create subdomain manager domain**

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | yes |  |
| `description` | string | no |  |
| `is_active` | boolean | no |  |
| `cloudflare_zone_id` | string | no |  |
| `cloudflare_account_id` | string | no |  |
| `spells` | object\[\] | no |  |

```bash
curl -X PUT "$PANEL_URL/api/admin/subdomains" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"domain":"","description":"","is_active":false,"cloudflare_zone_id":"","cloudflare_account_id":"","spells":[]}'
```

Plugin events: [`featherpanel:admin:subdomains:domain:created`](https://featherpanel.com/docs/plugins/events/subdomains/#subdomain-domain-created)

Responses: `201` Domain created successfully · `400` Validation failed

### PATCH `/api/admin/subdomains/{uuid}`

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

**Update subdomain manager domain**

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

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

Plugin events: [`featherpanel:admin:subdomains:domain:updated`](https://featherpanel.com/docs/plugins/events/subdomains/#subdomain-domain-updated)

Responses: `200` Domain updated successfully · `404` Domain not found

### DELETE `/api/admin/subdomains/{uuid}`

- Auth: Admin
- Permission: `admin.subdomains.delete`
- Route name: `admin-subdomains-delete`
- Controller: [`SubdomainsController::delete`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/SubdomainsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/subdomains.php#L106)

**Delete subdomain manager domain**

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

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

Plugin events: [`featherpanel:admin:subdomains:domain:deleted`](https://featherpanel.com/docs/plugins/events/subdomains/#subdomain-domain-deleted)

Responses: `200` Domain deleted successfully · `400` Domain still has subdomains · `404` Domain not found

### GET `/api/admin/subdomains/{uuid}/subdomains`

- Auth: Admin
- Permission: `admin.subdomains.view`
- Route name: `admin-subdomains-subdomain-list`
- Controller: [`SubdomainsController::listSubdomains`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/SubdomainsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/subdomains.php#L122)

**List subdomains attached to a domain**

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

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

Plugin events: [`featherpanel:admin:subdomains:domain:not:found`](https://featherpanel.com/docs/plugins/events/subdomains/#subdomain-domain-not-found)

Responses: `200` Subdomains retrieved successfully · `404` Domain not found
