For the complete documentation index, see llms.txt. This page is also available as Markdown.

Setup purchased virtual machine

Setup newly purchased virtual machine with initial state. Use this endpoint to configure and initialize purchased VPS instances.

Setup purchased virtual machine

post

Setup newly purchased virtual machine with initial state.

Use this endpoint to configure and initialize purchased VPS instances.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
virtualMachineIdintegerRequired

Virtual Machine ID

Example: 1268054
Body
template_idintegerRequired

Template ID

Example: 1130
data_center_idintegerRequired

Data center ID

Example: 19
post_install_script_idintegerOptional

Post-install script ID

Example: 6324
passwordstring · password · min: 12Optional

Password for the virtual machine. If not provided, random password will be generated. Password will not be shown in the response.

Example: oMeNRustosIO
hostnamestringOptional

Override default hostname of the virtual machine

Example: my.server.tld
install_monarxbooleanOptional

Install Monarx malware scanner (if supported)

Default: falseExample: false
enable_backupsbooleanOptional

Enable weekly backup schedule

Default: trueExample: true
ns1stringOptional

Name server 1

Example: 4.3.2.1
ns2stringOptional

Name server 2

Example: 1.2.3.4
Responses
200

Success response

application/json
idintegerOptional

Virtual machine ID

Example: 17923
firewall_group_idinteger · nullableOptional

Active firewall ID, null if disabled

subscription_idstring · nullableOptional

Subscription ID

Example: Azz353Uhl1xC54pR0
data_center_idinteger · nullableOptional

Data center ID

Example: 521
planstring · nullableOptional

VPS plan name

Example: KVM 4
hostnamestringOptionalExample: srv17923.hstgr.cloud
statestring · enumOptionalExample: runningPossible values:
actions_lockstring · enumOptionalExample: unlockedPossible values:
cpusintegerOptional

CPUs count assigned to virtual machine

Example: 4
memoryintegerOptional

Memory available to virtual machine (in megabytes)

Example: 8192
diskintegerOptional

Virtual machine disk size (in megabytes)

Example: 51200
bandwidthintegerOptional

Monthly internet traffic available to virtual machine (in megabytes)

Example: 1073741824
ns1string · nullableOptional

Primary DNS resolver

Example: 1.1.1.1
ns2string · nullableOptional

Secondary DNS resolver

Example: 8.8.8.8
ipv4one of · nullableOptional

IPv4 address of virtual machine

ipv6one of · nullableOptional

IPv6 address of virtual machine, null if not assigned

templateone of · nullableOptional

OS template installed in virtual machine

created_atstring · date-timeOptionalExample: 2024-09-05T07:25:36.00000Z
post/api/vps/v1/virtual-machines/{virtualMachineId}/setup
POST /api/vps/v1/virtual-machines/{virtualMachineId}/setup HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 284

{
  "template_id": 1130,
  "data_center_id": 19,
  "post_install_script_id": 6324,
  "password": "oMeNRustosIO",
  "hostname": "my.server.tld",
  "install_monarx": false,
  "enable_backups": true,
  "ns1": "4.3.2.1",
  "ns2": "1.2.3.4",
  "public_key": {
    "name": "my-key",
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC2X..."
  }
}
{
  "id": 17923,
  "firewall_group_id": null,
  "subscription_id": "Azz353Uhl1xC54pR0",
  "data_center_id": 521,
  "plan": "KVM 4",
  "hostname": "srv17923.hstgr.cloud",
  "state": "running",
  "actions_lock": "unlocked",
  "cpus": 4,
  "memory": 8192,
  "disk": 51200,
  "bandwidth": 1073741824,
  "ns1": "1.1.1.1",
  "ns2": "8.8.8.8",
  "ipv4": [
    {
      "id": 52347,
      "address": "213.331.273.15",
      "ptr": "something.domain.tld"
    }
  ],
  "ipv6": [
    {
      "id": 52347,
      "address": "213.331.273.15",
      "ptr": "something.domain.tld"
    }
  ],
  "template": {
    "id": 6523,
    "name": "Ubuntu 20.04 LTS",
    "description": "Ubuntu 20.04 LTS",
    "documentation": "https://docs.ubuntu.com"
  },
  "created_at": "2024-09-05T07:25:36.00000Z"
}

Last updated

Was this helpful?