VirtFusion Global API
  1. Servers
VirtFusion Global API
  • General
    • Test connection
      GET
  • Hypervisors
    • Retrieve hypervisors
      GET
    • Retrive a Hypervisor
      GET
  • Hypervisor Groups
    • Retrieve hypervisor groups
      GET
    • Retrieve a hypervisor group
      GET
    • Retrieve a hypervisor groups resources
      GET
  • Servers
    • Network
      • Firewall
        • Disable firewall
        • Enable firewall
        • Retrieve firewall
        • Apply firewall rulesets
      • Add an address to the whitelist
      • Remove an address from the whitelist
      • Add a quantity of IPv4 addresses
      • Add an array of IPv4 addresses
      • Remove an array of IPv4 addresses
    • Power
      • Boot a server
      • Shutdown a server
      • Restart a server
      • Poweroff a server
    • Traffic
      • Add a traffic block to a server
      • Remove a traffic block from a server
      • Retrieve a servers traffic blocks
    • Retrieve a server
      GET
    • Add, remove or modify a backup plan
      PUT
    • Build a server
      POST
    • Change a server package
      PUT
    • Create a server
      POST
    • Delete a server
      DELETE
    • Retrieve servers
      GET
    • Modify a server name
      PUT
    • Reset a server password
      POST
    • Retrieve a users servers
      GET
    • Retrieve OS templates available to a server
      GET
    • Suspend a server
      POST
    • Throttle a servers CPU
      PUT
    • Retrieve a servers traffic statistics
      GET
    • Unsuspend a server
      POST
    • Enable or disable VNC for a server
      POST
    • Change Owner
      PUT
    • Modify primary traffic allowance
      PUT
  • IP Blocks
    • Add an IPv4 range to an IP block
    • Retrieve IP blocks
    • Retrieve an IP block
  • Backups
    • Retrieve a server backups
  • DNS
    • Retrieve a DNS service
  • Media
    • Retrieve an ISO
    • Retrieve operating system templates that are available for a package
  • Packages
    • Retrieve packages
    • Retrieve a packge
  • Queue & Tasks
    • Retrieve a queue item
  • SSH Keys
    • Add an SSH key to a user account
    • Delete an SSH key from a user
    • Retrieve a users SSH keys
    • Retrieve an SSH key
  • Users
    • External Relational ID
      • Delete a user
      • Generate a set of login tokens
      • Generate a set of loging tokens using a server ID
      • Modify a user
      • Change a user passowrd
      • Retrieve a user
    • Create a user
  • Self Service
    • External Relational ID
      • Add credit to user
      • Add an hourly group profile to a user
      • Add a resource group profile to a user
      • Add a resource pack to a user
      • Retrieve hourly statistics
      • Modify user access
      • Remove hourly group profile from a user
      • Remove resource group from a user
      • Generate a report
      • Set an hourly resource pack
      • Retrieve a users usage
    • Cancel credit that was applied to a user
    • Delete all servers attached to a pack ID
    • Delete a user resource pack
    • Retrieve a user resource pack
    • Modify user resource pack
    • Retrieve currencies
    • Suspend all servers assigned to a reosurce pack
    • Unsuspend all servers assigned to a reosurce pack
  1. Servers

Build a server

Developing
POST
/servers/{serverId}/build

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params

Body Params application/json

Example
{
    "operatingSystemId": 1,
    "name": "server 1",
    "hostname": "server1.domain.com",
    "sshKeys": [
        1,
        2,
        3,
        4
    ],
    "vnc": false,
    "ipv6": false,
    "swap": 512,
    "email": true
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/servers/9/build' \
--header 'Content-Type: application/json' \
--data-raw '{
    "operatingSystemId": 1,
    "name": "server 1",
    "hostname": "server1.domain.com",
    "sshKeys": [
        1,
        2,
        3,
        4
    ],
    "vnc": false,
    "ipv6": false,
    "swap": 512,
    "email": true
}'

Responses

🟢200OK
application/json
Body

Example
{
    "data": {
        "id": 9,
        "ownerId": 3,
        "hypervisorId": 6,
        "arch": 1,
        "name": "server 1",
        "selfService": 0,
        "selfServiceSettings": [],
        "hostname": "server1.domain.com",
        "commissionStatus": 1,
        "uuid": "5de5a89b-b707-41bf-a051-7af1a4e67795",
        "state": "queued",
        "migratable": true,
        "timezone": "_default",
        "migrateLevel": 0,
        "deleteLevel": 0,
        "configLevel": 1,
        "backupLevel": 0,
        "elevated": false,
        "elevateId": null,
        "elevate": false,
        "destroyable": true,
        "rebuild": false,
        "suspended": false,
        "protected": false,
        "buildFailed": false,
        "primaryNetworkDhcp4": false,
        "primaryNetworkDhcp6": false,
        "built": "2024-11-29T19:32:17+00:00",
        "created": "2024-04-11T17:22:19+00:00",
        "updated": "2025-01-20T13:32:44+00:00",
        "traffic": {
            "public": {
                "countMethod": 1,
                "currentPeriod": {
                    "start": "2025-01-11T00:00:00.000000Z",
                    "end": "2025-02-10T23:59:59.999999Z",
                    "limit": 200
                }
            }
        },
        "settings": {
            "osTemplateInstall": true,
            "osTemplateInstallId": 1,
            "encryptedPassword": "eyJpdiI6IjVsdWVBMzNNWnVXZzlYMjhlTUMzSXc9PSIsInZhbHVlIjoiT2E3SDNmVTVCOW1GK1RCd0h6YjZwZnIva1ZHbU9rQU1VL1hsQSthcUVRYz0iLCJtYWMiOiIzMzdmNjkxOTcwMjkxYmM2ZmNlMjgyMzdkMTQzMDY2OWY1ZTBlYjExYzA1MjdjMzZmMTU1ZTVlMGFiMWY2ZmJlIiwidGFnIjoiIn0=",
            "backupPlan": null,
            "uefi": false,
            "uefiType": 0,
            "cloudInit": true,
            "cloudInitType": 1,
            "config": {
                "cloud.init": {
                    "on.all": {
                        "user.data": {
                            "runcmd": [
                                "DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get --option=Dpkg::Options::=--force-confold --option=Dpkg::options::=--force-unsafe-io --assume-yes --quiet update",
                                "DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get --option=Dpkg::Options::=--force-confold --option=Dpkg::options::=--force-unsafe-io --assume-yes --quiet dist-upgrade"
                            ]
                        }
                    },
                    "on.password": {
                        "user.data": []
                    },
                    "on.sshkey": {
                        "user.data": []
                    },
                    "on.allpre": {
                        "user.data": []
                    },
                    "on.allpost": {
                        "user.data": []
                    },
                    "on.network": [],
                    "on.network.libvirtrouted": []
                }
            },
            "userConfig": [],
            "bootOrder": [
                "hd",
                "cdrom"
            ],
            "tpmType": 0,
            "networkBoot": false,
            "bootMenu": 1,
            "customISO": 1,
            "securityDriver": 3,
            "memBalloon": {
                "model": 1,
                "autoDeflate": 0,
                "freePageReporting": 0
            },
            "hyperv": {
                "enabled": false,
                "passthrough": false,
                "relaxed": 0,
                "vapic": 0,
                "spinlocks": 0,
                "vpindex": 0,
                "runtime": 0,
                "synic": 0,
                "stimer": 0,
                "reset": 0,
                "vendorId": 0,
                "frequencies": 0,
                "reenlightenment": 0,
                "tlbflush": 0,
                "ipi": 0,
                "evmcs": 0,
                "vendorIdValue": "KVM VM",
                "spinlocksValue": 8191,
                "clockEnabled": 0
            },
            "extended": {
                "cpuFlags": {
                    "topoext": "1",
                    "svm": "1",
                    "vmx": "1"
                }
            },
            "machineType": "inherit",
            "pciPorts": 16,
            "resources": {
                "memory": 2048,
                "storage": 10,
                "traffic": 200,
                "cpuCores": 1
            },
            "decryptedPassword": "uv1dmfUUaENhNpbrGUwD"
        },
        "cpu": {
            "cores": 1,
            "type": "inherit",
            "typeExact": "host-model",
            "shares": 1024,
            "throttle": 0,
            "topology": {
                "enabled": false,
                "sockets": 1,
                "cores": 1,
                "threads": 1,
                "dies": 1
            }
        },
        "customXML": {
            "domain": {
                "xml": "",
                "enabled": false
            },
            "os": {
                "xml": "",
                "enabled": false
            },
            "devices": {
                "xml": "",
                "enabled": false
            },
            "features": {
                "xml": "",
                "enabled": false
            },
            "clock": {
                "xml": "",
                "enabled": false
            },
            "cpuTune": {
                "xml": "",
                "enabled": false
            }
        },
        "qemuCommandline": [],
        "qemuAgent": {
            "os": {
                "screen": "iVBORw0KGgoAAAANSUhEUgAAAJYAAABTCAAAAABYT6E5AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfpARESACeS8jvVAAAI2klEQVRo3u2W+XMjxRXHX3fPfWhG1+i0ZMmXbK3t9dq7bFg2ARKgSFWSn5If8+/lx1xFhSpCQSWppVhYWKB2F+y1JV+yLI1kndbcnR98LBACJGxCUjWfH3r6eN39puf1dx7A/yboiy2EvsHiv+wY+vL2CP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WTGgtouOorfD07EBCYr7Ye95+2OzVltMY57VBj0Zn1mxIwTAXInLkqM1ZOgVzLdQcniXS44LjdjJ5GRfmLHMd2DDAFIAoh8tJwvFNKz5zIL7IXeKsLFB4+IDNEh+STpi3MgKQAAYFwItwwAGs8DiOhc3aPcxZ8EACJnCh9/EkQKAIAhAyg8gHKpIjc/nt9+9RNWHOzM7pTt6WNEpWgPRE/yWS8/+T0kNrq8M44OVW8Ajmn3+GsTgkbABUjYTTbr0Z9+Jh0YvcXGWD1+QDfeXZzceIdwZIw/YF5uprenTVfNdyZC5LfqzU72w0b+Rh33JJQatDOb27klK7ASd9WpoPTnuPvqh6mD0m7hdRrAy0f4SOIGbwXdmsvdc997cHfHsGosexXYLcvtOX5KTrGMxwvbPSzh0cTxIeaZ4AvM5ogVSN+hVo2YAiPUvKG7Q+HEmwQO9bdPfQLM8MDBDBOYJu37+0ApZzZp/xB3BQ72rclol1Lqyfsnkw5Azez4Rx5nHvLHsXkK9uMnwgoAQM5SRrF0mUriRQm+E/9qDooxAACq9q6+NWXN3FlqKm6w++UlKVxI3Rf66T9rfKP1txwiP5sQ8bl6sl1gV8vikWh/+RW/n4wbqWOGgCW6rIOWrS1sf/clQ0JCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQp4afwdRMMFLNhfN2wAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNS0wMS0xN1QxODowMDozOSswMDowMDazUncAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjUtMDEtMTdUMTg6MDA6MzkrMDA6MDBH7urLAAAAAElFTkSuQmCC"
            }
        },
        "media": {
            "isoMounted": false,
            "isoType": "local",
            "isoName": "",
            "isoFilename": "",
            "isoUrl": "",
            "isoDownload": false
        },
        "backupPlan": {
            "id": null,
            "name": null
        },
        "vnc": {
            "ip": "192.168.4.2",
            "port": 5901,
            "enabled": false
        },
        "network": {
            "interfaces": [
                {
                    "id": 9,
                    "order": 1,
                    "enabled": true,
                    "tag": 4238114467,
                    "name": "eth0",
                    "type": "public",
                    "driver": 1,
                    "processQueues": null,
                    "mac": "00:C3:BA:23:37:B3",
                    "ipv4ToMac": null,
                    "ipv6ToMac": null,
                    "inTrafficCount": true,
                    "outTrafficCount": false,
                    "inAverage": 0,
                    "inPeak": 0,
                    "inBurst": 0,
                    "outAverage": 0,
                    "outPeak": 0,
                    "outBurst": 0,
                    "ipFilter": true,
                    "vlans": [],
                    "ipFilterType": "4",
                    "portIsolated": false,
                    "ipv4_resolver_1": 1,
                    "ipv4_resolver_2": 2,
                    "ipv6_resolver_1": 1,
                    "ipv6_resolver_2": 2,
                    "networkProfile": 0,
                    "dhcpV4": 0,
                    "dhcpV6": 0,
                    "firewallEnabled": false,
                    "hypervisorNetwork": 6,
                    "isNat": false,
                    "nat": false,
                    "firewall": [],
                    "hypervisorConnectivity": {
                        "id": 6,
                        "type": "simpleBridge",
                        "bridge": "br0",
                        "mtu": null,
                        "primary": true,
                        "default": true
                    },
                    "ipWhitelist": [
                        {
                            "id": 1,
                            "type": 4,
                            "ip": "100.100.100.100",
                            "mask": 32
                        },
                        {
                            "id": 2,
                            "type": 4,
                            "ip": "10.0.0.10",
                            "mask": 32
                        }
                    ],
                    "actions": [],
                    "ipv4": [
                        {
                            "id": 22,
                            "order": 1,
                            "enabled": true,
                            "blockId": 1,
                            "address": "192.168.4.21",
                            "gateway": "192.168.4.1",
                            "netmask": "255.255.254.0",
                            "resolver1": "8.8.8.8",
                            "resolver2": "8.8.4.4",
                            "rdns": null,
                            "mac": null
                        },
                        {
                            "id": 37,
                            "order": 2,
                            "enabled": true,
                            "blockId": 1,
                            "address": "192.168.4.36",
                            "gateway": "192.168.4.1",
                            "netmask": "255.255.254.0",
                            "resolver1": "8.8.8.8",
                            "resolver2": "8.8.4.4",
                            "rdns": null,
                            "mac": null
                        },
                        {
                            "id": 38,
                            "order": 3,
                            "enabled": true,
                            "blockId": 1,
                            "address": "192.168.4.37",
                            "gateway": "192.168.4.1",
                            "netmask": "255.255.254.0",
                            "resolver1": "8.8.8.8",
                            "resolver2": "8.8.4.4",
                            "rdns": null,
                            "mac": null
                        }
                    ],
                    "ipv6": []
                }
            ],
            "secondaryInterfaces": []
        },
        "storage": [
            {
                "_id": 11,
                "id": 1,
                "cache": null,
                "bus": null,
                "capacity": 10,
                "drive": "a",
                "datastoreDiskId": null,
                "filesystem": null,
                "iops": {
                    "read": null,
                    "write": null
                },
                "bytes": {
                    "read": null,
                    "write": null
                },
                "type": "qcow2",
                "profile": 0,
                "status": 3,
                "enabled": true,
                "primary": true,
                "created": "2024-04-11T17:22:19+00:00",
                "updated": "2024-04-11T17:22:19+00:00",
                "datastore": [],
                "name": "5de5a89b-b707-41bf-a051-7af1a4e67795_1",
                "filename": "5de5a89b-b707-41bf-a051-7af1a4e67795_1.img",
                "hypervisorStorageId": null,
                "local": true,
                "locationType": "mountpoint",
                "path": "/home/vf-data/disk"
            }
        ],
        "hypervisorAssets": [],
        "hypervisor": {
            "id": 6,
            "ip": "192.168.4.2",
            "hostname": null,
            "port": 8892,
            "maintenance": false,
            "groupId": 2,
            "group": {
                "name": "Test",
                "icon": null
            },
            "timezone": "Europe/London",
            "forceIPv6": false,
            "vncListenType": 1,
            "displayName": null,
            "cpuSet": null,
            "nfType": 4,
            "backupStorageType": 2,
            "defaultDiskType": "inherit",
            "defaultDiskCacheType": "inherit",
            "defaultCPU": "inherit",
            "defaultMachineType": "inherit",
            "created": "2024-03-30T09:53:38+00:00",
            "updated": "2024-12-06T21:25:54+00:00",
            "name": "BHV 1",
            "dataDir": "/home/vf-data",
            "resources": {
                "servers": {
                    "units": "#",
                    "max": 0,
                    "allocated": 5,
                    "free": -5,
                    "percent": null
                },
                "memory": {
                    "units": "MB",
                    "max": 29419,
                    "allocated": 7168,
                    "free": 22251,
                    "percent": 24.4
                },
                "cpuCores": {
                    "units": "#",
                    "max": 128,
                    "allocated": 6,
                    "free": 122,
                    "percent": 4.7
                },
                "localStorage": {
                    "enabled": 1,
                    "name": "Local (Default mountpoint)",
                    "storageType": 1,
                    "units": "GB",
                    "max": 1000,
                    "allocated": 141,
                    "free": 859,
                    "percent": 14.1
                },
                "otherStorage": []
            }
        },
        "owner": {
            "id": 3,
            "admin": false,
            "extRelationId": 1,
            "name": "jon Doe",
            "email": "jon@doe.com",
            "timezone": "Europe/London",
            "suspended": false,
            "twoFactorAuth": false,
            "created": "2025-01-20T12:48:20+00:00",
            "updated": "2025-01-20T13:00:38+00:00"
        },
        "sshKeys": [],
        "sharedUsers": [],
        "tasks": {
            "active": true,
            "lastOn": "2024-11-29 19:32:17",
            "actions": {
                "pending": []
            }
        }
    }
}
🟠401401
Modified at 2025-05-05 18:43:58
Previous
Add, remove or modify a backup plan
Next
Change a server package
Built with