Skip to main content

Create a task and place it in the pool

POST 

/tasks

Puts a new unit of Pick, Pack, or SLAM work into the pending pool. The task is not assigned to any station at creation time — PULL dispatch (POST /stations/{stationId}/task-claims) is the only way a task becomes claimed, consistent with this service's rule that work is never pushed to a named station in advance. cpt (Critical Pull Time) drives dispatch priority: claimNext always selects the earliest-CPT pending task a station is equipped for.

Idempotent per Idempotency-Key (ADR-0028, ADR-0066). Send a caller-chosen Idempotency-Key header on every call. The first request with a given key creates the task; a retry with the same key and the same body replays the stored response verbatim (same status, headers and task id) instead of creating a duplicate. A stored answer is a 2xx or a refusal that is FINAL for the request (a function of the request alone, e.g. invalid-request); a refusal whose cause is state that can change is NOT stored — the key is released and a retry executes again. Reusing a key with a different body is rejected with 409 idempotency-key-reused (after a released refusal the key is free, so a different body is a new request); omitting the header is 400 idempotency-key-required. Postgres is the only runtime, so the check is on in every deployment. Without a repeated key every call creates a new task with a fresh, server-generated id.

Request​

Responses​

Task created and placed in the pending pool (or, on a retry with a repeated Idempotency-Key and identical body, the original response replayed).

Response Headers
    Idempotency-Replayed

    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.

    Location

    Path of the newly created task, e.g. /tasks/{id}.