---
title: "Drain a node: mark it as \"draining\" so no new replicas are scheduled on it, and trigger redeployment of all affected environments so their containers are rescheduled to healthy nodes."
method: POST
path: "/internal/nodes/{node_id}/drain"
tags: ["Nodes"]
---

# Drain a node: mark it as "draining" so no new replicas are scheduled on it, and trigger redeployment of all affected environments so their containers are rescheduled to healthy nodes.

`POST /internal/nodes/{node_id}/drain`

## 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}/drain`
- Auth: HTTP bearer

## Path parameters

- `node_id` integer, required

## Response `200`

Node drain initiated

- DrainNodeResponse
  - `affected_environments` integer, required
  - `id` integer, required
  - `message` string, required
  - `name` string, required
  - `replica_shortfall` integer: Replicas retired with no other node to run them, so their deployments run short of their configured count until this node is undrained.
  - `status` string, required

## Other responses

- `401`: Unauthorized
- `404`: Node not found
- `409`: Node already draining, or a workload only on this node cannot be redeployed elsewhere; the node is unchanged
- `500`: Internal server error, or a redeploy could not be queued (the response says what already happened)

## Changes

- **2026-11-03** `0add2fdd114a`: 1 info
  - added the optional property `replica_shortfall` to the response with the `200` status
- **2026-11-03** `fcfcfae25744`: 1 warning
  - removed the optional property `replica_shortfall` from the response with the `200` status
- **2026-11-03** `af07888c38c0`: 1 info
  - added the optional property `replica_shortfall` to the response with the `200` status
- **2026-10-10** `8fff5a8151ba`: 1 info
  - added the non-success response with the status `409`
- **2026-04-25** `774be20905f2`: 1 info
  - endpoint added

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