沙箱
重命名沙箱
修改沙箱名称并返回更新后的详情。名称去除首尾空白后须为 1–64 个字符,且在团队内唯一。
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
PATCH
/sandbox/v1/sandboxes/{sandboxID}● 支持请求参数
sandboxIDstring必填path: 沙箱 ID。
namestring必填新名称;去除首尾空白后须为 1–64 个字符。同团队重名返回 409。请求只允许 name 字段。
返回
200
错误按 E2B 格式返回,参见 错误码
响应
HTTP 200
Updated sandbox detail
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| templateID | string | Identifier of the template from which is the sandbox created |
| alias | string | Alias of the template |
| sandboxID | string | Identifier of the sandbox |
| clientID | string | Identifier of the client |
| startedAt | string | Time when the sandbox was started |
| endAt | string | Time when the sandbox will expire |
| envdVersion | string | Version of the envd running in the sandbox |
| envdAccessToken | string | Access token used for envd communication |
| allowInternetAccess | boolean | Whether internet access was explicitly enabled or disabled for the sandbox. Null means it was not explicitly set. |
| domain | string | Base domain where the sandbox traffic is accessible |
| cpuCount | integer | CPU cores for the sandbox |
| memoryMB | integer | Memory for the sandbox in MiB |
| diskSizeMB | integer | Disk size for the sandbox in MiB |
| metadata | any | Your own string key/value pairs stored with the sandbox; usable as a filter in listSandboxes. |
| state | string | State of the sandbox |
| network | object | Network policy of the sandbox: public access, egress allow and deny lists and proxy. |
| network.allowPublicTraffic | boolean | Specify if the sandbox URLs should be accessible only with authentication. |
| network.allowOut | array<string> | List of allowed destinations for egress traffic. Each entry can be a CIDR block (e.g. "8.8.8.8/32"), a bare IP address (e.g. "8.8.8.8"), or a domain name (e.g. "example.com", "*.example.com"). Allowed entries always take precedence over denied entries. |
| network.denyOut | array<string> | List of denied CIDR blocks or IP addresses for egress traffic. Domain names are not supported for deny rules. |
| network.egressProxy | object | SOCKS5 proxy for sandbox egress. Outbound TCP is tunneled through the proxy after allow/deny filtering; the sandbox is unaware. Domain-matched flows use remote DNS (ATYP=domain). |
| network.maskRequestHost | string | Specify host mask which will be used for all sandbox requests |
| network.httpsPorts | array<integer> | Sandbox ports that serve HTTPS rather than plaintext HTTP. Affects how the proxy reaches the service inside the sandbox; the public URL is HTTPS either way. Certificates are not verified, so self-signed ones work. The envd port (49983) cannot be listed. |
| network.rules | object | Per-domain transform rules applied to matching outbound HTTPS requests. Keys may be exact DNS names (for example, "api.example.com") or a leading wildcard (for example, ".example.com"), and are normalized to lowercase on write. Wildcards match subdomains at any depth but not the apex domain; a bare "" is invalid. Exact rules take precedence, followed by the longest matching wildcard suffix, and matching rule sets are not merged. Broad wildcards such as "*.com" are allowed and may expose transformed credentials to every matching destination the sandbox contacts. Rules do not grant network access; configure allowOut separately to permit the destination. |
| lifecycle | object | Sandbox lifecycle policy returned by sandbox info. |
| lifecycle.autoResume | boolean | Whether the sandbox can auto-resume. |
| lifecycle.onTimeout | string | Action taken when the sandbox times out. |
| volumeMounts | array<object> | Volumes mounted into the sandbox. |
| volumeMounts[].name | string | Name of the volume |
| volumeMounts[].path | string | Path of the volume |
| name | string | Current name of the sandbox. |