📖 API Documentation
I'm still updating this documentation. If you have any questions, please don't hesitate to contact me 😃
Get Started
To use the REST API of your WGDashboard, you need to obtain an API Key.
Create API Key
- To request an API Key, simply login to your WGDashboard, go to Settings, scroll to the very bottom. Click the switch on the right to enable API Key.
- Click the blur Create button, set an expiry date you want or never expire, then click Done.
Use API Key
- Simply add
wg-dashboard-apikeywith the value of your API key into the HTTP Header.
javascript
fetch('http://server:10086/api/handshake', {
headers: {
'content-type': 'application/json',
'wg-dashboard-apikey': 'insert your api key here'
},
method: "GET"
})Request Method
It will only be POST or GET
Endpoint URL Format
There are 2 types of URL format
- Regular URL
- For example:
/api/getWireguardConfigurations
- For example:
- Regular URL with a parameter in the path
- For example:
/api/deletePeers/<configName>. - Currently,
configNameis the only URL parameter. To use it, simply replace it with an existing WireGuard configuration name. Such aswg0
- For example:
Please do remember to URI encode the peer ID in the API calls to ensure proper handling in request parameters.
Now you're ready
Visit the endpoints in the navigation bar according to your version