Skip to main content
POST
/
control-plane
/
{siteId}
/
transient-forward
Create a transient port forward
curl --request POST \
  --url https://v1.api.altostrat.io/control-plane/{siteId}/transient-forward \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "expire_after_minutes": 120,
  "allow_only_cidr": "203.0.113.42/32",
  "dst_address": "192.168.88.25",
  "dst_port": 8080
}
'
import requests

url = "https://v1.api.altostrat.io/control-plane/{siteId}/transient-forward"

payload = {
"expire_after_minutes": 120,
"allow_only_cidr": "203.0.113.42/32",
"dst_address": "192.168.88.25",
"dst_port": 8080
}
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({
expire_after_minutes: 120,
allow_only_cidr: '203.0.113.42/32',
dst_address: '192.168.88.25',
dst_port: 8080
})
};

fetch('https://v1.api.altostrat.io/control-plane/{siteId}/transient-forward', 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/control-plane/{siteId}/transient-forward",
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([
'expire_after_minutes' => 120,
'allow_only_cidr' => '203.0.113.42/32',
'dst_address' => '192.168.88.25',
'dst_port' => 8080
]),
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/control-plane/{siteId}/transient-forward"

payload := strings.NewReader("{\n \"expire_after_minutes\": 120,\n \"allow_only_cidr\": \"203.0.113.42/32\",\n \"dst_address\": \"192.168.88.25\",\n \"dst_port\": 8080\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://v1.api.altostrat.io/control-plane/{siteId}/transient-forward")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expire_after_minutes\": 120,\n \"allow_only_cidr\": \"203.0.113.42/32\",\n \"dst_address\": \"192.168.88.25\",\n \"dst_port\": 8080\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://v1.api.altostrat.io/control-plane/{siteId}/transient-forward")

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 \"expire_after_minutes\": 120,\n \"allow_only_cidr\": \"203.0.113.42/32\",\n \"dst_address\": \"192.168.88.25\",\n \"dst_port\": 8080\n}"

response = http.request(request)
puts response.read_body
{
  "id": "c4b3a291-8765-4fed-ba98-76543210fedc",
  "port": 52101,
  "revoked_early": false,
  "allow_only_cidr": "203.0.113.42/32",
  "expires_at": "2025-10-29T14:30:00Z",
  "expired": false,
  "entry_point": "edge-us-east-1a.ostrat.io",
  "dst_address": "192.168.88.10",
  "dst_port": 3389,
  "time_to_expire": "30 minutes from now"
}
{
"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 JWT bearer token.

Path Parameters

siteId
string<uuid>
required

The unique identifier for the site.

Example:

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

Body

application/json
expire_after_minutes
integer
required

The number of minutes until the port forward automatically expires.

Required range: 15 <= x <= 1440
Example:

120

allow_only_cidr
string
required

Restrict access to a single source IP address or CIDR range.

Example:

"203.0.113.42/32"

dst_address
string<ipv4>
required

The destination private IP address on the site's LAN.

Example:

"192.168.88.25"

dst_port
integer
required

The destination port on the private device.

Required range: 1 <= x <= 65535
Example:

8080

Response

The newly created transient port forward object.

id
string<uuid>

The unique identifier for the transient port forward.

Example:

"c4b3a291-8765-4fed-ba98-76543210fedc"

port
integer

The public port on the Altostrat management server that forwards traffic.

Example:

52101

revoked_early
boolean

True if the forward was manually revoked before it expired.

Example:

false

allow_only_cidr
string

The source CIDR that is exclusively allowed to connect to the forwarded port.

Example:

"203.0.113.42/32"

expires_at
string<date-time>

The timestamp when this port forward will automatically be removed.

Example:

"2025-10-29T14:30:00Z"

expired
boolean

True if the port forward has expired or been revoked.

Example:

false

entry_point
string

The hostname of the Altostrat management server where the port is open.

Example:

"edge-us-east-1a.ostrat.io"

dst_address
string<ipv4>

The destination private IP address on the site's LAN to forward traffic to.

Example:

"192.168.88.10"

dst_port
integer

The destination port on the private device.

Example:

3389

time_to_expire
string

A human-readable string indicating how long until the forward expires.

Example:

"30 minutes from now"