---
title: "Remove a node from the cluster entirely. The node must be drained first so its current containers have been rescheduled. Containers no deployment needs that may still exist on the node (a failed deployment's, ones retired while it was offline, or ones a redeploy replaced while it was unreachable) are removed first; if any cannot be, the removal is refused unless `force=true`, which records them as orphaned."
method: DELETE
path: "/internal/nodes/{node_id}"
tags: ["Nodes"]
---

# Remove a node from the cluster entirely. The node must be drained first so its current containers have been rescheduled. Containers no deployment needs that may still exist on the node (a failed deployment's, ones retired while it was offline, or ones a redeploy replaced while it was unreachable) are removed first; if any cannot be, the removal is refused unless \`force=true\`, which records them as orphaned.

`DELETE /internal/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/internal/nodes/{node_id}`
- Auth: HTTP bearer

The node's ID is taken out of every environment's (and project default's)
target nodes, and the response lists them in `placements_updated`. When the
node is the only target of a placement the removal is refused with `409`
naming those environments, since emptying it would let them run anywhere.

## Path parameters

- `node_id` integer, required

## Query parameters

- `force` boolean

## Response `200`

Node removed

- RemoveNodeResponse
  - `id` integer, required
  - `lost_environments` string[]: Environments that were still serving from the node when it was removed as gone (`force=true` on an unreachable node, ADR 057). Their containers there are recorded as orphaned; one with no replicas on another node serves nothing until it is redeployed.
  - `message` string, required
  - `orphaned_containers` string[]: Containers Temps could not confirm were removed from the node before it was removed (only with `force=true`). They are recorded as orphaned; remove them on that host by hand if it still exists.
  - `placements_updated` NodePlacementReference[]: Environments (and project defaults) whose target nodes listed the removed node. Its ID was taken out of each; `target_nodes` holds the nodes they still target.
    - `environment_id` integer, nullable: `None` for the project's default placement, which environments without their own `target_nodes` inherit.
    - `environment_name` string, nullable
    - `project_id` integer, required
    - `project_name` string, required
    - `target_nodes` integer[], required: The placement's `target_nodes`: as stored when reporting a refusal, and what is left after the removed node was taken out when reporting an update.

## Other responses

- `401`: Unauthorized
- `404`: Node not found
- `409`: Node still has active containers, live sandboxes, or containers Temps could not confirm were removed (retry with force=true only if the host is gone), or it is the only target node of an environment's placement (`placements` names them; change their target nodes first). For a node the control plane cannot reach that live deployments still serve from, `force_removes_serving` is set and `serving_environments` names them: force=true removes it anyway (ADR 057)
- `500`: Internal server error

## Changes

- **2026-10-23** `7d41b820a372`: 1 info
  - added the optional property `lost_environments` to the response with the `200` status
- **2026-10-23** `24af93ff5379`: 1 warning
  - removed the optional property `lost_environments` from the response with the `200` status
- **2026-10-22** `4c5618818e6d`: 1 info
  - added the optional property `lost_environments` to the response with the `200` status
- **2026-10-22** `add7f7b41ae2`: 1 warning
  - removed the optional property `lost_environments` from the response with the `200` status
- **2026-10-22** `eb81785fa098`: 1 info
  - added the optional property `lost_environments` to the response with the `200` status

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/internal/nodes/:node_id/delete.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)
