> For the list of every page, fetch /llms.txt. The API contract is the OpenAPI file linked from the API reference.

# Change a running sandbox's network rules

PATCH https%3A%2F%2Fapi.usemeadow.ai/v1/sandboxes/{sandbox_id}
Content-Type: application/json

Replaces the outbound network rules of a running sandbox. A 200 means the
vendor accepted the rules. A change that removes access was in force when
the call returned in every run on both vendors. On Modal, access that a
change adds can stay blocked for some seconds after the 200 (seen: still
blocked right after the call in 3 of 5 runs, open 15 seconds later in the
one run checked again). Modal's call reports no moment at which the rules
took effect, so Meadow cannot wait for it: check from inside the sandbox
before you rely on a new allowance. A common use: create the sandbox with
the hosts that setup needs, then narrow the rules before untrusted code
runs.

Rules:

* `network` is the only field and it is required. It has the same shape and
  the same checks as `network` on create.
* The whole rule set is replaced. A field you leave out is set to its default
  (`false` or an empty list), so `{"network": {}}` opens the network. Send
  every rule you want to keep.
* Sending the same rules again is safe and returns 200.
* The sandbox must be `running`. Any other status returns 409.
* Connections that are already open may be cut when the new rules no longer
  allow them.
* No webhook event is sent for this change.
* A rule set the vendor hosting the sandbox cannot apply returns 400 and
  changes nothing. The message names the cause:
  * Daytona cannot combine `allow_domains` with `allow_cidrs`.
  * Modal changes rules only on a sandbox that was created with
    `allow_domains` or `allow_cidrs`. A Modal sandbox created with an open
    network or with `block_all` returns 400 for every change. A list type
    (`allow_domains` or `allow_cidrs`) can be used in a change only when the
    sandbox was created with at least one entry of that type, and opening the
    network needs both. On Modal, `block_all` in a change is applied as two
    empty allow lists.
  * A Modal sandbox created before this operation existed returns 400.

Scope: `sandboxes`.

```bash
curl -sS -X PATCH "$MEADOW_BASE_URL/v1/sandboxes/$SANDBOX_ID" \
  -H "Authorization: Bearer $MEADOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"network": {"block_all": false, "allow_domains": ["api.example.com"], "allow_cidrs": []}}'
```

Reference: https://docs.usemeadow.ai/api-endpoints/sandboxes/update-sandbox

## Authentication

- `Authorization` header (bearer token, required) — A Meadow API key, sent as `Authorization: Bearer mdw_...`. The header `x-api-key: mdw_...` is accepted in its place.

## Request

### Path parameters

- `sandbox_id` (string, required) — The sandbox `id` returned by `POST /v1/sandboxes`. It must belong to the key's project.

### Body (application/json)

This endpoint expects a SandboxUpdate.

- `network` (NetworkRules, required) — Outbound network rules. With `block_all` false and both lists empty, outbound traffic is open. `block_all` cannot be combined with the allow lists.

## Response

### 200

The sandbox with the new rules in `network`.

- `id` (string, required) — The sandbox id.
- `project_id` (string, required) — The project the sandbox belongs to.
- `status` (enum, required) — - `creating`: accepted. Meadow is trying vendors. - `running`: ready for exec, file, port, and SSH calls. - `terminating`: delete was asked for and the vendor has not confirmed yet. - `terminated`: ended by delete, by `timeout_seconds`, by the idle timeout, or by the vendor at its own lifetime limit. - `failed`: no vendor could create it, or the vendor lost it while it ran. See `failure_reason`.
  - Allowed values: `creating`, `running`, `terminating`, `terminated`, `failed`
- `created_at` (datetime, required) — When the create call was accepted.
- `name` (string, optional, nullable) — The label given at create. Null when none was given.
- `failure_reason` (enum, optional) — Why the sandbox is `failed`. Null otherwise. - `all_providers_failed`: every provider in the route failed, for mixed reasons. Read `attempts`. - `timeout`: every attempt timed out. - `image_pull_failed`: every attempt failed to pull the image. - `build_failed`: every attempt failed to build the image. - `provider_lost`: the sandbox was running and the provider lost it, for example because the image's main command exited on Modal. - `internal`: Meadow failed.
  - Allowed values: `all_providers_failed`, `image_pull_failed`, `build_failed`, `timeout`, `provider_lost`, `internal`
- `provider` (enum, optional, nullable) — The provider hosting the sandbox. Null until one accepts it.
  - Allowed values: `daytona`, `modal`
- `provider_sandbox_id` (string, optional, nullable) — The vendor's own id, for finding the sandbox in their dashboard.
- `attempts` (list of Attempt, optional) — Every try to create the sandbox, in order. Empty until the first try ends.
- `skipped_providers` (list of SkippedProvider, optional) — Providers Meadow moved to the end of the route because their circuit breaker was open (`sandbox_health` on `GET /v1/provider-keys`), in the order it moved them. Empty when the route was tried as written. A moved provider is still tried if every provider before it fails, and then it also appears in `attempts`. The order is decided when the create is about to try a provider, after `POST /v1/sandboxes` has answered 202. So this list is filled on the answer of a `wait=true` create, on `GET /v1/sandboxes/{sandbox_id}` and in webhook events, and is empty on the first 202 of a create that does not wait.
- `resources` (Resources, optional) — The size of the sandbox. Unknown fields return 400.
- `labels` (map from string to string, optional) — The labels given at create. Empty when none were given.
- `ports` (list of integer, optional) — The ports listed at create.
- `ssh` (boolean, optional) — Whether SSH was asked for at create.
- `network` (NetworkRules, optional, nullable) — The outbound network rules in force: the rules given at create, or the rules of the last `PATCH /v1/sandboxes/{sandbox_id}`. All three fields are always present. Null for a sandbox created before Meadow recorded the rules.
- `started_at` (datetime, optional, nullable) — When the sandbox became `running`. Null before that.
- `expires_at` (datetime, optional, nullable) — When `timeout_seconds` ends the sandbox: `started_at` plus the timeout. Null until it is running.
- `terminated_at` (datetime, optional, nullable) — When the sandbox became `terminated`. Null otherwise.
- `cost` (SandboxCost, optional) — What this sandbox costs at the vendor, so far. Returned by `GET /v1/sandboxes/{sandbox_id}` and `GET /v1/sandboxes`, and left out of the other sandbox responses. It is read from the usage records with the same arithmetic as `GET /v1/usage`, so the two agree: this object covers every vendor sandbox the create started, a provider that Meadow moved on from included, and its `cost` is what `sandbox_cost` in `/v1/usage` adds up for this sandbox over its whole life. It is a list price times time, not the vendor's invoice. `cost_status` says how far to trust it: * `price_table`: the size the vendor granted times its list price. * `price_estimated`: an estimate. `cost_reason` says why: `grant_unconfirmed` (the vendor has not yet confirmed the size, so the size asked for is priced), `spot_unconfirmed`, or `meadow_clock` (the sandbox has ended and its time is still Meadow's own count, which runs longer than the vendor's: Meadow has not yet read the time the vendor billed), or `vendor_window_unavailable` (the same, and Meadow can no longer read that time: the account stores no key for the vendor, or the sandbox ended more than 4 days ago). A reason about the price is shown before either when both apply. * `price_unknown`: no cost can be stated, and `cost` is null. Unknown never means free. `cost_reason` is `not_recorded` when no usage record exists yet (records are written about once a minute, and a create that never reached a vendor has none), or the reason the price table gives, such as a GPU type or a shape it has no price for. A create the vendor refused before it made a sandbox has a record that costs 0.

## Errors

### 400 Bad Request Error

The body breaks a rule, or the vendor hosting the sandbox cannot apply the rule set. Nothing was changed.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 401 Unauthorized Error

The key is missing, malformed, unknown, revoked, or expired, or a key it was minted from no longer exists. Check the key and the header.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 403 Forbidden Error

The key does not have the `sandboxes` scope. Use a key that has it.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 404 Not Found Error

No sandbox with this id in the key's project. A sandbox made with a key of another project returns this too, also for an admin key.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 409 Conflict Error

The sandbox is not `running`: it is still being created, or it has ended. Wait for `running`, or create a new sandbox.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 413 Content Too Large Error

The request body is larger than this route allows: 1 MiB for JSON bodies, 16 MiB on the model routes, 100 MiB for a file upload, and 100 MB for a build context.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 429 Too Many Requests Error

More than 20 failed authentications came from your address in one minute, and this request also failed to authenticate: fix the key, wait for `retry-after` seconds, then retry. Or the server instance was full and no slot came free for the account within 3 seconds (`error.code` `account_in_flight_limit_exceeded`): wait for `retry-after` seconds, then retry.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 500 Internal Server Error

Meadow failed. Retry with backoff, and tell us if it persists.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 502 Bad Gateway Error

The sandbox vendor failed, refused, or timed out on this call, or the state of a background command could not be read. Retry with backoff. If it persists, read the sandbox with `GET /v1/sandboxes/{sandbox_id}` to see whether it is still `running`. The code `sandbox_unreachable` means the vendor answered "not found" or "not running" for a sandbox that it still reports as running, or Meadow could not tell which. Nothing was changed and no command was ended. The response carries `Retry-After`. Send the call again.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

## Types

### NetworkRules

Outbound network rules. With `block_all` false and both lists empty, outbound traffic is open. `block_all` cannot be combined with the allow lists.

- `block_all` (boolean, optional, default: false) — Block all outbound traffic.
- `allow_domains` (list of string, optional) — Allow outbound traffic only to these host names. Each may start with one wildcard label, such as `*.example.com`. IP addresses, ports, schemes, paths and wildcards elsewhere return 400. Use `allow_cidrs` for addresses. Meadow sends each entry to the vendor as written, and the vendor applies it. On Daytona and on Modal, `*.example.com` covers every subdomain and also `example.com` itself, and a plain name does not cover its subdomains. What an allowed name opens differs by vendor. On Daytona it opens the name on ports 80, 443 and 22 (other ports not checked). On Modal it opens TLS on port 443 only, and plain HTTP on port 80 is refused. An `https://` URL that redirects to `http://` therefore works on Daytona and fails on Modal. Seen on both vendors on 2026-11-27.
- `allow_cidrs` (list of string, optional) — Allow outbound traffic only to these CIDR ranges, such as `203.0.113.0/24`.

### Attempt

One try at one vendor, for a model call or a sandbox create.

- `provider` (enum, required) — The name of a vendor. Model providers and sandbox providers share one list. Model providers: `anthropic`, `openai`, `google`, `xai`, `azure`, `bedrock`, `vertex`, `openrouter`, `fireworks`, `deepseek`. Sandbox providers: `daytona`, `modal`.
  - Allowed values: `anthropic`, `openai`, `google`, `xai`, `azure`, `bedrock`, `vertex`, `openrouter`, `fireworks`, `deepseek`, `daytona`, `modal`
- `outcome` (enum, required) — How the try ended. - `served`: this vendor served the request. - `unsupported`: the vendor cannot do what was asked, such as a resource size, a network rule, or a model it does not offer. - `refused`: the vendor rejected the request or the stored credential. - `no_capacity`: the vendor had no capacity. - `timeout`: the vendor did not answer in time. - `rate_limited`: the vendor answered 429. - `error`: any other failure.
  - Allowed values: `served`, `unsupported`, `refused`, `no_capacity`, `timeout`, `rate_limited`, `error`
- `reason` (enum, optional) — A stable code for why the try ended as it did. It is narrower than `outcome`, and it is the code to branch on or to count. More values can be added: treat one you do not know like `vendor_error`. - `served`: this vendor served the request. - `no_capacity`: the vendor had no capacity. - `quota_exceeded`: the vendor account is out of quota or credit. - `rate_limited`: the vendor answered 429. - `timeout`: the vendor did not answer in time. - `auth_failed`: the vendor rejected the stored vendor key. - `invalid_request`: the vendor rejected the request itself. - `refused`: the vendor refused for another reason. - `unsupported`: the vendor cannot do what was asked, such as a model, a GPU type, a size or a network rule. - `no_provider_key`: skipped, because no usable vendor key was stored. - `image_pull_failed`, `build_failed`: the vendor could not pull or build the image (sandboxes). - `provider_lost`: the vendor lost the sandbox while it was starting. - `vendor_error`: any other failure.
  - Allowed values: `served`, `no_capacity`, `quota_exceeded`, `rate_limited`, `timeout`, `auth_failed`, `invalid_request`, `refused`, `unsupported`, `no_provider_key`, `image_pull_failed`, `build_failed`, `provider_lost`, `vendor_error`
- `started_at` (datetime, optional) — When Meadow started this try. Absent on attempts recorded before 2026-11-24.
- `finished_at` (datetime, optional) — When this try ended.
- `detail` (string, optional) — A short description of what happened, written by Meadow, such as `provider returned HTTP 404`. On a `served` sandbox attempt it reports resources the vendor granted that differ from the request, such as `provider granted cpu 2 instead of 1.5` or `gpu type H200 instead of H100`. It says `provider built a copy of the image for this size` when this create made a new Daytona snapshot for an `image_id`. On an `unsupported` attempt it carries the vendor's size limit, such as `daytona cannot serve this size: CPU request 8 exceeds maximum allowed per sandbox (4)`. Absent when there is nothing to say.
- `duration_ms` (integer, optional) — How long the try took, in milliseconds.

### SkippedProvider

One provider that Meadow moved to the end of a sandbox create's route, and why.

- `provider` (enum, required)
  - Allowed values: `daytona`, `modal`
- `reason` (string, required) — The attempt reason that opened the provider's breaker, as in `attempts[].reason`: `quota_exceeded`, `no_capacity`, `rate_limited`, `timeout` or `vendor_error`. More values can be added. A route you set with `provider.order` or the project's `routing.sandboxes.order` is tried as written unless the first provider is open on a hard signal: the vendor answered `quota_exceeded` or `no_capacity` for this account, or 3 creates in a row failed with `timeout` or `vendor_error` within 10 minutes. A route with no order (Meadow's default, or `provider.only` alone) moves any open provider back, `rate_limited` included.
- `health_state` (string, required) — The breaker state when the provider was moved, as in `sandbox_health.state`: `open` or `half_open`.
- `consecutive_failures` (integer, required) — Failed creates in the run that opened the breaker.
- `skipped_at` (datetime, required) — When Meadow moved the provider.
- `retry_at` (datetime, optional, nullable) — When the breaker lets a create try the provider again.

### Resources

The size of the sandbox. Unknown fields return 400.

- `cpu` (double, optional, default: 2) — The most CPU the sandbox can use. Must be above 0. The unit differs by vendor and Meadow does not convert it: Daytona counts virtual CPUs and rounds up to a whole number. Modal counts physical cores, which it documents as two virtual CPUs each, and takes fractions. Modal also reserves this amount. Size `cpu` for the vendor that will serve. With `provider.options.modal.burst: true` it is only a floor on Modal.
- `memory_mb` (integer, optional, default: 4096) — The most memory the sandbox can use, in MB, at least 1. Daytona rounds up to a whole GiB. A command that passes the limit is killed on Daytona. On Modal the whole sandbox ends and reads `failed` with `provider_lost`. With `provider.options.modal.burst: true` it is only a floor on Modal.
- `disk_mb` (integer, optional) — Disk in MB, at least 1. Daytona rounds up to a whole GiB and gives 3 GiB when this is left out. Modal has no disk setting: every sandbox gets 512 GiB, and a request above that skips Modal with an `unsupported` attempt.
- `gpu` (ResourcesGpu, optional) — Ask for GPUs. Left out, the sandbox has none.

### SandboxCost

What this sandbox costs at the vendor, so far. Returned by `GET /v1/sandboxes/{sandbox_id}` and `GET /v1/sandboxes`, and left out of the other sandbox responses. It is read from the usage records with the same arithmetic as `GET /v1/usage`, so the two agree: this object covers every vendor sandbox the create started, a provider that Meadow moved on from included, and its `cost` is what `sandbox_cost` in `/v1/usage` adds up for this sandbox over its whole life. It is a list price times time, not the vendor's invoice. `cost_status` says how far to trust it: * `price_table`: the size the vendor granted times its list price. * `price_estimated`: an estimate. `cost_reason` says why: `grant_unconfirmed` (the vendor has not yet confirmed the size, so the size asked for is priced), `spot_unconfirmed`, or `meadow_clock` (the sandbox has ended and its time is still Meadow's own count, which runs longer than the vendor's: Meadow has not yet read the time the vendor billed), or `vendor_window_unavailable` (the same, and Meadow can no longer read that time: the account stores no key for the vendor, or the sandbox ended more than 4 days ago). A reason about the price is shown before either when both apply. * `price_unknown`: no cost can be stated, and `cost` is null. Unknown never means free. `cost_reason` is `not_recorded` when no usage record exists yet (records are written about once a minute, and a create that never reached a vendor has none), or the reason the price table gives, such as a GPU type or a shape it has no price for. A create the vendor refused before it made a sandbox has a record that costs 0.

- `currency` (string, required) — The currency of `cost_per_hour` and `cost`.
- `cost_status` (enum, required) — How the cost was reached. See above.
  - Allowed values: `price_table`, `price_estimated`, `price_unknown`
- `cost_per_hour` (double, optional, nullable) — The hourly list price of the vendor sandbox that serves this sandbox, or last served it. Null when no vendor sandbox served it or its price is unknown.
- `cost` (double, optional, nullable) — The cost so far across every vendor sandbox this create started. Null when `cost_status` is `price_unknown`.
- `cost_reason` (string, optional, nullable) — Why the cost is unknown or an estimate. Null with `price_table`.
- `billed_from` (datetime, optional, nullable) — When the first vendor sandbox of this create began to count: the moment Meadow asked the vendor for it. Null when there is no usage record.
- `billed_to` (datetime, optional, nullable) — When the last vendor sandbox stopped counting: the vendor confirmed it gone, or its own lifetime ended. Null while any is still counting. A deleted sandbox keeps counting, for up to about a minute, until the next usage record is written. `cost` is final once this is set and `cost_reason` is neither `meadow_clock` nor `vendor_window_unavailable`: Meadow reads the time the vendor billed 2 minutes after the end, then again with a wait that doubles, for 4 days.
- `billed_seconds` (double, optional) — Seconds counted so far, added over the vendor sandboxes. It is `sandbox_seconds` in `GET /v1/usage` for this sandbox.

### ErrorError

- `type` (enum, required) — The class of the failure. - `invalid_request`: the request is malformed or breaks a rule (400), or is too large (413). - `conflict`: the request is valid and the current state refuses it (409). Before 2026-11-24 a 409 used `invalid_request`. - `unauthorized`: the key is missing, unknown, revoked, or expired (401). - `forbidden`: the key's scope or limit does not allow this, or the project's routing is locked (403). - `not_found`: no such resource or route (404). - `no_provider_key`: no stored credential can serve this request (422). - `all_providers_failed`: every vendor in the route was tried (502). - `provider_error`: a vendor failed and no fallback was possible (502). - `rate_limited`: too many requests (429). - `insufficient_quota`: a dollar `limit` on the key, or on a key above it, is spent (402). The name is OpenAI's. - `unavailable`: a dependency Meadow needs is not set up (503). - `internal`: Meadow failed (500), or the feature is not set up (501).
  - Allowed values: `invalid_request`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `no_provider_key`, `all_providers_failed`, `provider_error`, `rate_limited`, `insufficient_quota`, `unavailable`, `internal`
- `message` (string, required) — A sentence for people. It can change, so do not match on it.
- `code` (string, optional) — A stable name for the specific failure. Every Meadow error carries one. `type` stays the general class, and several codes share a type. Branch on `code` when you need to tell two failures of one type apart, for example `api_key_expired` from `api_key_revoked`. The full list is in the Errors guide. A new code can be added at any time, so treat a code you do not know as its `type`. A spent limit (`key_request_limit_exceeded`, `key_token_limit_exceeded`) stays a 403 and not a 429, so a client that retries a 429 does not resend a call a spent key can never make. A spent dollar `limit` (`key_spend_limit_exceeded`) is a 402 for the same reason.
- `param` (string, optional) — The request field, query parameter or header the error is about, when there is one. A nested field is written with dots, such as `credentials.api_key`. Set on most validation errors (400).
- `attempts` (list of Attempt, optional) — The vendors Meadow tried for this request, in order. Present only when it tried at least one.
- `retry` (enum, optional) — Whether to send the same request again. Set on routes under `/v1/sandboxes` only. The values are BoxRouter's (https://boxrouter.ai/docs/error-codes). - `safe`: send the same request again, after `retry-after` seconds when the response has that header. A 429, a 409 `exec_start_in_progress` or `idempotency_request_in_progress`, a 502 `sandbox_unreachable`, and a 5xx on a `GET`, `PUT` or `DELETE`, on `POST /v1/sandboxes/route`, or on a sandbox create or background command start sent with `Idempotency-Key`. - `after_fix`: change the request, the key or the account first. Any other 4xx. - `check_outcome`: read the sandbox or the command before you send it again, because the work may have happened. A 5xx on any other `POST`, which includes a blocking command. - `never`: do not send it again. A 501. When the response has `x-should-retry`, `retry` is `safe` exactly when the header is `true`.
  - Allowed values: `safe`, `after_fix`, `check_outcome`, `never`
- `outcome` (enum, optional) — What happened to the work. Set on routes under `/v1/sandboxes` only. The values are BoxRouter's (https://boxrouter.ai/docs/error-codes). - `not_started`: nothing was changed. Every 4xx, a 501, and a 502 `sandbox_unreachable`. - `unknown`: the work may have happened. Any other 5xx. - `completed` and `partial`: the work happened, in whole or in part. Meadow does not send them today. Handle them as `unknown`. A sandbox create that fails after Meadow accepted it is not an error response: the create returns 202, and the sandbox later has `status` `failed` and a `failure_reason`.
  - Allowed values: `not_started`, `completed`, `partial`, `unknown`

### ResourcesGpu

Ask for GPUs. Left out, the sandbox has none.

- `type` (list of string, optional) — GPU models in order of preference. Required and not empty when `gpu` is sent. A provider that offers none of them is skipped with an `unsupported` attempt. Names are matched without case, and `_` or a space counts as `-`. A name no provider offers returns 400. - Daytona offers `H100`, `H200`, `B200`, `B300`, `L40S`, `RTX-PRO-6000`, `RTX-4090`, `RTX-5090` and `MI355X`. It takes the first name with free capacity. - Modal offers `T4`, `L4`, `A10`, `A100`, `A100-40GB`, `A100-80GB`, `L40S`, `RTX-PRO-6000`, `H100`, `H200`, `B200`, `B200+` and `B300`. It takes the first name it offers and does not try the next one when that type has no capacity. A name may end in `!`, which means exactly this type, such as `H100!`. Modal may place a plain `H100` on an H200 and a plain `A100` on an 80 GB A100. With `!` it does not: `H100!` is sent to Modal as written and `A100!` is sent as `A100-40GB`. For every other type the mark changes nothing, because the vendors already place exactly that type. Daytona has no such mark and gets the name without it. `B200+` means a B200 or a B300: Modal chooses, and Daytona takes whichever of the two has free capacity, B200 first. The sandbox returns the names as you wrote them. When the vendor placed a different type than the first one asked for, the served attempt's `detail` says so.
- `count` (integer, optional, default: 1) — How many GPUs, at least 1.

## Examples

### After the first example

**Response**

```json
{
  "id": "sbx_000038c2",
  "project_id": "prj_000057e9",
  "status": "running",
  "created_at": "2026-11-23T22:20:18.291Z",
  "name": "agent-run",
  "provider": "daytona",
  "provider_sandbox_id": "00000000-254a",
  "attempts": [
    {
      "provider": "daytona",
      "outcome": "served",
      "duration_ms": 1275
    }
  ],
  "resources": {
    "cpu": 1,
    "memory_mb": 1024
  },
  "labels": {
    "owner": "evals",
    "purpose": "docs"
  },
  "ports": [
    8000
  ],
  "ssh": true,
  "network": {
    "block_all": false,
    "allow_domains": [
      "api.example.com"
    ],
    "allow_cidrs": []
  },
  "started_at": "2026-11-23T22:20:19.767Z",
  "expires_at": "2026-11-23T22:50:19.767Z",
  "terminated_at": null
}
```

**SDK Code**

```python After the first example
import requests

url = "https://api.example.com/v1/sandboxes/sbx_0000be20"

headers = {"Authorization": "Bearer <token>"}

response = requests.patch(url, headers=headers)

print(response.json())
```

```javascript After the first example
const url = 'https://api.example.com/v1/sandboxes/sbx_0000be20';
const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go After the first example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/sandboxes/sbx_0000be20"

	req, _ := http.NewRequest("PATCH", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby After the first example
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/sandboxes/sbx_0000be20")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java After the first example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.example.com/v1/sandboxes/sbx_0000be20")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php After the first example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.example.com/v1/sandboxes/sbx_0000be20', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp After the first example
using RestSharp;

var client = new RestClient("https://api.example.com/v1/sandboxes/sbx_0000be20");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift After the first example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/sandboxes/sbx_0000be20")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Allow one host only

**Request**

```json
{
  "network": {
    "block_all": false,
    "allow_domains": [
      "api.example.com"
    ],
    "allow_cidrs": []
  }
}
```

**Response**

```json
{
  "id": "sbx_000038c2",
  "project_id": "prj_000057e9",
  "status": "running",
  "created_at": "2026-11-23T22:20:18.291Z",
  "name": "agent-run",
  "provider": "daytona",
  "provider_sandbox_id": "00000000-254a",
  "attempts": [
    {
      "provider": "daytona",
      "outcome": "served",
      "duration_ms": 1275
    }
  ],
  "resources": {
    "cpu": 1,
    "memory_mb": 1024
  },
  "labels": {
    "owner": "evals",
    "purpose": "docs"
  },
  "ports": [
    8000
  ],
  "ssh": true,
  "network": {
    "block_all": false,
    "allow_domains": [
      "api.example.com"
    ],
    "allow_cidrs": []
  },
  "started_at": "2026-11-23T22:20:19.767Z",
  "expires_at": "2026-11-23T22:50:19.767Z",
  "terminated_at": null
}
```

**SDK Code**

```python Allow one host only
import requests

url = "https://api.example.com/v1/sandboxes/sbx_0000be20"

payload = { "network": {
        "block_all": False,
        "allow_domains": ["api.example.com"],
        "allow_cidrs": []
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Allow one host only
const url = 'https://api.example.com/v1/sandboxes/sbx_0000be20';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"network":{"block_all":false,"allow_domains":["api.example.com"],"allow_cidrs":[]}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Allow one host only
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/sandboxes/sbx_0000be20"

	payload := strings.NewReader("{\n  \"network\": {\n    \"block_all\": false,\n    \"allow_domains\": [\n      \"api.example.com\"\n    ],\n    \"allow_cidrs\": []\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Allow one host only
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/sandboxes/sbx_0000be20")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"network\": {\n    \"block_all\": false,\n    \"allow_domains\": [\n      \"api.example.com\"\n    ],\n    \"allow_cidrs\": []\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Allow one host only
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.example.com/v1/sandboxes/sbx_0000be20")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"network\": {\n    \"block_all\": false,\n    \"allow_domains\": [\n      \"api.example.com\"\n    ],\n    \"allow_cidrs\": []\n  }\n}")
  .asString();
```

```php Allow one host only
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.example.com/v1/sandboxes/sbx_0000be20', [
  'body' => '{
  "network": {
    "block_all": false,
    "allow_domains": [
      "api.example.com"
    ],
    "allow_cidrs": []
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Allow one host only
using RestSharp;

var client = new RestClient("https://api.example.com/v1/sandboxes/sbx_0000be20");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"network\": {\n    \"block_all\": false,\n    \"allow_domains\": [\n      \"api.example.com\"\n    ],\n    \"allow_cidrs\": []\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Allow one host only
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["network": [
    "block_all": false,
    "allow_domains": ["api.example.com"],
    "allow_cidrs": []
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/sandboxes/sbx_0000be20")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Block all outbound traffic

**Request**

```json
{
  "network": {
    "block_all": true,
    "allow_domains": [],
    "allow_cidrs": []
  }
}
```

**Response**

```json
{
  "id": "sbx_000038c2",
  "project_id": "prj_000057e9",
  "status": "running",
  "created_at": "2026-11-23T22:20:18.291Z",
  "name": "agent-run",
  "provider": "daytona",
  "provider_sandbox_id": "00000000-254a",
  "attempts": [
    {
      "provider": "daytona",
      "outcome": "served",
      "duration_ms": 1275
    }
  ],
  "resources": {
    "cpu": 1,
    "memory_mb": 1024
  },
  "labels": {
    "owner": "evals",
    "purpose": "docs"
  },
  "ports": [
    8000
  ],
  "ssh": true,
  "network": {
    "block_all": false,
    "allow_domains": [
      "api.example.com"
    ],
    "allow_cidrs": []
  },
  "started_at": "2026-11-23T22:20:19.767Z",
  "expires_at": "2026-11-23T22:50:19.767Z",
  "terminated_at": null
}
```

**SDK Code**

```python Block all outbound traffic
import requests

url = "https://api.example.com/v1/sandboxes/sbx_0000be20"

payload = { "network": {
        "block_all": True,
        "allow_domains": [],
        "allow_cidrs": []
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Block all outbound traffic
const url = 'https://api.example.com/v1/sandboxes/sbx_0000be20';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"network":{"block_all":true,"allow_domains":[],"allow_cidrs":[]}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Block all outbound traffic
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/sandboxes/sbx_0000be20"

	payload := strings.NewReader("{\n  \"network\": {\n    \"block_all\": true,\n    \"allow_domains\": [],\n    \"allow_cidrs\": []\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Block all outbound traffic
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/sandboxes/sbx_0000be20")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"network\": {\n    \"block_all\": true,\n    \"allow_domains\": [],\n    \"allow_cidrs\": []\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Block all outbound traffic
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.example.com/v1/sandboxes/sbx_0000be20")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"network\": {\n    \"block_all\": true,\n    \"allow_domains\": [],\n    \"allow_cidrs\": []\n  }\n}")
  .asString();
```

```php Block all outbound traffic
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.example.com/v1/sandboxes/sbx_0000be20', [
  'body' => '{
  "network": {
    "block_all": true,
    "allow_domains": [],
    "allow_cidrs": []
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Block all outbound traffic
using RestSharp;

var client = new RestClient("https://api.example.com/v1/sandboxes/sbx_0000be20");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"network\": {\n    \"block_all\": true,\n    \"allow_domains\": [],\n    \"allow_cidrs\": []\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Block all outbound traffic
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["network": [
    "block_all": true,
    "allow_domains": [],
    "allow_cidrs": []
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/sandboxes/sbx_0000be20")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Open the network

**Request**

```json
{
  "network": {
    "block_all": false,
    "allow_domains": [],
    "allow_cidrs": []
  }
}
```

**Response**

```json
{
  "id": "sbx_000038c2",
  "project_id": "prj_000057e9",
  "status": "running",
  "created_at": "2026-11-23T22:20:18.291Z",
  "name": "agent-run",
  "provider": "daytona",
  "provider_sandbox_id": "00000000-254a",
  "attempts": [
    {
      "provider": "daytona",
      "outcome": "served",
      "duration_ms": 1275
    }
  ],
  "resources": {
    "cpu": 1,
    "memory_mb": 1024
  },
  "labels": {
    "owner": "evals",
    "purpose": "docs"
  },
  "ports": [
    8000
  ],
  "ssh": true,
  "network": {
    "block_all": false,
    "allow_domains": [
      "api.example.com"
    ],
    "allow_cidrs": []
  },
  "started_at": "2026-11-23T22:20:19.767Z",
  "expires_at": "2026-11-23T22:50:19.767Z",
  "terminated_at": null
}
```

**SDK Code**

```python Open the network
import requests

url = "https://api.example.com/v1/sandboxes/sbx_0000be20"

payload = { "network": {
        "block_all": False,
        "allow_domains": [],
        "allow_cidrs": []
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Open the network
const url = 'https://api.example.com/v1/sandboxes/sbx_0000be20';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"network":{"block_all":false,"allow_domains":[],"allow_cidrs":[]}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Open the network
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/sandboxes/sbx_0000be20"

	payload := strings.NewReader("{\n  \"network\": {\n    \"block_all\": false,\n    \"allow_domains\": [],\n    \"allow_cidrs\": []\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Open the network
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/sandboxes/sbx_0000be20")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"network\": {\n    \"block_all\": false,\n    \"allow_domains\": [],\n    \"allow_cidrs\": []\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Open the network
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.example.com/v1/sandboxes/sbx_0000be20")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"network\": {\n    \"block_all\": false,\n    \"allow_domains\": [],\n    \"allow_cidrs\": []\n  }\n}")
  .asString();
```

```php Open the network
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.example.com/v1/sandboxes/sbx_0000be20', [
  'body' => '{
  "network": {
    "block_all": false,
    "allow_domains": [],
    "allow_cidrs": []
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Open the network
using RestSharp;

var client = new RestClient("https://api.example.com/v1/sandboxes/sbx_0000be20");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"network\": {\n    \"block_all\": false,\n    \"allow_domains\": [],\n    \"allow_cidrs\": []\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Open the network
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["network": [
    "block_all": false,
    "allow_domains": [],
    "allow_cidrs": []
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/sandboxes/sbx_0000be20")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```