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

Recreate virtual machine

Recreate a virtual machine from scratch.

Recreate virtual machine

post

Recreate a virtual machine from scratch.

The recreation process involves reinstalling the operating system and resetting the virtual machine to its initial state. Snapshots, if there are any, will be deleted.

Password Requirements

Password will be checked against leaked password databases. Requirements for the password are:

  • At least 12 characters long
  • At least one uppercase letter
  • At least one lowercase letter
  • At least one number
  • Is not leaked publicly

This operation is irreversible and will result in the loss of all data stored on the virtual machine!

Use this endpoint to completely rebuild VPS instances with fresh OS installation.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
virtualMachineIdintegerRequired

Virtual Machine ID

Example: 1268054
Body
template_idintegerRequired

Template ID

Example: 1130
passwordstring · password · min: 12Optional

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

Example: oMeNRustosIO
panel_passwordstring · password · min: 12Optional

Panel password for the panel-based OS template. If not provided, random password will be generated. If OS does not support panel_password this field will be ignored. Password will not be shown in the response.

Example: Mna58c17a4d
post_install_script_idintegerOptional

Post-install script to execute after virtual machine was recreated

Example: 6324
Responses
200

Success response

application/json
idintegerOptional

Action ID

Example: 8123712
namestringOptional

Action name

Example: action_name
statestring · enumOptional

Action state

Example: successPossible values:
created_atstring · date-timeOptionalExample: 2025-02-27T11:54:00Z
updated_atstring · date-timeOptionalExample: 2025-02-27T11:58:00Z
post/api/vps/v1/virtual-machines/{virtualMachineId}/recreate
POST /api/vps/v1/virtual-machines/{virtualMachineId}/recreate HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 107

{
  "template_id": 1130,
  "password": "oMeNRustosIO",
  "panel_password": "Mna58c17a4d",
  "post_install_script_id": 6324
}
{
  "id": 8123712,
  "name": "action_name",
  "state": "success",
  "created_at": "2025-02-27T11:54:00Z",
  "updated_at": "2025-02-27T11:58:00Z"
}

Last updated

Was this helpful?