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

# Restore a recently deleted virtual machine

> Creates a replacement VM from the final backup and charges the restore price from the wallet. The replacement has a new id and a new IP address and keeps the name and hostname. Pass `expectedTotal` from the quote to refuse the restore if the price changed (409 `QUOTE_CHANGED`). Returns 402 with the shortfall when the balance is too low and 402 `ACCOUNT_DEBT_OPEN` while the account has an unpaid balance. Requires the `vms:write` scope.

Idempotency-Key is not supported for this provider-side operation. A request containing that header returns 501 before mutation; requests without it retain the normal endpoint behavior.



## OpenAPI

````yaml https://api.vmarea.com/api/public/v1/openapi.json post /api/public/v1/vms/{id}/restore
openapi: 3.1.0
info:
  title: VMArea Public API
  version: 1.0.0
  description: >-
    The VMArea Public API lets you provision and manage VMs, firewalls, SSH
    keys, backups, and webhooks programmatically. Authenticate every request
    with an API token (`x-api-key` header). API access is in early access:
    tokens are not yet self-service in every account; contact hello@vmarea.com
    to request access. 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
    description: Production
security:
  - ApiKey: []
paths:
  /api/public/v1/vms/{id}/restore:
    post:
      tags:
        - VMs
      summary: Restore a recently deleted virtual machine
      description: >-
        Creates a replacement VM from the final backup and charges the restore
        price from the wallet. The replacement has a new id and a new IP address
        and keeps the name and hostname. Pass `expectedTotal` from the quote to
        refuse the restore if the price changed (409 `QUOTE_CHANGED`). Returns
        402 with the shortfall when the balance is too low and 402
        `ACCOUNT_DEBT_OPEN` while the account has an unpaid balance. Requires
        the `vms:write` scope.


        Idempotency-Key is not supported for this provider-side operation. A
        request containing that header returns 501 before mutation; requests
        without it retain the normal endpoint behavior.
      operationId: restoreVm
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                expectedTotal:
                  type: string
                  pattern: ^\d{1,10}(\.\d{1,4})?$
              additionalProperties: false
      responses:
        '202':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      vmId:
                        type: string
                      actionId:
                        type: string
                    required:
                      - vmId
                      - actionId
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                  message:
                    type: string
                  details:
                    type: object
                    additionalProperties: {}
                  data:
                    type: object
                    additionalProperties: {}
                required:
                  - success
                  - error
                additionalProperties: false
        '402':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                  message:
                    type: string
                  details:
                    type: object
                    additionalProperties: {}
                  data:
                    type: object
                    additionalProperties: {}
                required:
                  - success
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                  message:
                    type: string
                  details:
                    type: object
                    additionalProperties: {}
                  data:
                    type: object
                    additionalProperties: {}
                required:
                  - success
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                  message:
                    type: string
                  details:
                    type: object
                    additionalProperties: {}
                  data:
                    type: object
                    additionalProperties: {}
                required:
                  - success
                  - error
                additionalProperties: false
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                  message:
                    type: string
                  details:
                    type: object
                    additionalProperties: {}
                  data:
                    type: object
                    additionalProperties: {}
                required:
                  - success
                  - error
                additionalProperties: false
      security:
        - ApiKey: []
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        Long-lived API token (early access; contact hello@vmarea.com). Tokens
        are scope-restricted; this spec lists the scope each endpoint requires.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.