Controlling gl inet routers with an API

If I want to turn on an OpenVPN or WireGuard client, I have to log in to the router, navigate to the appropriate screen, select the client in the dropdown and click connect.

Is there a way to do this with an API, so I can connect/disconnect programmatically? Like are there RESTful commands that can be issued?

Here are the webAPI endpoints to control OpenVPN and WireGuard.

I have noticed that the documentation are not completely accurate – you may need to switch method GET to POST just as an example.