DGuardAPI Docs

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

bash
POST /vpn/connect

Request Example

json
{
  "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

json
{
  "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

bash
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.

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