DocumentationAPI ReferenceVPN Endpoints

VPN Endpoints

Manage VPN connections, servers, and configurations programmatically

VPN Management Overview

The VPN API allows you to create, manage, and monitor VPN connections. Support for WireGuard and OpenVPN protocols with global server locations.

Protocols

WireGuardOpenVPN

Locations

50+ Global Servers

Security

AES-256 Encryption

Quick Actions

Create Connection

Set up a new VPN connection with your preferred location and protocol.

POST /vpn/connections
Browse Servers

Explore available VPN servers and their current load status.

GET /vpn/servers
Monitor Usage

Track connection stats, data usage, and connection history.

GET /vpn/connections/:id

API Endpoints

GET/vpn/connections
List all VPN connections for the authenticated user

Response

{
  "success": true,
  "connections": [
    {
      "id": "vpn_123",
      "name": "my-connection",
      "status": "active",
      "location": "us-east-1",
      "protocol": "wireguard",
      "created_at": "2024-01-15T10:30:00Z",
      "connected_at": "2024-12-02T14:20:00Z",
      "data_usage": {
        "upload": 1024000,
        "download": 2048000
      }
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 20
}
POST/vpn/connections
Create a new VPN connection

Request Body

{
  "name": "my-vpn-connection",
  "location": "us-east-1",
  "protocol": "wireguard"
}
GET/vpn/connections/:id
Get details of a specific VPN connection

Response

{
  "success": true,
  "connection": {
    "id": "vpn_123",
    "name": "my-connection",
    "status": "active",
    "location": "us-east-1",
    "protocol": "wireguard",
    "created_at": "2024-01-15T10:30:00Z",
    "last_activity": "2024-12-02T14:20:00Z",
    "config": {
      "endpoint": "vpn-us-east-1.vpnenterprise.com:51820",
      "public_key": "abc123def456..."
    },
    "stats": {
      "uptime": "2 days, 4 hours",
      "data_usage": {
        "upload": 1024000,
        "download": 2048000
      }
    }
  }
}
PUT/vpn/connections/:id
Update VPN connection settings

Request Body

{
  "name": "updated-connection-name",
  "auto_connect": true
}
DELETE/vpn/connections/:id
Delete a VPN connection

Response

{
  "success": true,
  "message": "VPN connection deleted successfully",
  "id": "vpn_123"
}
GET/vpn/servers
List available VPN servers and locations

Response

{
  "success": true,
  "servers": [
    {
      "id": "srv_us_east_1",
      "location": "us-east-1",
      "city": "New York",
      "country": "United States",
      "country_code": "US",
      "load": 45,
      "latency": 23,
      "protocols": ["wireguard", "openvpn"],
      "status": "online"
    },
    {
      "id": "srv_eu_west_1",
      "location": "eu-west-1", 
      "city": "London",
      "country": "United Kingdom",
      "country_code": "GB",
      "load": 67,
      "latency": 18,
      "protocols": ["wireguard", "openvpn"],
      "status": "online"
    }
  ]
}

Connection States

Active

Connection is established and data is flowing

Connecting

Establishing connection to VPN server

Inactive

Connection is configured but not active

Error

Connection failed or encountered an error

Usage Examples

Create a New VPN Connection
Example of creating a WireGuard connection in the US East region
curl -X POST https://api.vpnenterprise.com/v1/vpn/connections \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-us-vpn",
    "location": "us-east-1",
    "protocol": "wireguard"
  }'

Next Steps

Explore other API endpoints to build a comprehensive VPN management solution.