VPN Service
Secure VPN service to protect users' connections. Includes global server pool, automatic OpenVPN configuration, and connection monitoring.
Client SDK required
The endpoints below are the backend VPN API. The on-device work β applying the returned openvpn_config, establishing and monitoring the tunnel, releasing the device slot on disconnect, and auto-connecting on unsafe networks β is handled by the DGuard mobile SDK provided during onboarding. This page documents the API the SDK consumes; you do not implement the OpenVPN client yourself.
Authentication required. All requests to these endpoints must include the Authorization: Bearer <access_token> header. See Authentication for how to obtain and refresh the token.
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/connectRequest 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": "203.0.113.24",
"port": 1194,
"protocol": "udp",
"country": "United States",
"country_code": "US",
"city": "New York"
},
"openvpn_config": "client\ndev tun\nproto udp\nremote us-nyc-1.vpn.dguard.io 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/serversExample 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