Skip to main content
PUT
/
vpn
/
instances
/
{instanceId}
Update a VPN instance
curl --request PUT \
  --url https://v1.api.altostrat.io/vpn/instances/{instanceId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Primary Production VPN (Updated)",
  "pushed_routes": [
    "10.0.0.0/8"
  ],
  "public_dns": [
    "1.1.1.1"
  ],
  "domains": [
    "internal.corp"
  ],
  "split_dns": [
    "192.168.1.1"
  ],
  "dns_custom": [
    {
      "name": "fileserver.internal.corp",
      "type": "A",
      "value": "192.168.1.10"
    }
  ]
}
'
import requests

url = "https://v1.api.altostrat.io/vpn/instances/{instanceId}"

payload = {
    "name": "Primary Production VPN (Updated)",
    "pushed_routes": ["10.0.0.0/8"],
    "public_dns": ["1.1.1.1"],
    "domains": ["internal.corp"],
    "split_dns": ["192.168.1.1"],
    "dns_custom": [
        {
            "name": "fileserver.internal.corp",
            "type": "A",
            "value": "192.168.1.10"
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    name: 'Primary Production VPN (Updated)',
    pushed_routes: ['10.0.0.0/8'],
    public_dns: ['1.1.1.1'],
    domains: ['internal.corp'],
    split_dns: ['192.168.1.1'],
    dns_custom: [{name: 'fileserver.internal.corp', type: 'A', value: '192.168.1.10'}]
  })
};

fetch('https://v1.api.altostrat.io/vpn/instances/{instanceId}', 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://v1.api.altostrat.io/vpn/instances/{instanceId}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    'name' => 'Primary Production VPN (Updated)',
    'pushed_routes' => [
        '10.0.0.0/8'
    ],
    'public_dns' => [
        '1.1.1.1'
    ],
    'domains' => [
        'internal.corp'
    ],
    'split_dns' => [
        '192.168.1.1'
    ],
    'dns_custom' => [
        [
                'name' => 'fileserver.internal.corp',
                'type' => 'A',
                'value' => '192.168.1.10'
        ]
    ]
  ]),
  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://v1.api.altostrat.io/vpn/instances/{instanceId}"

	payload := strings.NewReader("{\n  \"name\": \"Primary Production VPN (Updated)\",\n  \"pushed_routes\": [\n    \"10.0.0.0/8\"\n  ],\n  \"public_dns\": [\n    \"1.1.1.1\"\n  ],\n  \"domains\": [\n    \"internal.corp\"\n  ],\n  \"split_dns\": [\n    \"192.168.1.1\"\n  ],\n  \"dns_custom\": [\n    {\n      \"name\": \"fileserver.internal.corp\",\n      \"type\": \"A\",\n      \"value\": \"192.168.1.10\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("PUT", 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.put("https://v1.api.altostrat.io/vpn/instances/{instanceId}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Primary Production VPN (Updated)\",\n  \"pushed_routes\": [\n    \"10.0.0.0/8\"\n  ],\n  \"public_dns\": [\n    \"1.1.1.1\"\n  ],\n  \"domains\": [\n    \"internal.corp\"\n  ],\n  \"split_dns\": [\n    \"192.168.1.1\"\n  ],\n  \"dns_custom\": [\n    {\n      \"name\": \"fileserver.internal.corp\",\n      \"type\": \"A\",\n      \"value\": \"192.168.1.10\"\n    }\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://v1.api.altostrat.io/vpn/instances/{instanceId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Primary Production VPN (Updated)\",\n  \"pushed_routes\": [\n    \"10.0.0.0/8\"\n  ],\n  \"public_dns\": [\n    \"1.1.1.1\"\n  ],\n  \"domains\": [\n    \"internal.corp\"\n  ],\n  \"split_dns\": [\n    \"192.168.1.1\"\n  ],\n  \"dns_custom\": [\n    {\n      \"name\": \"fileserver.internal.corp\",\n      \"type\": \"A\",\n      \"value\": \"192.168.1.10\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "name": "Primary Production VPN",
  "region": "sjc",
  "hostname": "my-vpn-gateway.vpn.altostr.at",
  "configured": true,
  "rsa_ready": true,
  "diffie_hellman_ready": true,
  "server_ready": true,
  "status": [
    "peer-created"
  ],
  "pushed_routes": [
    "10.0.0.0/8"
  ],
  "public_dns": [
    "9.9.9.9"
  ],
  "split_dns": [
    "192.168.1.1"
  ],
  "domains": [
    "internal.corp"
  ],
  "dns_custom": [
    {
      "name": "fileserver.internal.corp",
      "type": "A",
      "value": "192.168.1.10"
    }
  ],
  "firewall": [
    {
      "name": "Allow ICMP",
      "protocol": "icmp",
      "port": "1-65535",
      "source": "0.0.0.0/0",
      "destination": "0.0.0.0/0"
    }
  ],
  "created_at": "2025-10-29T12:30:31Z"
}
{
  "type": "invalid_request_error",
  "code": "parameter_missing",
  "message": "The 'name' parameter is required for this request.",
  "doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}
{
  "type": "invalid_request_error",
  "code": "parameter_missing",
  "message": "The 'name' parameter is required for this request.",
  "doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}
{
  "type": "invalid_request_error",
  "code": "parameter_missing",
  "message": "The 'name' parameter is required for this request.",
  "doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}
{
  "type": "invalid_request_error",
  "code": "parameter_missing",
  "message": "The 'name' parameter is required for this request.",
  "doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}
{
  "type": "invalid_request_error",
  "code": "parameter_missing",
  "message": "The 'name' parameter is required for this request.",
  "doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}

Authorizations

Authorization
string
header
required

Enter your bearer token in the format: Bearer {token}

Path Parameters

instanceId
string<uuid>
required

The unique identifier (UUID) for the VPN instance.

Example:

"d290f1ee-6c54-4b01-90e6-d701748f0851"

Body

application/json
name
string
required

A new human-readable name for the instance.

Required string length: 3 - 20
Example:

"Primary Production VPN (Updated)"

pushed_routes
string[]
required

An updated list of network routes (in CIDR notation) to be pushed to clients.

public_dns
string<ipv4>[]
required

An updated list of public DNS servers for clients.

Required array length: 2 - 4 elements
domains
string[]

An updated list of domain names for split-tunnel DNS.

Maximum array length: 8
split_dns
string<ipv4>[]

An updated list of private DNS servers for split-tunnel DNS.

dns_custom
object[]

An updated list of custom DNS records.

Response

The instance was updated successfully.

id
string<uuid>

The unique identifier for the VPN instance.

Example:

"d290f1ee-6c54-4b01-90e6-d701748f0851"

name
string

A human-readable name for the instance.

Example:

"Primary Production VPN"

region
string

The geographical region where the instance is deployed.

Example:

"sjc"

hostname
string

The fully qualified domain name (FQDN) of the VPN instance.

Example:

"my-vpn-gateway.vpn.altostr.at"

configured
boolean

Indicates if the initial server setup has completed.

Example:

true

rsa_ready
boolean

Indicates if the RSA certificates have been generated.

Example:

true

diffie_hellman_ready
boolean

Indicates if the Diffie-Hellman parameters have been generated.

Example:

true

server_ready
boolean

A general indicator of the server's readiness.

Example:

true

status
string[]

An array of strings indicating any ongoing configuration changes. An empty array means the configuration is stable.

Example:
["peer-created"]
pushed_routes
string[]

A list of network routes (in CIDR notation) that will be pushed to connecting clients.

public_dns
string<ipv4>[]

A list of public DNS servers to be used by clients.

split_dns
string<ipv4>[]

A list of private DNS servers for specific domains (split-tunnel DNS).

domains
string[]

A list of domain names that should be resolved using the split_dns servers.

dns_custom
object[]

A list of custom DNS records to be served by the instance's DNS proxy.

firewall
object[]

A list of firewall rules applied to the instance.

created_at
string<date-time>

The timestamp when the instance was created.

Example:

"2025-10-29T12:30:31Z"