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
404Service not found or not accessible500Failed to configure IP addressRequest
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": "PRODUCTION",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2026-04-04T12: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 accessible500Server is not responding. Please try again in a few minutes.Request
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": "VPS status retrieved successfully",
"data": {
"serviceId": "vps_service_1",
"serviceType": "VPS",
"service": {
"id": "507f1f77bcf86cd799439099",
"serviceId": "vps_service_1",
"ip": "192.168.1.100",
"username": "Administrator",
"password": "Xk9mP2nQr7vL",
"status": "ASSIGNED",
"runningStatus": "RUNNING",
"expiryDate": "2026-05-04T12:00:00.000Z",
"getIP": false,
"productInfo": {
"name": "VPS 8GB Plan",
"cpu": "4 vCPU",
"ram": "8 GB",
"storage": "100 GB SSD"
},
"os": {
"name": "Ubuntu 22.04",
"version": "22.04 LTS"
}
},
"vmStatus": {
"status": "running",
"cpuUsage": 0.05,
"memoryUsage": 0.25,
"uptime": 86400
},
"mode": "PRODUCTION",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2026-04-04T12: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 body403Rebuild limit reached. You cannot rebuild this service again.403Rebuild not available during maintenance window (9:00 AM – 11:30 AM IST)404Service 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/{serviceId}/reset-macReset MAC Address
Generate and apply a new MAC address to a VPS service. Without an active MAC reset subscription, this can only be done once every 24 hours. Returns the old and new MAC addresses.
Parameters
serviceIdstringrequiredThe unique identifier of the VPS service. Only VPS (VM) services are supported.
Error Responses
404Service not found or not a VPS assignment429MAC reset is only allowed once every 24 hours without a subscription500Failed to retrieve or apply VM configurationRequest
curl -X POST "https://api.advps.org/api/v1/services/ABCXYZ/reset-mac" \
-H "x-api-key: sk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Response 200 OK
{
"status": "success",
"message": "MAC address reset successfully",
"data": {
"serviceId": "ABCXYZ",
"oldMacAddress": "BC:24:11:AA:BB:CC",
"newMacAddress": "BC:24:11:DD:EE:FF",
"hasSubscription": false,
"mode": "PRODUCTION",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2026-04-27T12:00:00.000Z"
}/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"
}/api/v1/services/renewRenew Services
Renew one or more services on an existing Linux (LXC) or VPS (VM) order. The system automatically detects the order type from the orderId. Services are eligible for renewal when they expire within 5 days or up to 1 day after expiry. Optional per-service validity overrides are supported.
Parameters
orderIdstringrequiredThe order ID to renew services for (e.g. LXC260426-9632 or VPS040426-0008).
serviceIdsstring[]requiredArray of serviceId values (the human-readable service identifier, not the DB object ID) to renew. All must belong to the specified order.
serviceValiditiesobject[]optionalOptional per-service validity overrides. Each entry: { serviceId: string, validity: number }. Services not listed use the website default validity.
Error Responses
400Some services are not eligible for renewal (expiry outside the -1 to +5 day window, or wrong status)400Insufficient wallet balance404Order not found or does not belong to the authenticated seller404None of the provided serviceIds were found on this orderRequest
curl -X POST "https://api.advps.org/api/v1/services/renew" \
-H "x-api-key: sk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"orderId": "LXC260426-9632",
"serviceIds": ["KYOFMI", "ABCXYZ"],
"serviceValidities": [
{ "serviceId": "KYOFMI", "validity": 30 },
{ "serviceId": "ABCXYZ", "validity": 60 }
]
}'Response 200 OK
{
"status": "success",
"message": "Order renewed successfully",
"data": {
"orderId": "LXC260426-9632",
"orderType": "LXC",
"renewedCount": 2,
"baseAmount": 1000,
"discount": 100,
"totalAmount": 900,
"mode": "PRODUCTION",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2026-04-27T12: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"
}OS
Operating Systems
Query available operating systems for use when purchasing services.
/api/v1/osList Operating Systems
Returns all enabled operating systems. Optionally filter by type to see only VPS or Linux (LXC) compatible OS options.
Parameters
typestringoptionalFilter by service type. One of: vps, lxc. Omit to list all.
Error Responses
400Invalid type value — must be "vps" or "lxc"401Missing or invalid API keyRequest
curl -X GET "https://api.advps.org/api/v1/os?type=vps" \
-H "x-api-key: sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Response 200 OK
{
"status": "success",
"message": "OS list retrieved successfully",
"data": {
"os": [
{
"id": "507f1f77bcf86cd799439011",
"name": "Ubuntu 22.04",
"type": "VM",
"price": 0
},
{
"id": "507f1f77bcf86cd799439012",
"name": "Windows Server 2022",
"type": "VM",
"price": 150
},
{
"id": "507f1f77bcf86cd799439013",
"name": "Debian 12",
"type": "VM",
"price": 0
}
],
"mode": "test",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2024-01-30T12:00:00.000Z"
}Purchase
Order Services
Place new Linux (LXC) and VPS (VM) orders programmatically. Orders are created in PENDING status and processed automatically.
/api/v1/purchase/linuxPurchase Linux Service
Place a new Linux (LXC) order. Validates product availability, calculates pricing with applicable discounts and offers, deducts wallet balance, and creates the order.
Parameters
productIdstringrequiredThe product ID to purchase. Use the Products endpoint to find available products.
ramstringrequiredRAM specification. Flexible formats accepted: "4 GB", "8GB", "8", "2.5 GB", "512 MB".
osIdstringrequiredOperating system ID. Use the OS endpoint to list available options.
quantityintegerrequiredNumber of services to purchase (1–50).
validityintegeroptionalValidity period in days. Default: 30.
remarkstringoptionalOptional note for the order (max 500 characters).
Error Responses
400Validation failed — missing or invalid fields400No variation matching the specified RAM400Insufficient stock400Insufficient wallet balance400No pricing available for the selected validity404Product not found400Invalid OS selectionRequest
curl -X POST "https://api.advps.org/api/v1/purchase/linux" \
-H "x-api-key: sk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"productId": "507f1f77bcf86cd799439011",
"ram": "4 GB",
"osId": "507f1f77bcf86cd799439012",
"quantity": 2,
"validity": 30,
"remark": "Client order #1234"
}'Response 200 OK
{
"status": "success",
"message": "Linux order placed successfully",
"data": {
"order": {
"id": "507f1f77bcf86cd799439099",
"orderId": "LXC040426-0012",
"productId": "507f1f77bcf86cd799439011",
"variationId": "507f1f77bcf86cd799439022",
"productInfo": {
"name": "Linux 4GB Plan",
"os": "Ubuntu 22.04",
"osPrice": 0,
"cpu": "2 vCPU",
"ram": "4 GB",
"quantity": 2,
"storage": "50 GB SSD",
"price": 500
},
"validity": 30,
"baseAmount": 1000,
"discount": 100,
"totalAmount": 900,
"status": "PENDING",
"remark": "Client order #1234",
"buyDate": "2026-04-04T12:00:00.000Z"
},
"mode": "PRODUCTION",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2026-04-04T12:00:00.000Z"
}/api/v1/purchase/vpsPurchase VPS Service
Place a new VPS (VM) order for a customer. If a user with the provided email already exists, the order is linked to them. If not, a new user account is created and the generated password is returned in the response.
Parameters
productIdstringrequiredThe product ID to purchase.
ramstringrequiredRAM specification. Flexible formats: "4 GB", "8GB", "8", "2.5 GB".
osIdstringrequiredOperating system ID for the VPS.
quantityintegerrequiredNumber of services to purchase (1–10).
namestringrequiredCustomer name (2–100 characters).
emailstringrequiredCustomer email address. Used for user account lookup or creation.
validityintegeroptionalValidity period in days. Default: 30.
remarkstringoptionalOptional note for the order (max 500 characters).
Error Responses
400Validation failed — missing or invalid fields400No variation matching the specified RAM400Insufficient stock400Insufficient wallet balance400A non-customer account with this email already exists400No pricing available for the selected validity404Product not found400Invalid OS selectionRequest
curl -X POST "https://api.advps.org/api/v1/purchase/vps" \
-H "x-api-key: sk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"productId": "507f1f77bcf86cd799439011",
"ram": "8 GB",
"osId": "507f1f77bcf86cd799439012",
"quantity": 1,
"name": "John Doe",
"email": "[email protected]",
"validity": 30,
"remark": "Premium client"
}'Response 200 OK
{
"status": "success",
"message": "VPS order placed successfully",
"data": {
"order": {
"id": "507f1f77bcf86cd799439099",
"orderId": "VPS040426-0008",
"productId": "507f1f77bcf86cd799439011",
"variationId": "507f1f77bcf86cd799439033",
"productInfo": {
"name": "VPS 8GB Plan",
"os": "Ubuntu 22.04",
"osPrice": 0,
"cpu": "4 vCPU",
"ram": "8 GB",
"quantity": 1,
"storage": "100 GB SSD",
"price": 1200
},
"validity": 30,
"baseAmount": 1200,
"discount": 150,
"totalAmount": 1050,
"status": "PENDING",
"remark": "Premium client",
"buyDate": "2026-04-04T12:00:00.000Z",
"customer": {
"name": "John Doe",
"email": "[email protected]"
}
},
"password": "Xk9mP2nQr7vL",
"userAlreadyExisted": false,
"message": "New user account created for \"[email protected]\". Password is included in this response.",
"mode": "PRODUCTION",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2026-04-04T12:00:00.000Z"
}/api/v1/purchase/{orderId}Get Order Details
Retrieve complete order details including assigned services with credentials. Only API-created orders belonging to the authenticated seller are returned.
Parameters
orderIdstringrequiredThe order ID (e.g. LXC040426-0012 or VPS040426-0008).
Error Responses
404Order not found or not accessible401Missing or invalid API keyRequest
curl -X GET "https://api.advps.org/api/v1/purchase/VPS040426-0008" \
-H "x-api-key: sk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Response 200 OK
{
"status": "success",
"message": "Order details retrieved successfully",
"data": {
"orderId": "VPS040426-0008",
"orderType": "VPS",
"order": {
"id": "507f1f77bcf86cd799439099",
"orderId": "VPS040426-0008",
"status": "ASSIGNED",
"productInfo": {
"name": "VPS 8GB Plan",
"os": "Ubuntu 22.04",
"osPrice": 0,
"cpu": "4 vCPU",
"ram": "8 GB",
"quantity": 1,
"storage": "100 GB SSD",
"price": 1200
},
"os": "Ubuntu 22.04",
"validity": 30,
"baseAmount": 1200,
"discount": 150,
"totalAmount": 1050,
"buyDate": "2026-04-04T12:00:00.000Z",
"remark": "Premium client"
},
"services": [
{
"id": "507f1f77bcf86cd799439100",
"serviceId": "vps_service_1",
"ip": "192.168.1.100",
"status": "ASSIGNED",
"runningStatus": "RUNNING",
"expiryDate": "2026-05-04T12:00:00.000Z",
"password": "Xk9mP2nQr7vL",
"username": "Administrator",
"getIP": false
}
],
"mode": "PRODUCTION",
"requestId": "req_1706611200000_abc123def"
},
"timestamp": "2026-04-04T12:00:00.000Z"
}ADVPS API · v1.0 · [email protected]