---
title: "Turn keeping one host's sandbox image prepared on or off. Admin only."
method: PUT
path: "/v1/sandboxes/image-preparation/nodes/{node_id}"
tags: ["Sandboxes"]
---

# Turn keeping one host's sandbox image prepared on or off. Admin only.

`PUT /v1/sandboxes/image-preparation/nodes/{node_id}`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/v1/sandboxes/image-preparation/nodes/{node_id}`
- Auth: HTTP bearer

## Path parameters

- `node_id` integer, required

## Request body

- UpdateHostImagePreparationBody: Turn keeping one host prepared on or off.
  - `keep_prepared` boolean, required: Keep this host's default sandbox image pulled, re-pulling it when an upgrade changes the default. `false` stops that; it removes nothing.

## Response `200`

Updated image preparation of every host

- SandboxImagePreparationResponse: Every host that can run sandboxes and its image preparation.
  - `all_ready` boolean, required: Every eligible host has its default image: the next create on any of them starts without a download.
  - `hosts` HostImagePreparation[], required: Control plane first, then workers by name.
    - `eligible` boolean, required: The host can take new sandboxes, so it is worth preparing.
    - `ineligible_reason` string, nullable: Why the host is not eligible, when it is not.
    - `is_control_plane` boolean, required
    - `keep_prepared` boolean, required: Temps keeps this host's default sandbox image pulled, re-pulling it when the default changes. Turned on by "prepare".
    - `last_error` string, nullable: Why the last preparation failed.
    - `last_error_at` string, date-time, nullable
    - `node_id` integer, required: Node id; `0` for the control plane.
    - `node_name` string, required
    - `prepared_image` string, nullable: The image Temps last prepared on this host.
    - `stale_images` string[], required: Previously prepared images still to remove (a container used them).
    - `status` ImagePrepareStatus, nullable: One host's status for one sandbox image.
      - `already_present` boolean: The image was already on the host when the attempt started: nothing was downloaded.
      - `bytes_done` integer, nullable: Bytes downloaded so far, summed over the layers the registry reported. `None` before the registry reports any size.
      - `bytes_total` integer, nullable: Total bytes to download, summed over the layers reported so far (it grows while the registry announces layers).
      - `detail` string, nullable: What a running pull is doing right now (`downloading`, `extracting`, `building locally`).
      - `error` string, nullable: Why the last attempt failed, or why the host cannot prepare images.
      - `finished_at` string, date-time, nullable: When the last attempt finished.
      - `image` string, required: The exact reference a create on this host would use (tag or `@sha256:` digest), so the pre-pull and the create cannot disagree.
      - `started_at` string, date-time, nullable: When the running or last attempt started.
      - `state` 'not_pulled' | 'pulling' | 'ready' | 'failed' | 'unsupported', required: Where one host stands with one sandbox image.
    - `status_error` string, nullable: Why the status could not be read.

## Other responses

- `401`: Unauthorized
- `403`: Administrator role required
- `404`: No such host
- `500`: The change could not be saved

## Changes

- **2026-11-19** `fa7fe1033472`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/v1/sandboxes/image-preparation/nodes/:node_id/put.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
