- API Reference
- Box API
- 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.
/vpn_server_configRequest body application/json · required
MTU, or FF for the default 1420.
wg, opvnOpenVPN login user (empty for WireGuard).
OpenVPN login password (empty for WireGuard).
false0 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.
True when the box accepted the request.
Outcome code or message (see the operation's error table).
The caller is not trusted (not loopback, LAN, whitelisted or allowed Tailscale) and sent no valid Basic credentials. The body depends on whether "Basic auth for all API" is on. Routes that also use the panel login can answer a plain-text 401 "Unauthorized Access" instead.
Errors returned in msg
| msg | Meaning | What 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 available | The 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. |