D
DGuardAPI Documentation

VPN Service

Secure VPN service to protect users' connections. Includes global server pool, automatic OpenVPN configuration, and connection monitoring.

Features

45+ Servers

30+ countries worldwide

Automatic OpenVPN

Automatic configuration

2 Simultaneous Devices

Per user

Auto-Connect

On unsecure networks

Connect to VPN

POST /vpn/connect

Request Example

{
  "user_id": "usr_123456",
  "server_id": 123,
  "device_info": {
    "device_id": "device_abc123",
    "device_type": "mobile",
    "platform": "iOS",
    "app_version": "1.0.0"
  }
}

Response Example

{
  "session_id": "sess_xyz789",
  "slot_id": 1,
  "vpn_credentials": {
    "username": "vpn_user_abc",
    "password": "generated_password"
  },
  "server_info": {
    "id": 123,
    "name": "US - New York #1",
    "ip": "192.168.1.100",
    "port": 1194,
    "protocol": "udp",
    "country": "United States",
    "country_code": "US",
    "city": "New York"
  },
  "openvpn_config": "client\ndev tun\nproto udp\nremote vpn.server.com 1194\n...",
  "dns_servers": ["1.1.1.1", "8.8.8.8"],
  "connected_at": "2025-01-14T18:00:00Z",
  "expires_at": "2025-01-15T18:00:00Z"
}

List Servers

GET /vpn/servers

Example Servers

US - New York #1

Recommended

πŸ‡ΊπŸ‡Έ United States

45% capacity

Medium

ES - Madrid #1

πŸ‡ͺπŸ‡Έ Spain

30% capacity

Low

GB - London #1

πŸ‡¬πŸ‡§ United Kingdom

65% capacity

Medium

DE - Frankfurt #1

Recommended

πŸ‡©πŸ‡ͺ Germany

20% capacity

Low

Check Network Security

Analyze if the current network requires VPN protection.

POST /vpn/check-network
lowSecure network, VPN optional
mediumPublic network with password
highPublic network with suspicious pattern
criticalOpen network without password