# Hosting Packages endpoints (Admin API)

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

Source: https://featherpanel.com/docs/api/reference/admin/hosting-packages/

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

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

**List hosting packages**

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

### GET `/api/admin/hosting-packages/{id}`

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

**Get hosting package**

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

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

### PUT `/api/admin/hosting-packages`

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

**Create hosting package**

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

Plugin events: [`featherpanel:admin:hosting_packages:package:created`](https://featherpanel.com/docs/plugins/events/hosting-packages/#hosting-package-created)

### PATCH `/api/admin/hosting-packages/{id}`

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

**Update hosting package**

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

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

Plugin events: [`featherpanel:admin:hosting_packages:package:updated`](https://featherpanel.com/docs/plugins/events/hosting-packages/#hosting-package-updated)

### DELETE `/api/admin/hosting-packages/{id}`

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

**Delete hosting package**

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

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

Plugin events: [`featherpanel:admin:hosting_packages:package:deleted`](https://featherpanel.com/docs/plugins/events/hosting-packages/#hosting-package-deleted)
