Everything you need to manage VPS lifecycle, snapshots, and configurations via the Hostinger API — organized by topic, with plain-language explanations, SDKs, CLI, and automation recipes.
hPanel → Account Settings → API429 response means you've exceeded the limit — your IP may be temporarily blocked.| Method | Endpoint | Purpose |
|---|---|---|
| GET | /virtual-machines | List all VPS |
| GET | /virtual-machines/{id} | Get VPS details |
| POST | /virtual-machines | Create VPS |
| POST | /virtual-machines/{id}/start | Power on |
| POST | /virtual-machines/{id}/stop | Graceful shutdown |
| POST | /virtual-machines/{id}/restart | Restart |
| POST | /virtual-machines/{id}/recreate | Recreate |
| GET | /virtual-machines/{id}/metrics | CPU / RAM / traffic |
GET /virtual-machines/{id} to build your own uptime monitor — check the state field against running.| Method | Endpoint | Purpose |
|---|---|---|
| GET | /virtual-machines/{id}/snapshot | Get snapshot |
| POST | /virtual-machines/{id}/snapshot | Create snapshot |
| DELETE | /virtual-machines/{id}/snapshot | Delete snapshot |
| POST | /virtual-machines/{id}/snapshot/restore | Restore from snapshot |
Configuration endpoints:
| Method | Endpoint | Purpose |
|---|---|---|
| PUT | /virtual-machines/{id}/hostname | Set hostname |
| DELETE | /virtual-machines/{id}/hostname | Remove hostname |
| PUT | /virtual-machines/{id}/root-password | Reset root password |
| PUT | /virtual-machines/{id}/nameservers | Update nameservers |
| PUT | /virtual-machines/{id}/panel-password | Set panel password |
| GET | /virtual-machines/{id}/public-keys | List SSH keys |
| POST | /virtual-machines/{id}/setup | Run setup |
Post-install scripts — automate configuration at provisioning time:
| Method | Endpoint | Purpose |
|---|---|---|
| POST | /post-install-scripts | Create script |
| GET | /post-install-scripts | List scripts |
| GET | /post-install-scripts/{id} | Get specific script |
| PUT | /post-install-scripts/{id} | Update script |
| DELETE | /post-install-scripts/{id} | Delete script |
list() instead of manually building an HTTP request, and you get typed, predictable responses back. The CLI (hapi) is for quick one-off actions straight from your terminal, no code required at all — handy for scripts, cron jobs, or just checking on a server fast.
These are all different ways to control your VPS from outside hPanel — same actions (start, stop, snapshot, etc.), different tool depending on how you like to work. Tap a card to see what each one is actually for:
Click a recipe to see how it's built:
GET /virtual-machines/{id} on a schedulerunningGET /virtual-machines/{id}/metricsPOST /snapshot before a scheduled maintenance windowWant to build your own version of this? The same MCP foundation is available to anyone via the Hostinger API. Click to see the setup at a glance:
npm install -g hostinger-api-mcpSetting this up only requires installing Node.js and the CLI, then pointing your AI tool at your token — no coding required beyond following the setup steps.
Click each item to check it off.
Authorization: Bearer YOUR_API_TOKEN429 rate-limit responses is in place (backoff/retry)Q1. What HTTP status code indicates you've hit the rate limit?
Q2. Which endpoint gives you CPU, RAM, and traffic data for a VPS?
Q3. When does a snapshot auto-delete?
Q4. What are post-install scripts used for?
Q5. What does the MCP Server enable?