For GL routers with a built-in switch button, there is a GUI option More Settings > Button Settings to use it as the on/off switch for either OpenVPN or WireGuard clients. GL-inet doc link (for mini routers)
I have not used the /ovpn/client/set webAPI myself, but -5 indicates it’s missing one or both required parameters. GL-inet API doc link