WireGuard API

Get user token

curl -d '{"username": "user", "password": "p@ssw0rd"}' \
-H 'Content-Type: application/json' \
https://www.bunkervpn.com/users/api/auth/login/ | jq .
{
"key": " The Token "
}

Get the server list

curl -H 'Authorization: Token PUT-YOUR-TOKEN' \
-H 'Content-Type: application/json' \
https://www.bunkervpn.com/users/api/wg_serverlist/ | jq .
[
{
"name": "Switzerland 2",
"countryflag": "ch",
"server_number": 2,
"publickey": "IBcbsHxmCuTBlCXJyGQhDaIIeU4gfw8u8RW72KwSvSg="
},
{
"name": "Switzerland 1",
"countryflag": "ch",
"server_number": 1,
"publickey": "dwU5W923xWfetS01IDUima9kYHZTRx8Tgh1x9P4tYGc="
}
]

Send your wg public key

server is countryflag+server_number

curl -d '{"publickey": "YOUR WG PUBLICKEY", "server": "ch1"}' \
-H 'Authorization: Token PUT-YOUR-TOKEN' \
-H 'Content-Type: application/json' \
https://www.bunkervpn.com/users/api/wireguard/ | jq .
{
"ip": "YOUR authorized wg IPv4",
"ipv6": "YOUR authorized wg IPV6"
}