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). 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 — including a cached 4xx) instead of creating a duplicate. Reusing a key with a different body is rejected with 409 idempotency-key-reused; 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}.