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

# Update a virtual machine

> Rename a VM and/or toggle deletion protection. At least one of `name` or `isProtected` must be provided. Requires the `vms:write` scope.



## OpenAPI

````yaml https://api.vmarea.com/api/public/v1/openapi.json patch /api/public/v1/vms/{id}
openapi: 3.1.0
info:
  title: VMArea Public API
  version: 1.0.0
  description: >-
    The VMArea Public API lets you provision and manage VMs, networks,
    firewalls, SSH keys, backups, and webhooks programmatically. Authenticate
    every request with an API token (`x-api-key` header) created in the
    dashboard. Tokens carry coarse scopes (e.g. `vms:write`); endpoints reject
    calls that lack the scope they require.
  contact:
    name: VMArea Support
    url: https://vmarea.com/support
servers:
  - url: https://api.vmarea.com/api/v1
    description: Production
security:
  - ApiKey: []
paths:
  /api/public/v1/vms/{id}:
    patch:
      tags:
        - VMs
      summary: Update a virtual machine
      description: >-
        Rename a VM and/or toggle deletion protection. At least one of `name` or
        `isProtected` must be provided. Requires the `vms:write` scope.
      operationId: updateVm
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                isProtected:
                  type: boolean
              additionalProperties: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      hostname:
                        type: string
                      status:
                        type: string
                      vcpu:
                        type: integer
                      ram:
                        type: integer
                      disk:
                        type: integer
                      bandwidth:
                        type: integer
                      networkSpeed:
                        type: integer
                      network10gEnabled:
                        type: boolean
                      dailyBackupEnabled:
                        type: boolean
                      isProtected:
                        type: boolean
                      ipAddress:
                        type: string
                        nullable: true
                      region:
                        type: object
                        properties:
                          slug:
                            type: string
                          name:
                            type: string
                        required:
                          - slug
                          - name
                        additionalProperties: false
                        nullable: true
                      plan:
                        type: object
                        properties:
                          slug:
                            type: string
                          name:
                            type: string
                          priceMonthly: {}
                        required:
                          - slug
                          - name
                        additionalProperties: false
                        nullable: true
                      osTemplate:
                        type: object
                        properties:
                          slug:
                            type: string
                          name:
                            type: string
                          version:
                            type: string
                            nullable: true
                        required:
                          - slug
                          - name
                          - version
                        additionalProperties: false
                        nullable: true
                      billing:
                        type: object
                        properties:
                          priceMonthly: {}
                          nextRenewalAt:
                            type: string
                            format: date-time
                            nullable: true
                          status:
                            type: string
                        required:
                          - nextRenewalAt
                          - status
                        additionalProperties: false
                        nullable: true
                      createdAt:
                        type: string
                        format: date-time
                      bandwidthUsedBytes:
                        type: number
                      bandwidthPackBytes:
                        type: string
                      sshKeys:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                            fingerprint:
                              type: string
                          required:
                            - id
                            - name
                            - fingerprint
                          additionalProperties: false
                      firewalls:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                          required:
                            - id
                            - name
                          additionalProperties: false
                      privateNetworks:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                          required:
                            - id
                            - name
                          additionalProperties: false
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - id
                      - name
                      - hostname
                      - status
                      - vcpu
                      - ram
                      - disk
                      - bandwidth
                      - networkSpeed
                      - network10gEnabled
                      - dailyBackupEnabled
                      - isProtected
                      - ipAddress
                      - region
                      - plan
                      - osTemplate
                      - billing
                      - createdAt
                      - bandwidthUsedBytes
                      - bandwidthPackBytes
                      - sshKeys
                      - firewalls
                      - privateNetworks
                      - updatedAt
                    additionalProperties: false
                    nullable: true
                required:
                  - success
                  - data
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                required:
                  - success
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                required:
                  - success
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                required:
                  - success
                  - error
                additionalProperties: false
      security:
        - ApiKey: []
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        Long-lived API token created at
        https://vmarea.com/dashboard/settings/api-keys. Tokens are
        scope-restricted; this spec lists the scope each endpoint requires.

````