Skip to content
中文

Update sandbox network

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

PUT/e2b/sandboxes/{sandboxID}/network● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstringrequired

    path:

  • allow_internet_accessbooleanoptional

    Allow internet access; false is equivalent to denyOut containing 0.0.0.0/0.

  • allowOutarrayoptional

    Allowed egress CIDRs, IPs or domains; allow rules take precedence over deny rules.

  • denyOutarrayoptional

    Denied egress CIDRs or IPs; domains are not supported.

  • egressProxyobjectoptional

    Upstream proxy configuration; not currently applied by this platform.

    Expand sub-fields (3)
    • addressstringrequired

      SOCKS5 proxy address in host:port format (e.g. "proxy.example.com:1080").

    • usernamestringoptional

      Optional SOCKS5 username (RFC 1929), max 255 bytes.

    • passwordstringoptional

      Optional SOCKS5 password (RFC 1929), max 255 bytes.

  • rulesobjectoptional

    Upstream 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/e2b/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.
from e2b import Sandbox

opts = dict(
    api_key="$PRAXIS_API_KEY",
    api_url="https://api.deepraxis.com/e2b",
    domain="sandbox.praxisusercontent.com",
)

Sandbox.update_network("sbx_123", {"allow_internet_access": False}, **opts)
TypeScript
// Call Create sandbox first and replace sbx_123 with its returned sandboxID.
import { Sandbox } from "e2b";

const opts = {
  apiKey: "$PRAXIS_API_KEY",
  apiUrl: "https://api.deepraxis.com/e2b",
  domain: "sandbox.praxisusercontent.com",
};

await Sandbox.updateNetwork("sbx_123", { allowInternetAccess: false }, opts);

Response 204

(204 No Content:成功,无响应体)

Response

HTTP 204

Successfully updated the sandbox network configuration

No response body is declared.