Sweep every Claimed task whose lease has expired back to Pending
POST/task-lease-expirations
The Clock-driven side of the at-most-once lease design: scans every Claimed task and, for each whose lease expiry has passed without a renewal or completion, frees it back to Pending (publishing LeaseExpired) so the work is never silently lost. A collection- level action on the tasks resource — not scoped to a single task id — analogous to how /tasks/{id}/completions is a single-resource action; deliberately not placed under an unscoped /admin path. Idempotent: a second call simply frees nothing new if nothing else has expired since the last sweep. Takes no request body.
Request
Responses
- 200
- 400
- 409
- 500
Sweep completed; body reports how many tasks were freed.
Response Headers
Present, with the value true, ONLY when this answer is the stored replay of an earlier request that used the same Idempotency-Key (the handler did not run again). The first execution never carries it.
The Idempotency-Key header is missing (idempotency-key-required) or not 1-128 printable ASCII characters (idempotency-key-invalid) on a POST, or the request body could not be read or contains a NUL character (malformed-request-body), or the request body is malformed JSON, a required field is missing or empty, or a field value is invalid (e.g. a task type outside the TaskType enum).
The Idempotency-Key was already used with a different method, path or body (idempotency-key-reused). Use a new key for a genuinely different request. Distinguished from a business conflict by the problem type.
An unexpected server-side failure (e.g. a repository or event-publisher error).