Update sandbox network
Call Create sandbox first and replace sbx_123 with its returned sandboxID.
/sandbox/v1/sandboxes/{sandboxID}/network● SupportedRequest parameters
sandboxIDstringrequiredpath: Sandbox ID.
allow_internet_accessbooleanoptionalAllow internet access; false is equivalent to denyOut containing 0.0.0.0/0.
allowOutarrayoptionalAllowed egress CIDRs, IPs or domains; allow rules take precedence over deny rules.
denyOutarrayoptionalDenied egress CIDRs or IPs; domains are not supported.
egressProxyobjectoptionalUpstream proxy configuration; not currently applied by this platform.
Expand sub-fields (3)
addressstringrequiredSOCKS5 proxy address in host:port format (e.g. "proxy.example.com:1080").
usernamestringoptionalOptional SOCKS5 username (RFC 1929), max 255 bytes.
passwordstringoptionalOptional SOCKS5 password (RFC 1929), max 255 bytes.
rulesobjectoptionalUpstream per-domain transform rules; not currently applied by this platform.
Returns
204
Errors follow the E2B format — see error codes
Request
curl
# Call Create sandbox first and replace sbx_123 with its returned sandboxID.
curl -X PUT https://api.deepraxis.com/sandbox/v1/sandboxes/sbx_123/network \
-H "X-API-Key: $PRAXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"allow_internet_access":false}'Python
# Call Create sandbox first and replace sbx_123 with its returned sandboxID.
import requests
api_key = "$PRAXIS_API_KEY"
# Call /sandbox/v1 directly over HTTP.
resp = requests.put(
"https://api.deepraxis.com/sandbox/v1/sandboxes/sbx_123/network",
headers={"X-API-Key": api_key},
json={"allow_internet_access": False},
)
print(resp.status_code, resp.text)TypeScript
// Call Create sandbox first and replace sbx_123 with its returned sandboxID.
const apiKey = "$PRAXIS_API_KEY";
// Call /sandbox/v1 directly over HTTP.
const resp = await fetch(`https://api.deepraxis.com/sandbox/v1/sandboxes/sbx_123/network`, {
method: "PUT",
headers: { "X-API-Key": apiKey, "Content-Type": "application/json" },
body: JSON.stringify({ allow_internet_access: false }),
});
console.log(resp.status, await resp.text());Response 204
(204 No Content:成功,无响应体)Response
HTTP 204
Successfully updated the sandbox network configuration
No response body is declared.