Think of a restaurant again. hPanel is the dining room: a person looks at the menu and asks the waiter. The API is the order window for programs: a script, an app or an AI agent sends an order in a fixed format and gets a fixed-format answer back.
Why customers use it: to automate (restart a VPS every night, take a snapshot before every update), to connect Hostinger to other tools (dashboards, n8n workflows, Terraform), or to let an AI agent manage their services.
| Item | What to know |
|---|---|
| Address | All requests go to https://developers.hostinger.com, with paths like /api/vps/v1/…, /api/hosting/v1/…, /api/dns/v1/… |
| Products | VPS, web hosting, Agency hosting, domains, DNS, email, billing, ecommerce and more. The VPS part alone has about 65 operations. |
| Documentation | developers.hostinger.com lists every operation, with examples |
| Status | The API is officially in beta |
| Format | JSON in, JSON out |
| Rate limit | 90 requests per minute per user. Above that: error 429 with a Retry-After header saying how long to wait |
Authorization: Bearer <token>.Many customers never write API code themselves. They use a tool that calls the API for them, so "the API" can be behind any of these:
| Tool | What it is |
|---|---|
Hostinger CLI (hostinger) | Commands in a terminal, for example hostinger vps vm start <id> |
| SDKs | Ready-made libraries for PHP, Python and TypeScript/Node |
| MCP server / Hostinger connector | Lets AI agents (Claude, ChatGPT, Cursor…) manage the account in plain language |
| Terraform, Ansible | Infrastructure tools: "keep my servers like this file says" |
| n8n, WHMCS | Automation workflows; reselling/billing systems |
| Postman collection | Try requests by clicking, no code |
When an AI agent connects through Hostinger's MCP service, an entry such as hostinger-remote-mcp or GuzzleHttp, marked "Direct API", can show up in the customer's account. That's expected, not a hack.
Every API call has the same parts. Here's "show me the details of VPS 2196542":
GET https://developers.hostinger.com/api/vps/v1/virtual-machines/2196542 Authorization: Bearer YOUR_API_TOKEN Accept: application/json
| Part | In the example | Meaning |
|---|---|---|
| Method | GET | What kind of order (table below) |
| Address (endpoint) | /api/vps/v1/virtual-machines/2196542 | Which product (vps), which version (v1), which thing (virtual-machines), which one (2196542, the VPS ID) |
| Header | Authorization: Bearer … | Who is asking (the token) |
| Body | (none here) | Extra data, as JSON, for calls that create or change something |
| Method | Means | Example |
|---|---|---|
GET | Read. Changes nothing. | VPS details, metrics, list of backups |
POST | Do something / create | Restart, create snapshot, restore backup |
PUT | Change a setting | Set hostname, set root password |
DELETE | Remove | Delete snapshot, remove SSH key |
The response starts with a number that says how it went, then a JSON body. Part of the answer above:
HTTP 200
{
"id": 2196542,
"plan": "KVM 1",
"hostname": "srv2196542.hstgr.cloud",
"state": "running",
"cpus": 1,
"memory": 4096,
"disk": 51200,
"template": { "name": "CloudLinux 9" }
}
| Code | Meaning in plain words | Usual cause |
|---|---|---|
200 | OK, here you go | - |
202 | Accepted, will finish in the background | Normal for slow jobs. Check later; don't send it again |
401 | "Who are you?" | Token missing, mistyped, expired or deleted; or the word Bearer is missing |
403 | "You can't do that" | The account isn't allowed this action |
404 | "Not found" | Wrong ID, or it belongs to another account |
422 | "Something in your order is wrong" | Missing or invalid field; the body says which one |
429 | "Too many orders, slow down" | More than 90 requests per minute |
500 | Problem on Hostinger's side | Retry later; escalate if it persists |
Errors come with a short explanation and a correlation ID, the reference of that exact request:
HTTP 404
{
"message": "[VPS:2008] VirtualMachine with ID`s [1] was not found",
"correlation_id": "a34e6873-bb52-4774-bdf3-ff7cfb9047ef"
}
Almost everything a customer can do with their VPS in hPanel. Red = destructive or can't be undone.
| Area | Operations |
|---|---|
| Information | List VPSs, details (plan, state, IPs, OS), metrics (CPU, RAM, disk, traffic, uptime history), action history |
| Power | Start, restart, stop (the VPS goes offline) |
| Snapshots | Get, create (replaces the existing one: only one snapshot at a time), restore, delete |
| Backups | List, restore (overwrites everything on the VPS). Backups are kept outside the VPS and can't be downloaded |
| Rebuild | Recreate with a new OS (erases all data), recovery mode, purchase and set up a new VPS |
| Access | Root password, panel password, SSH keys, post-install scripts |
| Network | Firewall rules, hostname, nameservers, PTR (reverse DNS) |
| Apps | Docker Compose projects (Docker Manager), Monarx malware scanner |
top, free -h, df -h).What's going on: the API doesn't accept the token.
Usual causes: the token expired (they set an expiration date), was deleted, was copied with a missing character or an extra space, or the header is wrong (it must be Authorization: Bearer <token>, with the word Bearer).
What to tell them: check the token's expiration in hPanel → API. If in doubt, create a new token and update the script.
Try it in the playground: "Call without a token" and "Call with a wrong token".
What's going on: the account makes more than 90 requests per minute. The limit is per user, so all scripts and tools using that account share it.
What to tell them: ask less often (metrics only change about every 30 minutes, so checking every few seconds is wasted), wait the time in the Retry-After header before retrying, and check whether several tools use the same account.
How to check: the VPS action history (the API's "actions" call, the "Action history" button in the playground) lists recent actions such as restart, stop or snapshot, with time and result.
What's going on, often: an automation the customer set up: a nightly script, an n8n workflow, Terraform, a reseller panel, or an AI agent with access to the account.
What to tell them: review their automations and tools, and in hPanel → API delete any token they don't recognise or no longer use. If they suspect someone else has a token, treat it as a security issue.
Not every restart is an API action: a crash inside the VPS, or the OOM killer, doesn't appear as an action. That's the previous session (check inside the VPS).
What's going on: a VPS has one snapshot. Creating a new one replaces the old one. That's how it works, from hPanel or the API.
What to tell them: for history over several days, use the backups (Hostinger keeps them outside the VPS) or their own backup tool that stores copies outside the VPS.
What's going on: many actions are asynchronous: the API answers "accepted" right away and does the job in the background (restore, recreate, snapshot can take minutes).
What to tell them: check the action history or the VPS state after a while. Don't send the same request again: it can start the job twice.
What's going on: a backup restore replaces everything on the VPS with the backup's content, from hPanel or the API. There's no "are you sure?" in an API call.
What to tell them: data created after the backup can't be brought back by Hostinger backups. Before destructive calls (restore, recreate, snapshot restore), scripts should be tested carefully, and important data kept in their own backups outside the VPS.
Our scope: we don't debug or write customer code. What we can do:
correlation_id (not the code, not the token): that's what's needed if it has to be escalated.Never ask for the token to "test it ourselves".
1. "I copied my token from an old note and now every call says Unauthenticated."
Case 1. The token is probably expired, deleted or copied wrong. Create a new one in hPanel → API.
2. "My Grafana dashboard checks the API every second and keeps breaking."
Case 2. 60+ requests per minute from one tool, plus anything else on the account, hits the 90/minute limit. Metrics only change every ~30 minutes, so checking every few minutes is plenty.
3. "Every night at 2:00 my VPS goes offline for a minute."
Case 3. Check the action history for a nightly restart; most likely an automation the customer (or their developer) set up.
4. "I pasted my API token in a public GitHub repository by mistake."
Delete that token in hPanel → API right away and create a new one. Then check the action history for anything they didn't do.
5. "The recreate call returned 'accepted', but my VPS still shows the old OS."
Case 5. Recreate runs in the background. Wait and check the action history; don't send it again.
The API playground sends real requests to the Hostinger API for the lab VPS srv2196542 only, and shows the full request and the raw JSON answer.
uptime now shows a few minutes.x-ratelimit-remaining header on any call: that's how many requests are left this minute.The token is stored on the server, outside the website folder, and never reaches your browser: you only see its last 4 characters. Only the instructor should use "Restart" and "Create snapshot", one person at a time.
Based on the Hostinger API documentation (developers.hostinger.com, API reference overview) and the help article What is Hostinger API. Examples captured from a real Hostinger VPS.