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

# Reinstall

> This endpoint reinstalls the operating system on the specified KVM VPS.  
The `api_host` parameter, obtained from the "Create AUTH-session" response, 
is dynamically set in the URL.  
Provide the `signature`, `kvm_id`, `valid_until`, and other required parameters 
to execute the reinstallation.




## OpenAPI

````yaml post /kvm/v2/set/reinstall
openapi: 3.0.0
info:
  title: EDIS Global Management API
  description: >
    Use the API to access and manage your VPS services, including power control,
    rDNS, and VNC management.  

    **Authentication:** Enable API access on any KVM VPS you own. Then use the
    provided credentials to authenticate your requests.
  version: 1.0.0
servers:
  - url: https://{api_host}
    description: Dynamic API host returned from the AUTH session endpoint.
    variables:
      api_host:
        default: api_host.edisglobal.com
        description: >-
          Enter the full API host exactly as returned by /kvm/v2/get/auth (for
          example: 12345.edisglobal.com)
security: []
tags:
  - name: Authentication
    description: Create an AUTH Session
  - name: Power Management
    description: KVM Power Management
  - name: Installation
    description: ISO, Turnkey, Reinstall
  - name: Settings
    description: KVM System Settings
  - name: Collect Information
    description: KVM VPS Details.
  - name: VNC Management
    description: KVM VNC Access
  - name: PTR
    description: KVM Reverse DNS
  - name: Traffic Pool
    description: Traffic Pool Management
  - name: Hooks
    description: KVM Webhook Management
paths:
  /kvm/v2/set/reinstall:
    post:
      tags:
        - Installation
      summary: Reinstall
      description: >
        This endpoint reinstalls the operating system on the specified KVM
        VPS.  

        The `api_host` parameter, obtained from the "Create AUTH-session"
        response, 

        is dynamically set in the URL.  

        Provide the `signature`, `kvm_id`, `valid_until`, and other required
        parameters 

        to execute the reinstallation.
      operationId: reinstallVPS
      requestBody:
        description: >
          Required parameters to reinstall the operating system.  

          All parameters must be passed in the request body as
          `application/x-www-form-urlencoded`.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/set_reinstall_body'
        required: true
      responses:
        '200':
          description: The operating system was successfully reinstalled on the VPS.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_3'
        '400':
          description: Bad Request - Invalid parameters or missing fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400_4'
        '401':
          description: Unauthorized - The session signature is invalid or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_401_4'
        '403':
          description: Forbidden - You do not have permission to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_403_3'
        '500':
          description: Internal Server Error - An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_500_4'
components:
  schemas:
    set_reinstall_body:
      type: object
      properties:
        signature:
          type: string
          description: The session signature obtained from the "Create AUTH-session" call.
          example: session_signature_12345
        kvm_id:
          type: string
          description: |
            The unique identifier of the KVM VPS to reinstall.  
            This value is specific to your VPS.
          example: kvm_xxxxx_yyyyy
        valid_until:
          type: string
          description: >
            The expiration timestamp for the session, as obtained from the
            "Create AUTH-session" call.  

            Ensure that the session is valid and has not expired.
          example: '1737476000'
        image:
          type: string
          description: >
            The name of the operating system image to install.  

            Use the `get autoinstall images` endpoint to retrieve available
            images.
          example: debian-bullseye
        password:
          type: string
          description: >-
            The root password for the new installation.


            ⚠️ If "cloudinit_user_data" is provided, this parameter may be
            ignored depending on the cloud-init configuration.
          example: your-password
        cloudinit_user_data:
          type: string
          description: >-
            Optional cloud-init configuration for supported images.


            Example:

            ```yaml

            #cloud-config

            write_files:
              - path: /etc/apt/apt.conf.d/99force-ipv4
                content: |
                  Acquire::ForceIPv4 'true';
                owner: 'root:root'
                permissions: '0644'
            set_hostname: kvmtest

            user: root

            password: YOUR_ROOT_PASSWORD

            disable_root: false

            disable_root_opts: ''

            ssh_pwauth: False

            ssh_authorized_keys:
              - ssh-rsa YOUR_SSH_KEY
            manage_etc_hosts: true

            expire: False

            runcmd:
              - chage -d 19000 root
              - [ /usr/bin/sed, -i, -E, 's/disable_root:.*true/disable_root: false/i', /etc/cloud/cloud.cfg ]
              - [ /usr/bin/sed, -i, -E, 's/PermitRootLogin.*/PermitRootLogin without-password/i', /etc/ssh/sshd_config ]
              - [ /usr/bin/sed, -i, -E, 's/#PermitRootLogin.*/PermitRootLogin yes/i', /etc/ssh/sshd_config ]
            users:
              - default
            power_state:
              delay: now
              mode: reboot
              message: Bye Bye
              timeout: 30
              condition: True
            package_update: false

            package_upgrade: false

            ```


            Refer to the [Cloud-init
            documentation](https://cloudinit.readthedocs.io/en/latest/reference/examples.html)
            for details.
    inline_response_200_3:
      type: object
      properties:
        status:
          type: string
          description: The status of the operation.
          example: success
    inline_response_400_4:
      type: object
      properties:
        error:
          type: string
          description: Description of the error.
          example: Invalid parameters provided.
        code:
          type: integer
          example: 400
    inline_response_401_4:
      type: object
      properties:
        error:
          type: string
          description: Description of the error.
          example: Invalid or expired session signature.
        code:
          type: integer
          example: 401
    inline_response_403_3:
      type: object
      properties:
        error:
          type: string
          description: Description of the error.
          example: Access to this resource is denied.
        code:
          type: integer
          example: 403
    inline_response_500_4:
      type: object
      properties:
        error:
          type: string
          description: Description of the error.
          example: An unexpected error occurred on the server.
        code:
          type: integer
          example: 500

````