---
title: "Steal Tasks"
method: POST
path: "/cluster/steal"
---

# Steal Tasks

`POST /cluster/steal`

Evaluate task stealing policy and reassign claimed tasks between nodes.

Workers report their queue depths; the server runs the steal policy and
returns a list of task reassignments.  Stolen tasks are reset to ``open``
so the receiver node can claim them.

Authorisation requires the node-admin scope, like the other node-registry
mutations (cordon, uncordon, drain, unregister) this sits beside in the
operational-primitives table.  It is deliberately NOT the heartbeat scope
that ``POST /cluster/claims/gossip`` uses: gossip proves each receipt with
its own Ed25519 signature and chain link inside the handler, so its bearer
scope only has to establish fleet membership, whereas here the caller's
reported queue depths drive ``force_claim`` directly with no further proof
to check.

## Request body

- TaskStealRequest — Body for POST /cluster/steal - report queue depths and request rebalancing.
  - `queue_depths` object

## Response `200`

Successful Response

- TaskStealResponse — Response for POST /cluster/steal.
  - `actions` TaskStealAction[], required
    - `donor_node_id` string, required
    - `receiver_node_id` string, required
    - `task_ids` string[], required
  - `total_stolen` integer, required

## Other responses

- `401` — Cluster authentication failed
- `422` — Validation Error

---

[API](https://skmtc.net/sipyourdrink-ltd/apis/bernstein-task-server.md) · [All operations](https://skmtc.net/sipyourdrink-ltd/apis/bernstein-task-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sipyourdrink-ltd/bernstein-task-server/revisions/d52fab9681ed/schema)
