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

🌍 Country List

GET /country-list

Query Parameters

Parameter Required
api_key Yes

Sample Response

{
  "type": "success",
  "data": [
    {
      "id": 32,
      "country_code": "GER",
      "country_name": "GERMANY"
    }
  ]
}

🖥 Server List

GET /server-list

Sample Response Structure

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

👤 Fetch User Details

GET /fetch-user-details
{
  "type": "success",
  "user": {
    "id": 10,
    "name": "Ocean Sims",
    "email": "test1@gmail.com",
    "expires_at": "2026-01-22"
  },
  "free_server_limit": "2",
  "paid_server_limit": "100",
  "free_servers_used": 0,
  "paid_servers_used": 3
}

⚡ Create Wireguard

POST /create-wireguard

Body Parameters (form-data)

Parameter Type Required
api_key string Yes
server_id integer Yes
expiry_date datetime Yes
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_id integer Yes
expiry_date datetime Yes
protocol string (vless, vmess, shadowsocks, trojan) Yes

Sample Response

{
  "type": "success",
  "data": {
    "uuid": "764a1d91-a8c8-4e93-9354-25e4959b3254",
    "country": "Germany",
    "protocol": "Vless-reality",
    "username": "user_698ec8da99633",
    "expiry_date": "2026-03-15 06:46",
    "status": "ACTIVE",
    "connection_link": "https://panel.vpnserverhub.com/api/sub/XXXX",
    "used": 0,
    "limit": 10737418240
  }
}
API key location

Visual guide to find your API key in dashboard