Saves or completes a task occurrence.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Saves or completes one occurrence, addressed by the opaque occurrence_id from the calendar endpoint. Requires
permission to perform the task in the occurrence's outlet.
Only the fields present in the payload are written, and the response is the full occurrence, in the same shape as
Get Task Occurrence Details. A planned
occurrence has no record of its own yet — the first save creates it, which is why the same request both starts a
draft and completes it, depending on completed.
Completion is one-way. completed: true stamps the occurrence as done, later edits are recorded as a new version
and the previous one moves into history, and an occurrence that is already completed cannot be sent back to
draft with completed: false.
Editing an occurrence that is already completed additionally requires the permission to edit completed tasks.
Without it, only remarks and custom_fields are accepted; a payload touching any other field answers 403, so
the recorded values (temperatures, checklist, done_by) stay as they were completed. Attachments are never
touched by this endpoint — the ones already on the occurrence are kept.
Who performed the task
done_by records who carried the task out and is reported back as completion.done_by. It has to be a user of
the library with access to the occurrence's outlet, and it is not defaulted: left out, it stays as it was. The
requesting user is recorded separately, as completion.submitted_by.
Values
type_specific accepts only the key of the occurrence's own task type. Temperature measurements are matched to
the template's ranges by key, and value has to be a number — a numeric string is rejected. checklist carries
the labels of the checked items, and a label the template does not define is rejected. The entered values also
decide the outcome: an occurrence whose values fall outside the template's ranges, or whose checklist is not fully
checked, completes with completion.result nok.
The two keys merge by opposite rules, which matters for every partial update:
| Key | Merge rule |
|---|---|
temperatures | Per measurement. Only the keys in the request are written; a key left out keeps the value already recorded. |
checklist | As a whole. Every label left out is stored as unchecked. |
So ticking one more checklist item means sending that label together with every label that was already ticked.
Sending only the new one unchecks the rest. Checklist items are plain labels with no id of their own, which is why
they cannot be addressed one at a time the way a temperature key can.
custom_fields is keyed by field slug, as returned by
Get Task Custom Fields. A slug the library
does not define is rejected, a choices field takes one of its configured options and a multi field a list of
them.
mitigation_skipped is only accepted when the occurrence's mitigation_policy is 1 (optional) — with any other
policy, skipping the corrective action is not a choice the caller has.
What completion demands
Completing an occurrence answers 400 while any of the following holds: a value of its task type is still
missing, a required custom field is not filled in, the result is nok and remarks is empty, or the occurrence
is ahead of its scheduled day while the template has prevent_early_execution set.
