Skip to main content
POST
/
kvm
/
v2
/
upload_qcow2
Upload and replace qcow2
curl --request POST \
  --url https://{api_host}/kvm/v2/upload_qcow2 \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data signature=session_signature_12345 \
  --data kvm_id=kvm_xxxxx_yyyyy \
  --data valid_until=1737476000 \
  --data yes_purge_all_my_data=1 \
  --data file=@/path/to/your_cloudinit.qcow2 \
  --data pw=new-root-password \
  --data 'cloudinit_user_data=#cloud-config
user: root
password: "new-root-password"
ssh_pwauth: True
'
import requests

url = "https://{api_host}/kvm/v2/upload_qcow2"

payload = {
"signature": "session_signature_12345",
"kvm_id": "kvm_xxxxx_yyyyy",
"valid_until": "1737476000",
"yes_purge_all_my_data": "1",
"file": "@/path/to/your_cloudinit.qcow2",
"pw": "new-root-password",
"cloudinit_user_data": "#cloud-config
user: root
password: \"new-root-password\"
ssh_pwauth: True
"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}

response = requests.post(url, data=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
signature: 'session_signature_12345',
kvm_id: 'kvm_xxxxx_yyyyy',
valid_until: '1737476000',
yes_purge_all_my_data: '1',
file: '@/path/to/your_cloudinit.qcow2',
pw: 'new-root-password',
cloudinit_user_data: '#cloud-config\nuser: root\npassword: "new-root-password"\nssh_pwauth: True\n'
})
};

fetch('https://{api_host}/kvm/v2/upload_qcow2', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{api_host}/kvm/v2/upload_qcow2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "signature=session_signature_12345&kvm_id=kvm_xxxxx_yyyyy&valid_until=1737476000&yes_purge_all_my_data=1&file=%40%2Fpath%2Fto%2Fyour_cloudinit.qcow2&pw=new-root-password&cloudinit_user_data=%23cloud-config%0Auser%3A%20root%0Apassword%3A%20%22new-root-password%22%0Assh_pwauth%3A%20True%0A",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://{api_host}/kvm/v2/upload_qcow2"

payload := strings.NewReader("signature=session_signature_12345&kvm_id=kvm_xxxxx_yyyyy&valid_until=1737476000&yes_purge_all_my_data=1&file=%40%2Fpath%2Fto%2Fyour_cloudinit.qcow2&pw=new-root-password&cloudinit_user_data=%23cloud-config%0Auser%3A%20root%0Apassword%3A%20%22new-root-password%22%0Assh_pwauth%3A%20True%0A")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://{api_host}/kvm/v2/upload_qcow2")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("signature=session_signature_12345&kvm_id=kvm_xxxxx_yyyyy&valid_until=1737476000&yes_purge_all_my_data=1&file=%40%2Fpath%2Fto%2Fyour_cloudinit.qcow2&pw=new-root-password&cloudinit_user_data=%23cloud-config%0Auser%3A%20root%0Apassword%3A%20%22new-root-password%22%0Assh_pwauth%3A%20True%0A")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{api_host}/kvm/v2/upload_qcow2")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "signature=session_signature_12345&kvm_id=kvm_xxxxx_yyyyy&valid_until=1737476000&yes_purge_all_my_data=1&file=%40%2Fpath%2Fto%2Fyour_cloudinit.qcow2&pw=new-root-password&cloudinit_user_data=%23cloud-config%0Auser%3A%20root%0Apassword%3A%20%22new-root-password%22%0Assh_pwauth%3A%20True%0A"

response = http.request(request)
puts response.read_body
{
  "status": "success"
}
{
"error": "Invalid parameters provided.",
"code": 400
}
{
"error": "Invalid or expired session signature.",
"code": 401
}
{
"error": "Access to this resource is denied.",
"code": 403
}
{
"error": "An unexpected error occurred on the server.",
"code": 500
}

Body

application/x-www-form-urlencoded

Required parameters to upload and replace the qcow2 image.
All parameters must be passed in the request body as application/x-www-form-urlencoded or as file upload where specified.

signature
string

The session signature obtained from the "Create AUTH-session" call.

Example:

"session_signature_12345"

kvm_id
string

The unique identifier of the KVM VPS where the qcow2 image will be replaced.
This value is specific to your VPS.

Example:

"kvm_xxxxx_yyyyy"

valid_until
string

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"

yes_purge_all_my_data
integer

Confirmation to purge all data on the VPS.
This parameter must be set to 1 to proceed.

Example:

1

file
file

The qcow2 file to upload.
Provide the full path to the file.

pw
string

The new root password for the VPS.
Used if cloud-init is enabled.

Example:

"new-root-password"

cloudinit_user_data
string

Optional cloud-init configuration for the VPS.
See Cloud-init Documentation for examples.

Example:

"#cloud-config\nuser: root\npassword: \"new-root-password\"\nssh_pwauth: True\n"

Response

The qcow2 image was successfully uploaded and replaced on the VPS.

status
string

The status of the operation.

Example:

"success"

Last modified on December 17, 2025