API Reference
Programmatically manage your virtual private servers and Linux containers — start/stop, configure IPs, rebuild, generate passwords, and more.
Authentication
Every request must include your API key in the x-api-key header.
x-api-key: sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXSafe sandbox — returns mock data
x-api-key: sk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXPerforms real operations on your VMs
API Modes
The API operates in two modes determined by your API key prefix.
| Mode | Prefix |
|---|---|
| Test | sk_test_* |
| Production | sk_live_* |
Response Format
All responses are JSON. Successful responses use HTTP 200 and wrap data in a consistent envelope.
Success
{
"status": "success",
"message": "Operation completed",
"data": {},
"timestamp": "2024-01-30T12:00:00.000Z"
}Error
{
"status": "error",
"message": "Error description",
"errors": null,
"timestamp": "2024-01-30T12:00:00.000Z"
}Rate Limiting
Requests are rate-limited per 15-minute window. Exceeded limits return HTTP 429.
Suitable for development & testing
Optimised for production workloads
Services
Service Management
Control and monitor your VPS and Linux container services.
/api/v1/services/{serviceId}/startStart Service
Start a stopped service. Works for both VPS (VM) and Linux (LXC) service types.
Parameters
serviceIdstringrequiredThe unique identifier of the service to start.
Error Responses
404Service not found or not accessible500Failed to start service (server not responding or already running)Request
curl -X POST "https://api.advps.org/api/v1/services/vps_service_1/start" \
-H "x-api-key: sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Response 200 OK
{
"status": "success",
"message": "VPS service started successfully",
"data": {
"serviceId": "vps_service_1",
"serviceType": "VPS",
"status": "STARTED",
"vmid": "vm1000",
"mode": "test",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2024-01-30T12:00:00.000Z"
}/api/v1/services/{serviceId}/stopStop Service
Stop a running service gracefully.
Parameters
serviceIdstringrequiredThe unique identifier of the service to stop.
Error Responses
404Service not found or not accessible500Failed to stop service (already stopped or server error)Request
curl -X POST "https://api.advps.org/api/v1/services/vps_service_1/stop" \
-H "x-api-key: sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Response 200 OK
{
"status": "success",
"message": "VPS service stopped successfully",
"data": {
"serviceId": "vps_service_1",
"serviceType": "VPS",
"status": "STOPPED",
"vmid": "vm1000",
"mode": "test",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2024-01-30T12:00:00.000Z"
}/api/v1/services/{serviceId}/rebootReboot Service
Reboot a running service. The service will be briefly unavailable during the restart cycle.
Parameters
serviceIdstringrequiredThe unique identifier of the service to reboot.
Error Responses
404Service not found or not accessible500Failed to reboot serviceRequest
curl -X POST "https://api.advps.org/api/v1/services/vps_service_1/reboot" \
-H "x-api-key: sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Response 200 OK
{
"status": "success",
"message": "VPS service rebooted successfully",
"data": {
"serviceId": "vps_service_1",
"serviceType": "VPS",
"status": "RUNNING",
"vmid": "vm1000",
"mode": "test",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2024-01-30T12:00:00.000Z"
}/api/v1/services/{serviceId}/get-ipConfigure IP Address
Assign or configure an IP address for a VPS or Provisional VPS service. Not available for standard Linux containers.
Parameters
serviceIdstringrequiredThe unique service identifier (VPS or Provisional VPS only).
Error Responses
400IP configuration not supported for this service type404Service not found or not accessibleRequest
curl -X POST "https://api.advps.org/api/v1/services/vps_service_1/get-ip" \
-H "x-api-key: sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Response 200 OK
{
"status": "success",
"message": "VPS IP configured successfully",
"data": {
"serviceId": "vps_service_1",
"serviceType": "VPS",
"status": "IP_CONFIGURED",
"ip": "192.168.1.100",
"mode": "test",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2024-01-30T12:00:00.000Z"
}/api/v1/services/{serviceId}/statusGet Service Status
Retrieve the current status and resource usage of a service.
Parameters
serviceIdstringrequiredThe unique identifier of the service.
Error Responses
404Service not found or not accessibleRequest
curl -X GET "https://api.advps.org/api/v1/services/vps_service_1/status" \
-H "x-api-key: sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Response 200 OK
{
"status": "success",
"message": "Service status retrieved successfully",
"data": {
"serviceId": "vps_service_1",
"serviceType": "VPS",
"runningStatus": "RUNNING",
"ip": "192.168.1.100",
"uptime": 86400,
"mode": "test",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2024-01-30T12:00:00.000Z"
}/api/v1/services/{serviceId}/generate-passwordGenerate Password
Generate a new root/admin password for a service. The service must be running. The new password will be returned once and stored securely.
Parameters
serviceIdstringrequiredThe unique identifier of the service.
Error Responses
400Service must be running before generating a password404Service not found or not accessibleRequest
curl -X POST "https://api.advps.org/api/v1/services/vps_service_1/generate-password" \
-H "x-api-key: sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Response 200 OK
{
"status": "success",
"message": "Password generated successfully",
"data": {
"serviceId": "vps_service_1",
"password": "Xk9mP2nQr7vL",
"mode": "test",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2024-01-30T12:00:00.000Z"
}/api/v1/services/{serviceId}/rebuildRebuild Service
Rebuild a service with a fresh OS image. This is an asynchronous operation — use the returned taskId to poll for completion.
Parameters
serviceIdstringrequiredThe unique identifier of the service to rebuild.
Request Body
JSON body with os (string, required) — the operating system identifier to install.
Error Responses
400Missing or invalid os in request body403Monthly rebuild limit reached404Service not found or not accessible500No OS templates available for the selected OSRequest
curl -X POST "https://api.advps.org/api/v1/services/vps_service_1/rebuild" \
-H "x-api-key: sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{"os": "ubuntu-22.04"}'Response 200 OK
{
"success": true,
"data": {
"serviceId": "vps_service_1",
"taskId": "uuid-generated-task-id",
"serviceType": "VPS",
"status": "PENDING",
"apiMode": "test",
"requestId": "req_1706611200000_abc123def"
},
"message": "VPS rebuild initiated successfully"
}/api/v1/services/task/{taskId}/statusGet Task Status
Poll the status of an asynchronous task, such as a rebuild operation. Poll every 3–5 seconds until status is COMPLETED or FAILED.
Parameters
taskIdstringrequiredThe unique task identifier returned by a rebuild request.
Error Responses
404Task not found or not accessibleRequest
curl -X GET "https://api.advps.org/api/v1/services/task/uuid-task-id/status" \
-H "x-api-key: sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Response 200 OK
{
"status": "success",
"message": "Task status retrieved successfully",
"data": {
"taskId": "uuid-task-id",
"status": "COMPLETED",
"progress": 100,
"mode": "test",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2024-01-30T12:00:00.000Z"
}Products
Product Stock
Query real-time product stock levels. Stock is automatically derived from available VM inventory unless manual stock management is enabled for a product.
/api/v1/products/stockList Product Stock
Returns current stock levels for all visible products sorted by stock descending. Supports optional filtering by product type.
Parameters
pageintegeroptionalPage number for pagination. Default: 1.
limitintegeroptionalResults per page, max 100. Default: 10.
typestringoptionalFilter by product type. One of: linux, vps.
Error Responses
400Invalid type value — must be 'linux' or 'vps'401Missing or invalid API keyRequest
curl -X GET "https://api.advps.org/api/v1/products/stock?type=linux&page=1&limit=10" \
-H "x-api-key: sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Response 200 OK
{
"status": "success",
"message": "Product stock retrieved successfully",
"data": {
"stock": [
{
"id": "prod_abc123",
"name": "Linux VPS 4GB",
"vmType": "LXC",
"packName": "4GB Linux Pack",
"stock": 25,
"stockStatus": "IN_STOCK"
},
{
"id": "prod_def456",
"name": "Linux VPS 2GB",
"vmType": "LXC",
"packName": "2GB Linux Pack",
"stock": 4,
"stockStatus": "LOW_STOCK"
},
{
"id": "prod_ghi789",
"name": "Linux VPS 1GB",
"vmType": "LXC",
"packName": "1GB Linux Pack",
"stock": 0,
"stockStatus": "OUT_OF_STOCK"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 12,
"totalPages": 2,
"hasNext": true,
"hasPrev": false
},
"mode": "test",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2024-01-30T12:00:00.000Z"
}/api/v1/products/stock/{id}Get Product Stock
Returns the current stock level for a single product by its ID.
Parameters
idstringrequiredThe unique product identifier.
Error Responses
404Product not found401Missing or invalid API keyRequest
curl -X GET "https://api.advps.org/api/v1/products/stock/prod_abc123" \
-H "x-api-key: sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Response 200 OK
{
"status": "success",
"message": "Product stock retrieved successfully",
"data": {
"stock": {
"id": "prod_abc123",
"name": "Linux VPS 4GB",
"vmType": "LXC",
"packName": "4GB Linux Pack",
"stock": 25,
"stockStatus": "IN_STOCK"
},
"mode": "test",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2024-01-30T12:00:00.000Z"
}ADVPS API · v1.0 · [email protected]