Move a sandbox to another image, keeping its /workspace, id, name, volumes, environment and previews. Processes restart.
Works on a running sandbox (paused first), a paused one, or a stopped one. It keeps /workspace (your home: dotfiles, pip --user and npm -g installs), volumes, environment, labels, name, previews and ports. It loses everything else on the old disk (sudo installs into /usr/local, apt packages, /etc edits) and every running process. Snapshot it first to keep everything. Charged as a wake. If anything fails the switch is undone and the sandbox stays on its old image with nothing lost (switch_undone). Send Prefer: wait=N (seconds, at most 120) to get the answer once the sandbox has settled; the SDKs do.
Request
- Base URL: https://api.withruntime.com
- URL: https://api.withruntime.com/v1/sandboxes/{id}:switch-image
- Auth: HTTP bearer
Path parameters
Resource identifier (UUID).
Headers
Replaying the same key with the same request within 24 hours returns the first result and never repeats the effect. A refusal is not kept: a request refused before it ran (no_capacity, busy, a limit) runs afresh when sent again with its key. The SDKs send one automatically; the server makes one when absent and returns it in the idempotency-key response header.
Request body
Response
Success
Changes
No recorded changes to this operation across all 1 revision of this API.