Save Task Occurrence

Saves or completes a task occurrence.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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:

KeyMerge rule
temperaturesPer measurement. Only the keys in the request are written; a key left out keeps the value already recorded.
checklistAs 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.

Path Params
string
required

The opaque occurrence token from the calendar endpoint.

Body Params
boolean

True completes the occurrence, false saves it as a draft. Left out, the occurrence keeps the state it is in.

string

The remarks entered on the occurrence.

string | null

The ID of the user who performed the task, reported back as completion.done_by. Left out, it is not changed.

boolean

True records that the corrective action was deliberately skipped.

type_specific
object

The values entered for the occurrence's own task type, one key per type. See Template types.

custom_fields
object

The values of the library's task custom fields, keyed by field slug.

Responses

Language
Credentials
OAuth2
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json