API Reference
Dashboard
  1. API Reference
  2. Box API
  3. VPN

Turn a slot's VPN server on or off and change its settings

Creates or updates the VPN server of one slot and regenerates its configuration. Needs the VPN license feature. While a slot's VPN is on its type cannot change; turn it off first. vpn_mtu FF means 1420. Changing the quota or re-enabling resets the used bytes. Existing client profiles are regenerated unless keep_vpn_file is true, which invalidates profiles already handed out.

  • Destructive · confirm first
  • Basic auth
  • Panel API · since v20.8.0
  • Hub: needs owner approval
  • setVpnServerConfig
POST/vpn_server_config

Request body application/json · required

positionintegerrequired
vpn_enablebooleanrequired
number_clientintegerrequired
enable_vpn_vpsbooleanrequired
vpn_mtustringrequired

MTU, or FF for the default 1420.

vpn_typestringrequired
One of wg, opvn
vpn_userstringrequired

OpenVPN login user (empty for WireGuard).

vpn_passstringrequired

OpenVPN login password (empty for WireGuard).

keep_vpn_filebooleanoptional
Default false
vpn_expire_atstring | nulloptional
vpn_quota_gbnumber | nulloptional

0 or empty means no quota.

Authentication

Needs a trusted caller (loopback, LAN unless "force auth for local" is on, whitelisted IP, allowed Tailscale) or valid dashboard Basic credentials, which are checked only when dashboard authentication is enabled.

Responses

Result.

statusbooleanrequired

True when the box accepted the request.

msgstringrequired

Outcome code or message (see the operation's error table).

Errors returned in msg

msgMeaningWhat to do
This function is available on higher plan license only. Please contact Administrator!The license has no VPN feature.Upgrade the license.
VPN service is not availableThe VPN service is not running in the controller.Restart the controller and retry.
Missing required fields: [...]A required field is missing.Send every required field.
VPN server already enable can not change VPN type!The slot's VPN is on with another type.Turn it off (vpn_enable false) first, then change the type.
Configuration failed: ...Saving or generating the VPN config failed.Check the controller log and retry.
Verified against XProxy v21.3.2 on Nov 17, 2026