Create a task template: a configuration that creates tasks automatically when a platform trigger fires, or on a schedule (see below). A platform 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'), together with the tenant's tour or shipment properties at 'tour.properties.
Liquid syntax, unknown root variables, and filter fields/operators are validated at save time, property rules against the tenant's current property definitions; 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), 'after-loads' (during the departure, after the driver marks or scans the loads and before a signature, photo or other proof is captured; a proof the driver starts by hand does not bring it up, and the carrier portal prompts it with the other departure placements) 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.
A schedule trigger (type: 'schedule') fires on a cadence (daily, on chosen weekdays, or monthly on a day or the last day) at a time in a time zone, optionally between a start and an end day. It refers to one vehicle, carrier or carrier user, or to a set of them (the active vehicles of a carrier or of the organization, every active carrier, the active users of a carrier) narrowed by optional conditions, and creates one task per object at every occurrence, at most 500. Its data objects are the object ('vehicle', 'carrier' or 'carrierUser') and 'occurrence' (the scheduled time as occurrence.date). It may assign each task relative to its object and set a due time of day; its tasks never block. A schedule template whose one object is deleted or set inactive deactivates itself and says why in autoDeactivation.
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
403The role of the API key does not allow this action. The key needs a role with the matching permission, for example full access.
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)
