Get host address for a forwarded port
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/host"
payload = { "port": 32768 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/host \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"port": 32768
}'{
"host": "localhost:32768",
"url": "https://3000-s-123.preview.nullspace.example/?edge_token=...",
"websocket_url": "wss://3000-s-123.preview.nullspace.example/?edge_token=...",
"access_token_expires_at": "2023-11-07T05:31:56Z",
"access_token_transport": "query"
}{
"error": "preview port 22 is reserved for SSH access; use the SSH relay or choose an application port",
"code": "unsupported_preview_port",
"request_id": "req_123"
}{
"error": "Missing or invalid bearer credential",
"code": "unauthorized",
"request_id": "req_123"
}{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}Machines
Get host address for a forwarded port
POST
/
v1
/
machines
/
{id}
/
host
Get host address for a forwarded port
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/host"
payload = { "port": 32768 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/host \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"port": 32768
}'{
"host": "localhost:32768",
"url": "https://3000-s-123.preview.nullspace.example/?edge_token=...",
"websocket_url": "wss://3000-s-123.preview.nullspace.example/?edge_token=...",
"access_token_expires_at": "2023-11-07T05:31:56Z",
"access_token_transport": "query"
}{
"error": "preview port 22 is reserved for SSH access; use the SSH relay or choose an application port",
"code": "unsupported_preview_port",
"request_id": "req_123"
}{
"error": "Missing or invalid bearer credential",
"code": "unauthorized",
"request_id": "req_123"
}{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}Authorizations
API key passed as Bearer token
Path Parameters
Machine ID (e.g. mch_a1b2c3d4)
Body
application/json
Machine 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 <= 65535Response
Host address and optional signed edge access URLs
Bare host mapping kept for SDK and CLI compatibility.
Example:
"localhost:32768"
Signed browser HTTP URL when public edge ingress is active.
Example:
"https://3000-s-123.preview.nullspace.example/?edge_token=..."
Signed WebSocket URL when public edge ingress is active.
Example:
"wss://3000-s-123.preview.nullspace.example/?edge_token=..."
Expiration time for the signed edge access URLs.
Transport used for the signed edge access token.
Available options:
query