NAV
bash javascript php

Info

Welcome to the Venocix Reseller API. Please contact our support staff to obtain an access token.

Authentication

Authentication happens via a Bearer token. Place the token you were assigned in a "Authorization"-Header.

Example:

Authorization: Bearer 1|qpVodrZ3edt0DV4Q81dxQekTAessUHcH0Zjqv4t6

Requests

Ideally the API receives request data formatted as JSON.

Please don't forget to set appropriate headers:

Accept: application/json

Depending on how you send the request body data (ideally as JSON):

Content-Type: application/json

Example:

{
  "cpuCores": 4,
  "mem": 1024,
  "ipCount": 2,
  "template": "Ubuntu18.04"
}

Responses

All API responses are in JSON format. Result data is capsuled inside the result key. If an error happens, there will be a error key.

Example:

{
  "result": [
    "Ubuntu18.04"
  ]
}
{
  "result": false,
  "error": "0x01: no vm with id 4010 found"
}

Jobs

Get job info


Requires authentication

Example request:

curl -X GET \
    -G "https://reseller.hosterapi.de/api/v1/job/23" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/job/23"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://reseller.hosterapi.de/api/v1/job/23',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": {
        "status": "queued",
        "progress": 0,
        "output": null
    }
}

Example response (200):

{
    "result": {
        "status": "executing",
        "progress": 0.33,
        "output": null
    }
}

Example response (200):

{
    "result": {
        "status": "finished",
        "progress": 1,
        "output": {
            "vmid": 4001,
            "ips": [
                "37.114.XX.XXX"
            ],
            "user": "root",
            "password": "{password}"
        }
    }
}

Example response (200):

{
    "result": {
        "status": "failed",
        "progress": 0.33,
        "output": "0xb0: Requested resources exceed administrative limits"
    }
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0xc1: job not found"
}

HTTP Request

GET api/v1/job/{jobId}

URL Parameters

Parameter Status Description
jobId required Job ID

Server

Get current VM status


Requires authentication (is running, cpu usage, mem, etc.)

Example request:

curl -X GET \
    -G "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/status" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/status"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/status',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": {
        "cpu": 0,
        "mem": 455467008,
        "memfree": 577208320,
        "netin": 52240,
        "netout": 47492,
        "uptime": 1164,
        "state": "running"
    }
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

HTTP Request

GET api/v1/datacenter/server/{sid}/status

URL Parameters

Parameter Status Description
sid required Server ID

Get current VM config


Requires authentication (cpu usage, mem, etc.)

Example request:

curl -X GET \
    -G "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/config" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/config"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/config',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": {
        "cpuCount": 1,
        "mem": 1024,
        "disk": "10G",
        "ipCount": 1
    }
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

HTTP Request

GET api/v1/datacenter/server/{sid}/config

URL Parameters

Parameter Status Description
sid required Server ID

Remove VM


Requires authentication

Example request:

curl -X POST \
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/delete" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"force":false}'
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/delete"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "force": false
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/delete',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'force' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": true
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

Example response (500):

{
    "result": false,
    "error": "0xa3: timeout"
}

HTTP Request

POST api/v1/datacenter/server/{sid}/delete

URL Parameters

Parameter Status Description
sid required Server ID

Body Parameters

Parameter Type Status Description
force boolean optional optional Force delete vm, even if running

Set Server RDNS


Requires authentication

Example request:

curl -X POST \
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/rdns" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"ip":"ad","hostname":"blanditiis"}'
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/rdns"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "ip": "ad",
    "hostname": "blanditiis"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/rdns',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'ip' => 'ad',
            'hostname' => 'blanditiis',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": true
}

Example response (401):

{
    "result": false,
    "error": "0xb1: Missing required parameter template"
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

HTTP Request

POST api/v1/datacenter/server/{sid}/rdns

URL Parameters

Parameter Status Description
sid required Server ID

Body Parameters

Parameter Type Status Description
ip string required IP to set RDNS for
hostname string required RDNS FQDN

Upgrade/Downgrade VM


Requires authentication Please note that downgrading IPs is not supported at this time. Attempts at this will be silently ignored.

Example request:

curl -X PUT \
    "https://reseller.hosterapi.de/api/v1/datacenter/server/quas/change" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"cpuCores":4,"mem":2048,"disk":"10G","ipCount":2}'
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/quas/change"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "cpuCores": 4,
    "mem": 2048,
    "disk": "10G",
    "ipCount": 2
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/quas/change',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'cpuCores' => 4,
            'mem' => 2048,
            'disk' => '10G',
            'ipCount' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

HTTP Request

PUT api/v1/datacenter/server/{sid}/change

URL Parameters

Parameter Status Description
sid required Server ID

Body Parameters

Parameter Type Status Description
cpuCores integer optional Number of CPU cores
mem integer optional Memory size in MB
disk string optional Root disk size Note: Downgrading disk size is not allowed due to possible data loss
ipCount integer optional Number of IPs to assign

Start vm


Requires authentication

Example request:

curl -X PUT \
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/start" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/start"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/start',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": true
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

Example response (500):

{
    "result": false,
    "error": "0xa1: failed to send {signal} signal to vm"
}

HTTP Request

PUT api/v1/datacenter/server/{sid}/start

URL Parameters

Parameter Status Description
sid required Server ID

Gracefully stop VM


Requires authentication

Example request:

curl -X PUT \
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/shutdown" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/shutdown"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/shutdown',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": true
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

Example response (500):

{
    "result": false,
    "error": "0xa1: failed to send {signal} signal to vm"
}

HTTP Request

PUT api/v1/datacenter/server/{sid}/shutdown

URL Parameters

Parameter Status Description
sid required Server ID

Forcefully stop VM


Requires authentication

Example request:

curl -X PUT \
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/stop" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/stop"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/stop',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": true
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

Example response (500):

{
    "result": false,
    "error": "0xa1: failed to send {signal} signal to vm"
}

HTTP Request

PUT api/v1/datacenter/server/{sid}/stop

URL Parameters

Parameter Status Description
sid required Server ID

Gracefully restart VM


Requires authentication

Example request:

curl -X PUT \
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reboot" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reboot"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reboot',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": true
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

Example response (500):

{
    "result": false,
    "error": "0xa1: failed to send {signal} signal to vm"
}

HTTP Request

PUT api/v1/datacenter/server/{sid}/reboot

URL Parameters

Parameter Status Description
sid required Server ID

Force reboot VM


Requires authentication

Example request:

curl -X PUT \
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reboot/force" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reboot/force"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reboot/force',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": true
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

Example response (500):

{
    "result": false,
    "error": "0xa1: failed to send {signal} signal to vm"
}

HTTP Request

PUT api/v1/datacenter/server/{sid}/reboot/force

URL Parameters

Parameter Status Description
sid required Server ID

Reinstall VM


Requires authentication VM will be reinstalled matching the original config, including OS. Specify a template name to override automatic selection.

Example request:

curl -X PUT \
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reinstall" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"template":"Debian10.0"}'
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reinstall"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "template": "Debian10.0"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reinstall',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'template' => 'Debian10.0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": {
        "status": "queued",
        "jobId": 15,
        "progress": 0
    }
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

Example response (500):

{
    "result": false,
    "error": "0xa3: timeout"
}

HTTP Request

PUT api/v1/datacenter/server/{sid}/reinstall

URL Parameters

Parameter Status Description
sid required Server ID

Body Parameters

Parameter Type Status Description
template string optional optional Template to use (overrides automatic selection)

Reset root password


Requires authentication New password will be automatically generated and returned on success

Example request:

curl -X PUT \
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/password/reset" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/password/reset"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/password/reset',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": {
        "status": "success",
        "password": "{password}"
    }
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

Example response (500):

{
    "result": false,
    "error": "0xa1: failed to set config on vm"
}

HTTP Request

PUT api/v1/datacenter/server/{sid}/password/reset

URL Parameters

Parameter Status Description
sid required Server ID

List backups for VM


Requires authentication

Example request:

curl -X GET \
    -G "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/list" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/list"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/list',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": [
        1606685300,
        1606585800,
        1606575200
    ]
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

HTTP Request

GET api/v1/datacenter/server/{sid}/backups/list

URL Parameters

Parameter Status Description
sid required Server ID

Get backup task status


Requires authentication

Example request:

curl -X GET \
    -G "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/status" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/status"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/status',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": {
        "status": "pending",
        "progress": 0
    }
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

HTTP Request

GET api/v1/datacenter/server/{sid}/backups/status

URL Parameters

Parameter Status Description
sid required Server ID

Create backup


Requires authentication

Example request:

curl -X PUT \
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/create" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/create"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/create',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": true
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

Example response (500):

{
    "result": false,
    "error": "0xa3: timeout"
}

HTTP Request

PUT api/v1/datacenter/server/{sid}/backups/create

URL Parameters

Parameter Status Description
sid required Server ID

Restore VM from backup


Requires authentication

Example request:

curl -X POST \
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/restore" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"backup":1606345164}'
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/restore"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "backup": 1606345164
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/restore',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'backup' => 1606345164,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": "pending"
}

Example response (400):

{
    "result": false,
    "error": "0xa5: no target backup defined"
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

Example response (404):

{
    "result": false,
    "error": "0x01: no vm with id 4001 found"
}

Example response (500):

{
    "result": false,
    "error": "0xa1: failed to send {signal} signal to vm"
}

HTTP Request

POST api/v1/datacenter/server/{sid}/backups/restore

URL Parameters

Parameter Status Description
sid required Server ID

Body Parameters

Parameter Type Status Description
backup integer required Backup to restore (unix timestamp)

Create new VM


Requires authentication

Example request:

curl -X POST \
    "https://reseller.hosterapi.de/api/v1/datacenter/server" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"template":"Debian10.0","cpuCores":4,"mem":2048,"disk":"10G","ipCount":2}'
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "template": "Debian10.0",
    "cpuCores": 4,
    "mem": 2048,
    "disk": "10G",
    "ipCount": 2
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://reseller.hosterapi.de/api/v1/datacenter/server',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'template' => 'Debian10.0',
            'cpuCores' => 4,
            'mem' => 2048,
            'disk' => '10G',
            'ipCount' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": {
        "status": "queued",
        "jobId": 15,
        "progress": 0
    }
}

Example response (400):

{
    "result": false,
    "error": "0xb1: Missing required parameter template"
}

HTTP Request

POST api/v1/datacenter/server

Body Parameters

Parameter Type Status Description
template string required OS Template Name
cpuCores integer required Number of CPU cores
mem integer required Memory size in MB
disk string required Root disk size
ipCount integer required Number of IPs to assign

List all assigned VMs


Requires authentication

Example request:

curl -X GET \
    -G "https://reseller.hosterapi.de/api/v1/datacenter/server" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/server"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://reseller.hosterapi.de/api/v1/datacenter/server',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": [
        4001,
        4002,
        4003
    ]
}

Example response (200):

{
    "result": []
}

Example response (401):

{
    "result": false,
    "error": "0x03: unauthorized"
}

HTTP Request

GET api/v1/datacenter/server

Get available template list


Requires authentication

Example request:

curl -X GET \
    -G "https://reseller.hosterapi.de/api/v1/datacenter/templates" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://reseller.hosterapi.de/api/v1/datacenter/templates"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://reseller.hosterapi.de/api/v1/datacenter/templates',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "result": [
        "Debian10.0"
    ]
}

HTTP Request

GET api/v1/datacenter/templates