---
title: "Delete VM"
method: DELETE
path: "/api/v1/vms/{id}"
tags: ["Virtual Machines"]
---

# Delete VM

`DELETE /api/v1/vms/{id}`

Permanently delete a virtual machine and release its resources.

## Attached Volumes

Control what happens to volumes attached to the VM with `volume_action`:

- **`detach`** (default) — volumes are detached and kept. They remain billable and can be re-attached to another VM.
- **`delete`** — volumes are permanently deleted along with the VM.

## VPC Cleanup

Set `delete_vpc` to `true` to also delete the VM's associated VPC. The VPC is only deleted if no other VMs are using it.

## Billing

If the VM has an active subscription, the remaining prepaid balance is refunded pro-rata (hourly precision) to your account balance.

## Path parameters

- `id` string, uuid, required

## Headers

- `X-Project-ID` string, uuid, required

## Request body

- DeleteVMRequest
  - `volume_action` 'detach' | 'delete' — What to do with attached volumes. `detach` keeps them (still billable), `delete` removes them permanently.
  - `delete_vpc` boolean — Whether to delete the associated VPC. Only succeeds if no other VMs are using it.

## Response `200`

VM deleted successfully

- SuccessResponse
  - `success` boolean
  - `message` string

## Other responses

- `400` — X-Project-ID header is required for this endpoint
- `404` — Resource not found

---

[API](https://skmtc.net/rafftechnologies/apis/raff-api.md) · [All operations](https://skmtc.net/rafftechnologies/apis/raff-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rafftechnologies/raff-api/versions/a3f123570011/schema)
