---
title: "Bulk Delete VMs"
method: DELETE
path: "/api/v1/vms/bulk"
tags: ["Virtual Machines"]
---

# Bulk Delete VMs

`DELETE /api/v1/vms/bulk`

Delete up to 50 virtual machines in a single request.

Each VM is processed independently — if some deletions fail, others still succeed. The response includes per-VM results so you can identify and retry failures.

## Attached Volumes

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

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

## VPC Cleanup

Set `delete_vpc` to `true` (default) to also delete each VM's associated VPC. A VPC is only deleted if no other VMs are using it.

## Billing

For VMs with active subscriptions, the remaining prepaid balance is refunded pro-rata (hourly precision) to your account balance.

## Headers

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

## Request body

- DeleteVMsBulkRequest
  - `ids` string[], required — VM IDs to delete (1–50).
  - `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 associated VPCs. Only succeeds if no other VMs are using them.

## Response `200`

Bulk deletion results

- BulkDeleteVMsResult
  - `success` boolean — `true` if at least one VM was deleted successfully.
  - `message` string
  - `total_count` integer — Number of VMs requested for deletion.
  - `success_count` integer — Number of VMs successfully deleted.
  - `failed_count` integer — Number of VMs that failed to delete.
  - `results` BulkDeleteVMItemResult[] — Per-VM deletion results.
    - `id` string, uuid — VM ID.
    - `success` boolean
    - `message` string
    - `error` string — Error detail if deletion failed.

## Other responses

- `400` — X-Project-ID header is required for this endpoint

---

[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)
