# VM Templates endpoints (Admin API)

> 2 FeatherPanel Admin API endpoints from admin/vm-templates.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Source: https://featherpanel.com/docs/api/reference/admin/vm-templates/

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

### PATCH `/api/admin/vm-templates/{id}`

- Auth: Admin
- Permission: `admin.nodes.edit`
- Route name: `admin-vm-templates-update`
- Controller: [`VmNodesController::updateTemplate`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmNodesController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/vm-templates.php#L26)

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

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

Plugin events: [`featherpanel:vds:template:update`](https://featherpanel.com/docs/plugins/events/vds-node/#vds-template-updated)

### DELETE `/api/admin/vm-templates/{id}`

- Auth: Admin
- Permission: `admin.nodes.delete`
- Route name: `admin-vm-templates-delete`
- Controller: [`VmNodesController::deleteTemplate`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmNodesController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/vm-templates.php#L42)

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

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

Plugin events: [`featherpanel:vds:template:delete`](https://featherpanel.com/docs/plugins/events/vds-node/#vds-template-deleted)
