Add a default-network WireGuard config
curl --request POST \
--url https://api.ornn.com/v1/orchestrator/networks/shared/peers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"public_key": "exampleClientPublicKeyBase64AAAAAAAAAAAAAA="
}
'import requests
url = "https://api.ornn.com/v1/orchestrator/networks/shared/peers"
payload = { "public_key": "exampleClientPublicKeyBase64AAAAAAAAAAAAAA=" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({public_key: 'exampleClientPublicKeyBase64AAAAAAAAAAAAAA='})
};
fetch('https://api.ornn.com/v1/orchestrator/networks/shared/peers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ornn.com/v1/orchestrator/networks/shared/peers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'public_key' => 'exampleClientPublicKeyBase64AAAAAAAAAAAAAA='
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ornn.com/v1/orchestrator/networks/shared/peers"
payload := strings.NewReader("{\n \"public_key\": \"exampleClientPublicKeyBase64AAAAAAAAAAAAAA=\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ornn.com/v1/orchestrator/networks/shared/peers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"public_key\": \"exampleClientPublicKeyBase64AAAAAAAAAAAAAA=\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ornn.com/v1/orchestrator/networks/shared/peers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"public_key\": \"exampleClientPublicKeyBase64AAAAAAAAAAAAAA=\"\n}"
response = http.request(request)
puts response.read_body{
"peer": {
"id": "99999999-9999-4999-8999-999999999999",
"kind": "user",
"public_key": "exampleClientPublicKeyBase64AAAAAAAAAAAAAA=",
"assigned_ip": "100.96.0.10",
"status": "active",
"created_at": "2026-10-14T12:00:00Z",
"revoked_at": null
},
"network": {
"id": null,
"cidr": "100.96.0.0/16",
"gateway_ip": "100.96.0.1",
"status": "active",
"gateway": {
"public_endpoint": "203.0.113.20",
"public_key": "exampleGatewayPublicKeyBase64BBBBBBBBBBBBB=",
"udp_port": 51820,
"status": "configured"
}
},
"config": "[Interface]\nPrivateKey = <your-wireguard-private-key>\nAddress = 100.96.0.10/32\nMTU = 1200\nDNS = 1.1.1.1\n\n[Peer]\nPublicKey = exampleGatewayPublicKeyBase64BBBBBBBBBBBBB=\nEndpoint = 203.0.113.20:51820\nAllowedIPs = 100.96.0.0/16\nPersistentKeepalive = 25\n"
}{
"code": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}{
"detail": {
"code": "wireguard_public_key_already_used",
"message": "This WireGuard public key is already in use on this VPN gateway. Generate a new keypair, or remove the existing config first."
}
}{
"code": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}Add a default-network WireGuard config
Registers your WireGuard public key on the organization’s default private network and returns a config with a placeholder for your private key. Generate the key pair locally and never send the private key. Retrying with the same public key returns the existing config.
POST
/
v1
/
orchestrator
/
networks
/
shared
/
peers
Add a default-network WireGuard config
curl --request POST \
--url https://api.ornn.com/v1/orchestrator/networks/shared/peers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"public_key": "exampleClientPublicKeyBase64AAAAAAAAAAAAAA="
}
'import requests
url = "https://api.ornn.com/v1/orchestrator/networks/shared/peers"
payload = { "public_key": "exampleClientPublicKeyBase64AAAAAAAAAAAAAA=" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({public_key: 'exampleClientPublicKeyBase64AAAAAAAAAAAAAA='})
};
fetch('https://api.ornn.com/v1/orchestrator/networks/shared/peers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ornn.com/v1/orchestrator/networks/shared/peers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'public_key' => 'exampleClientPublicKeyBase64AAAAAAAAAAAAAA='
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ornn.com/v1/orchestrator/networks/shared/peers"
payload := strings.NewReader("{\n \"public_key\": \"exampleClientPublicKeyBase64AAAAAAAAAAAAAA=\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ornn.com/v1/orchestrator/networks/shared/peers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"public_key\": \"exampleClientPublicKeyBase64AAAAAAAAAAAAAA=\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ornn.com/v1/orchestrator/networks/shared/peers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"public_key\": \"exampleClientPublicKeyBase64AAAAAAAAAAAAAA=\"\n}"
response = http.request(request)
puts response.read_body{
"peer": {
"id": "99999999-9999-4999-8999-999999999999",
"kind": "user",
"public_key": "exampleClientPublicKeyBase64AAAAAAAAAAAAAA=",
"assigned_ip": "100.96.0.10",
"status": "active",
"created_at": "2026-10-14T12:00:00Z",
"revoked_at": null
},
"network": {
"id": null,
"cidr": "100.96.0.0/16",
"gateway_ip": "100.96.0.1",
"status": "active",
"gateway": {
"public_endpoint": "203.0.113.20",
"public_key": "exampleGatewayPublicKeyBase64BBBBBBBBBBBBB=",
"udp_port": 51820,
"status": "configured"
}
},
"config": "[Interface]\nPrivateKey = <your-wireguard-private-key>\nAddress = 100.96.0.10/32\nMTU = 1200\nDNS = 1.1.1.1\n\n[Peer]\nPublicKey = exampleGatewayPublicKeyBase64BBBBBBBBBBBBB=\nEndpoint = 203.0.113.20:51820\nAllowedIPs = 100.96.0.0/16\nPersistentKeepalive = 25\n"
}{
"code": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}{
"detail": {
"code": "wireguard_public_key_already_used",
"message": "This WireGuard public key is already in use on this VPN gateway. Generate a new keypair, or remove the existing config first."
}
}{
"code": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}CLI equivalent:
ornn vpn-connections configure <reservation-id> --name <name> --private-key <path> --output <path>. The CLI derives the public key locally and writes the completed config.Authorizations
Create an organization API key in Account Settings > Developer. Do not send this key to the Kubernetes API server.
Body
application/json
Your WireGuard public key, 44 characters of base64. Never send the private key.
Was this page helpful?