# Subdomains endpoints (Client API: game servers)

> 3 FeatherPanel Client API: game servers endpoints from user/server/subdomains.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Source: https://featherpanel.com/docs/api/reference/user/server/subdomains/

Defined in [`backend/app/routes/user/server/subdomains.php`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/subdomains.php). Authentication used here: **Server access**. 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/user/servers/{uuidShort}/subdomains`

- Auth: Server access
- Default rate limit: 30 / minute (`user-server-subdomains`)
- Route name: `user-server-subdomains-index`
- Controller: [`SubdomainController::index`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/SubdomainController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/subdomains.php#L27)

**List subdomains and available domains** Returns the subdomains created for a server and the domains available for its spell.

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

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

Responses: `200` Subdomains retrieved successfully · `403` Forbidden · `404` Server not found

### PUT `/api/user/servers/{uuidShort}/subdomains`

- Auth: Server access
- Route name: `user-server-subdomains-create`
- Controller: [`SubdomainController::create`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/SubdomainController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/subdomains.php#L50)

**Create a subdomain**

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | \- | yes |  |

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `domain_uuid` | string | yes |  |
| `subdomain` | string | yes |  |

```bash
curl -X PUT "$PANEL_URL/api/user/servers/$UUID_SHORT/subdomains" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"domain_uuid":"","subdomain":""}'
```

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

Responses: `201` Subdomain created successfully · `400` Validation failed · `403` Forbidden · `404` Domain not found

### DELETE `/api/user/servers/{uuidShort}/subdomains/{uuid}`

- Auth: Server access
- Default rate limit: 10 / minute (`user-server-subdomains`)
- Route name: `user-server-subdomains-delete`
- Controller: [`SubdomainController::delete`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/SubdomainController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/subdomains.php#L71)

**Delete a subdomain**

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

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

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

Responses: `200` Subdomain deleted successfully · `404` Subdomain not found
