Create a task template: a configuration that creates tasks automatically when a platform trigger fires. The trigger names a business fact (tour created, tour assigned, each stop of a tour, tour completed, shipment created). 'tour-stop' is the stop trigger: it creates one task per stop when the tour is planned, not when a driver arrives. Each trigger provides data objects (tour; additionally stop for the stop trigger; shipment for shipment triggers) that the template's task name, description, and form may reference in Liquid expressions, resolved once per created task; the same objects' fields are available to the optional rule-group filter that narrows which occurrences fire (dotted paths, e.g. 'tour.carrier' or 'stop.address.city').
Liquid syntax, unknown root variables, and filter fields/operators are validated at save time; a broken definition is rejected with per-field issues. Tasks created by a template carry origin 'template', the template's id in templateId, and the resolved form snapshot; a stop task references its STOP by the stop's stable id (orn:
A template on the stop trigger may set placement, which says at which point of the stop the driver app and the carrier portal prompt its tasks: 'on-arrival' (once the arrival is recorded), 'before-handling' (when the departure begins, before load statuses, barcode scans included, and proofs are captured) or 'before-departure' (after every other step, directly before the departure is recorded). Omitted, the tasks are prompted on arrival. placement on any other trigger is rejected with 400. It is copied onto each task at creation, so changing it later does not move tasks that already exist. It only decides when a task is prompted: a task can be opened at any time, and a blocking task holds its stop's departure whatever its placement.
An optional key gives the template a stable routing label that created tasks carry as templateKey. It must be unique per organization (deleted templates keep theirs, so a key is never reused for a different template) and cannot be changed after creation. The template's identity stays id.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
400bad request - invalid template definition
401unauthorized
409conflict - the key is already used by another template (internalCode TASK_TEMPLATE_KEY_TAKEN; the body names the holder in holderId and its status in holderStatus when the caller may read that template)
