> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rafftechnologies.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk Delete VMs

> 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.


<sub>Updated May 8, 2026</sub>


## OpenAPI

````yaml DELETE /api/v1/vms/bulk
openapi: 3.0.3
info:
  title: Raff API
  description: >
    REST API for managing cloud infrastructure on Raff.


    ## Authentication

    Most endpoints require authentication via API key. Catalog endpoints under
    `/api/v1/public/` are open and require no authentication.


    ### API Key Authentication

    Include your API key in the `X-API-Key` header:
      ```
      curl -H "X-API-Key: YOUR_API_KEY" https://api.rafftechnologies.com/api/v1/vms
      ```

    ## Catalog

    Use the public catalog endpoints to discover available regions, OS
    templates, and pricing plans before creating resources:

    - `GET /api/v1/public/regions` — list available regions

    - `GET /api/v1/public/templates` — list OS templates (use the `id` as
    `template_id` when creating a VM)

    - `GET /api/v1/public/pricing/vm` — list VM pricing plans (use the `id` as
    `pricing_id` when creating a VM)

    - `GET /api/v1/public/pricing/volume` — volume storage pricing

    - `GET /api/v1/public/pricing/snapshot` — snapshot storage pricing

    - `GET /api/v1/public/pricing/backup` — backup storage pricing

    - `GET /api/v1/public/pricing/ip` — IP address pricing
  version: 1.0.0
  contact:
    name: Raff Technologies
    url: https://rafftechnologies.com
servers:
  - url: https://api.rafftechnologies.com
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Catalog
    description: >-
      Discover available regions, OS templates, and pricing plans. No
      authentication required.
  - name: Health
    description: Health check endpoints
  - name: Projects
    description: Organize resources into projects for billing and access control
  - name: Virtual Machines
    description: Create, manage, and control virtual machines
  - name: Networking
    description: >-
      Attach and detach VPCs, floating IPs, and security groups to VM network
      interfaces
  - name: Snapshots
    description: Point-in-time copies of VMs and volumes for quick rollback or cloning
  - name: Backups
    description: Scheduled and on-demand VM backups with restore capability
  - name: Backup Schedules
    description: Recurring daily or weekly backup schedules attached to a VM
  - name: SSH Keys
    description: Manage account-level SSH keys for VM provisioning
  - name: Members
    description: Account-level members — invite, list, update role, remove
  - name: Project Members
    description: Members of a specific project — same model as Members but project-scoped
  - name: Roles
    description: Custom roles bundling account or project permissions
  - name: Permissions
    description: List the catalog of permission strings used by roles
  - name: API Keys
    description: Create and manage API keys for programmatic access
  - name: Invitations
    description: Create and cancel email-based invitations to join the account or a project
paths:
  /api/v1/vms/bulk:
    delete:
      tags:
        - Virtual Machines
      summary: Bulk Delete VMs
      description: >
        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.
      operationId: deleteVMsBulk
      parameters:
        - $ref: '#/components/parameters/ProjectIDHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteVMsBulkRequest'
      responses:
        '200':
          description: Bulk deletion results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkDeleteVMsResult'
        '400':
          $ref: '#/components/responses/MissingProjectID'
components:
  parameters:
    ProjectIDHeader:
      name: X-Project-ID
      in: header
      required: true
      description: >-
        Project ID. Required for all mutating operations (create, delete, power
        actions, resize).
      schema:
        type: string
        format: uuid
  schemas:
    DeleteVMsBulkRequest:
      type: object
      required:
        - ids
      properties:
        ids:
          type: array
          items:
            type: string
            format: uuid
          minItems: 1
          maxItems: 50
          description: VM IDs to delete (1–50).
        volume_action:
          type: string
          enum:
            - detach
            - delete
          default: delete
          description: >-
            What to do with attached volumes. `detach` keeps them (still
            billable), `delete` removes them permanently.
        delete_vpc:
          type: boolean
          default: true
          description: >-
            Whether to delete associated VPCs. Only succeeds if no other VMs are
            using them.
    BulkDeleteVMsResult:
      type: object
      properties:
        success:
          type: boolean
          description: '`true` if at least one VM was deleted successfully.'
        message:
          type: string
        total_count:
          type: integer
          description: Number of VMs requested for deletion.
        success_count:
          type: integer
          description: Number of VMs successfully deleted.
        failed_count:
          type: integer
          description: Number of VMs that failed to delete.
        results:
          type: array
          items:
            $ref: '#/components/schemas/BulkDeleteVMItemResult'
          description: Per-VM deletion results.
    BulkDeleteVMItemResult:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: VM ID.
        success:
          type: boolean
        message:
          type: string
        error:
          type: string
          description: Error detail if deletion failed.
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  responses:
    MissingProjectID:
      description: X-Project-ID header is required for this endpoint
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Bad Request
            message: X-Project-ID required
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication. Each key is bound to a specific account.

````