API Documentation

Manage countries, servers and configurations using our REST API.

Base URL: https://vpnserverhub.com/api

🔐 Authentication

All endpoints require api_key.

GET https://vpnserverhub.com/api/country-list?api_key=YOUR_API_KEY

👤 Fetch User Details

GET /fetch-user-details
{
  "type": "success",
  "user": {
    "id": 10,
    "name": "Ocean Sims",
    "email": "test1@gmail.com",
    "expires_at": "2026-01-22"
    "total_gb": "15"
  }
}

🌍 Available Server Country List

GET /country-list

Query Parameters

Parameter Required
api_key Yes

Sample Response

{
    "type": "success",
    "data": {
        "free": [
            {
                "id": 1,
                "country_code": "CA",
                "country_name": "Canada"
            }
        ],
        "paid": [
            {
                "id": 2,
                "country_code": "CA",
                "country_name": "Canada"
            }
        ]
        "platform_free": [
            {
                "id": 2,
                "country_code": "CA",
                "country_name": "Canada"
            }
        ]
    }
}

🖥 Created Server Config List

GET /server-list

Sample Response Structure

{
  "type": "success",
  "wireguard": { "free": [], "paid": [ ... ] },
  "v2ray": { "free": [ ... ], "paid": [] }
}

⚡ Create Wireguard

POST /create-wireguard

Body Parameters (form-data)

Parameter Type Required
api_key string Yes
server_id integer Yes
server_type string free/paid
expiry_date datetime Yes
limit integer No
protocol string (wireguard) Yes

Sample Response

{
    "type": "success",
    "data": {
        "id": 28,
        "country": "GERMANY",
        "protocol": "wireguard",
        "expiry_date": "2025-12-23 08:31",
        "status": "ACTIVE",
        "created_at": "2026-02-17T10:15:00.000000Z"
    }
}
                            

🚀 Create V2Ray

POST /create-v2ray

Body Parameters (form-data)

Parameter Type Required
api_key string Yes
server_ids[] integer Yes
server_type string free/paid
protocol string (vless, vmess, shadowsocks, trojan) Yes
expiry_date datetime Yes
limit integer No
device_limit integer No

Sample Response

{
    "type": "success",
    "message": "Successfully created!",
    "data": {
        "uuid": "1e70d20d-6e1f-426d-a75f-e4dc6bab8a54",
        "id": 23035,
        "shortUuid": "RgZo_M4nAgCGB4-A",
        "username": "user_free_6a8dd2151da3d",
        "status": "ACTIVE",
        "trafficLimitBytes": 2147483648,
        "trafficLimitStrategy": "MONTH",
        "expireAt": "2026-09-01T17:34:11.743Z",
        "telegramId": null,
        "email": "user@gmail.com",
        "description": null,
        "tag": null,
        "hwidDeviceLimit": 0,
        "externalSquadUuid": null,
        "trojanPassword": "A5V3eF_nbotah87R4Q3kphcnj3CfHfSd",
        "vlessUuid": "eb26c58c-3aa4-4e29-aa84-21b7d2f55054",
        "ssPassword": "qzEvDZqnxTv_kB95hjpdG0QCNz7CK0st",
        "lastTriggeredThreshold": 0,
        "subRevokedAt": null,
        "lastTrafficResetAt": null,
        "createdAt": "2026-08-25T17:34:13.580Z",
        "updatedAt": "2026-08-25T17:34:13.579Z",
        "subscriptionUrl": "https://sub.vpnserverhub.com/RgZo_M4nAgCGB4-A",
        "activeInternalSquads": [
            {
                "uuid": "d0fc1207-9eeb-4fbc-a6f1-58fce4459153",
                "name": "Poland-Vless"
            },
            {
                "uuid": "731bfef2-a756-4ad0-9271-d7420e0c45a4",
                "name": "Netherlands-Vless"
            }
        ],
        "userTraffic": {
            "usedTrafficBytes": 0,
            "lifetimeUsedTrafficBytes": 0,
            "onlineAt": null,
            "lastConnectedNodeUuid": null,
            "firstConnectedAt": null
        }
    }
}

⚙️ Update Server Configurations

Enable, disable, or change the expiry date of one or multiple WireGuard server configurations.

POST /wireguard/update

Body Parameters (form-data / JSON)

Parameter Type Required Description
api_key string Yes User API key
ids array Yes Server config IDs to update
enable boolean No true to enable or false to disable
expiry_date date No Expiry date in Y-m-d format
Note: You must provide at least one of enable or expiry_date. Both can also be provided in the same request.

Enable Servers

{
    "api_key": "YOUR_API_KEY",
    "ids": [12, 15, 20],
    "enable": true
}
        

Disable Servers

{
    "api_key": "YOUR_API_KEY",
    "ids": [12, 15, 20],
    "enable": false
}
        

Change Expiry Date

{
    "api_key": "YOUR_API_KEY",
    "ids": [12, 15, 20],
    "expiry_date": "2026-09-30"
}
        

Enable and Change Expiry Together

{
    "api_key": "YOUR_API_KEY",
    "ids": [12, 15, 20],
    "enable": true,
    "expiry_date": "2026-09-30"
}
        

Sample Response

{
    "type": "success",
    "message": "3 server(s) enabled successfully.",
    "success": [
        {
            "id": 12
        },
        {
            "id": 15
        },
        {
            "id": 20
        }
    ],
    "failed": []
}
        

Partial Failure Response

{
    "type": "warning",
    "message": "2 server(s) enabled successfully, 1 failed.",
    "success": [
        {
            "id": 12
        },
        {
            "id": 15
        }
    ],
    "failed": [
        {
            "id": 20,
            "message": "Inbound ID not found"
        }
    ]
}
        

🔄 Update V2Ray Server Configurations

Enable, disable, or change the expiry date of one or multiple V2Ray server configurations.

POST /v2ray/update

Body Parameters

Parameter Type Required Description
api_key string Yes User API key
uuids array Yes Array of clean V2Ray user UUIDs
status string No ACTIVE or DISABLED
expiry_date date No Expiry date in Y-m-d format
Note: You must provide at least one of status or expiry_date. Both can be provided in the same request.

Enable Users

{
    "api_key": "YOUR_API_KEY",
    "uuids": [
        "764a1d91-a8c8-4e93-9354-25e4959b3254",
        "12345678-abcd-1234-abcd-123456789012"
    ],
    "status": "ACTIVE"
}
        

Disable Users

{
    "api_key": "YOUR_API_KEY",
    "uuids": [
        "764a1d91-a8c8-4e93-9354-25e4959b3254",
        "12345678-abcd-1234-abcd-123456789012"
    ],
    "status": "DISABLED"
}
        

Change Expiry Date

{
    "api_key": "YOUR_API_KEY",
    "uuids": [
        "764a1d91-a8c8-4e93-9354-25e4959b3254",
        "12345678-abcd-1234-abcd-123456789012"
    ],
    "expiry_date": "2026-09-30"
}
        

Update Status and Expiry Together

{
    "api_key": "YOUR_API_KEY",
    "uuids": [
        "764a1d91-a8c8-4e93-9354-25e4959b3254",
        "12345678-abcd-1234-abcd-123456789012"
    ],
    "status": "ACTIVE",
    "expiry_date": "2026-09-30"
}
        

Sample Response

{
    "type": "success",
    "message": "2 server(s) status updated successfully.",
    "success": [
        {
            "server_id": 1,
            "uuids": [
                "764a1d91-a8c8-4e93-9354-25e4959b3254",
                "12345678-abcd-1234-abcd-123456789012"
            ]
        }
    ],
    "failed": []
}
        
API key location

Visual guide to find your API key in dashboard