Home / API Docs

API Documentation

Complete REST API reference for managing VPS servers and proxies programmatically. We offer separate APIs for each product type.

Three APIs, Three Products

Leased Hardware API

Servers on leased third-party hardware. We do not own these machines. Limited OS selection, no FDE, no SSH key support, password auth only.

https://servury.com/api/legacy.php

Proxy API

Datacenter, residential, and rotating proxies. Order proxies, manage credentials, whitelist IPs, renew/top-up, and terminate via API.

https://servury.com/api/proxy.php

Owned Hardware API Coming Soon

Servers running on hardware we own and operate in our own colocation facility. Full control, more OS options, FDE support, SSH key auth, IPv4/IPv6 dual-stack. API access not yet available.

Leased Hardware API Proxy API Owned Hardware API Coming Soon

Authentication

All API requests require authentication via the X-Reseller-Key header.

X-Reseller-Key: your_api_key_here

Keep your API key secret. Never expose it in client-side code.

Base URL

https://servury.com/api/legacy.php

Response Format

All endpoints return JSON. Successful responses:

{"success": true, "data": {...}}

Error responses:

{"success": false, "error": "message"}
GET

?action=plans

List available VPS plans with your reseller pricing.

GET

?action=locations

List available server locations.

GET

?action=os

List available operating systems. Legacy infrastructure supports: Debian 12, Debian 13, Ubuntu 24, Rocky Linux 9, CentOS 10, and Windows Server 2025.

GET

?action=account

Get reseller account information including balance, discount, and payment method.

Example Response

{ "success": true, "data": { "balance": 42.50, "discount_percent": 33.3, "payment_method": "account_balance", "has_saved_card": false } }
GET

?action=servers

List all servers belonging to the reseller.

GET

?action=server&id={server_id}

Get detailed information for a specific server including password.

ParameterTypeDescription
id *string8-character server ID

Example Response

{ "success": true, "data": { "server": { "id": "abc12345", "hostname": "myserver", "ip_address": "31.57.201.10", "os": "debian12", "plan": "S-100", "location": "Netherlands", "status": "active", "username": "root", "password": "generated_password", "expiration_date": 1712592000 } } }
GET

?action=console&id={server_id}

Get noVNC console URL for a server.

ParameterTypeDescription
id *string8-character server ID
POST

?action=create

Provision a new server on leased infrastructure. Password is auto-generated by the provider.

ParameterTypeDescription
plan_id *integerPlan ID from /plans endpoint
hostname *string3-63 alphanumeric characters
os *stringdebian12, debian13, ubuntu24, rocky9, centos10, winserv25
daysinteger1-365 (default: 31)
POST

?action=renew&id={server_id}

Renew/extend a server subscription.

ParameterTypeDescription
id *string8-character server ID
days *integer1-365
POST

?action=upgrade&id={server_id}

Upgrade server to a higher plan. Prorated charge for remaining days.

ParameterTypeDescription
id *string8-character server ID
plan_id *integerTarget plan ID (must be higher price than current)
POST

?action=terminate&id={server_id}

Permanently delete a server (no refund).

ParameterTypeDescription
id *string8-character server ID
POST

?action=power&id={server_id}

Execute power actions on a server.

ParameterTypeDescription
id *string8-character server ID
action *stringstart, stop, or restart
POST

?action=reinstall&id={server_id}

Reinstall the operating system (wipes all data).

ParameterTypeDescription
id *string8-character server ID
os *stringdebian12, debian13, ubuntu24, rocky9, centos10, winserv25
POST

?action=hostname&id={server_id}

Update server hostname.

ParameterTypeDescription
id *string8-character server ID
hostname *stringNew hostname (alphanumeric and hyphens)
POST

?action=ip&id={server_id}

Change the server's IP address. This is a paid operation.

ParameterTypeDescription
id *string8-character server ID

Error Responses

All errors return JSON with success: false and an error message.

401 Unauthorized

{"success": false, "error": "Invalid or inactive API key."}

404 Not Found

{"success": false, "error": "Server not found."}

400 Bad Request

{"success": false, "error": "Invalid hostname. Use 3-63 alphanumeric characters."}

PHP Example

<?php
$apiKey = "your_api_key_here";
$baseUrl = "https://servury.com/api/legacy.php";

function apiRequest($endpoint, $apiKey, $method = 'GET', $data = null) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $endpoint);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        "X-Reseller-Key: $apiKey",
        "Content-Type: application/json"
    ]);

    if ($method === 'POST') {
        curl_setopt($ch, CURLOPT_POST, true);
        if ($data) {
            curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        }
    }

    $response = curl_exec($ch);
    curl_close($ch);

    return json_decode($response, true);
}

// Check balance
$account = apiRequest("$baseUrl?action=account", $apiKey);
echo "Balance: $" . $account['data']['balance'];

// Create a server
$newServer = apiRequest("$baseUrl?action=create", $apiKey, 'POST', [
    'plan_id' => 5,
    'hostname' => 'myserver',
    'os' => 'debian12',
    'days' => 31
]);

// Power cycle a server
$result = apiRequest("$baseUrl?action=power&id=abc12345", $apiKey, 'POST', [
    'action' => 'restart'
]);