Skip to main content
POST
/
v1
/
sandboxes
/
{id}
/
host
Get host address for a forwarded port
import requests

url = "https://api.13-215-85-171.sslip.io/v1/sandboxes/{id}/host"

payload = { "port": 32768 }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.text)
{
  "host": "localhost:32768",
  "url": "https://api.13-215-85-171.sslip.io/__ns-edge/sandboxes/sb_123/ports/3000/?edge_token=...",
  "websocket_url": "wss://api.13-215-85-171.sslip.io/__ns-edge/sandboxes/sb_123/ports/3000/?edge_token=...",
  "access_token_expires_at": "2023-11-07T05:31:56Z",
  "access_token_transport": "query"
}

Authorizations

Authorization
string
header
required

API key passed as Bearer token

Path Parameters

id
string
required

Sandbox ID (e.g. sb_a1b2c3d4)

Body

application/json
port
integer<uint16>
required

Sandbox guest port for browser preview. Reserved generic-preview ports are rejected: 22 is SSH-specific and 5900-5999 are desktop/VNC-specific.

Required range: 1 <= x <= 65535

Response

Host address and optional signed edge access URLs

host
string
required

Bare host mapping kept for SDK and CLI compatibility.

Example:

"localhost:32768"

url
string | null

Signed browser HTTP URL when public edge ingress is active.

Example:

"https://api.13-215-85-171.sslip.io/__ns-edge/sandboxes/sb_123/ports/3000/?edge_token=..."

websocket_url
string | null

Signed WebSocket URL when public edge ingress is active.

Example:

"wss://api.13-215-85-171.sslip.io/__ns-edge/sandboxes/sb_123/ports/3000/?edge_token=..."

access_token_expires_at
string<date-time> | null

Expiration time for the signed edge access URLs.

access_token_transport
enum<string> | null

Transport used for the signed edge access token.

Available options:
query