---
updatedAt: 2026-09-23T17:19:42.000Z
agentTools:
  projectIndex: https://developers.apicbase.com/llms.txt
---

# Save Task Occurrence

Edits an existing task occurrence without resolving it.

Requires permission to perform the task in the occurrence's outlet. Editing an occurrence that is already completed or marked not applicable requires the permission to edit completed tasks instead.

For a full explanation of task occurrences, see [Recording Task Occurrences](https://developers.apicbase.com/docs/task-occurrences).

Attachments are never touched here. They have their own endpoints.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "apicbase",
    "version": "2"
  },
  "servers": [
    {
      "url": "https://api.apicbase.com/api/v2/"
    }
  ],
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/compliance/tasks/occurrences/{occurrence_id}/": {
      "patch": {
        "summary": "Save Task Occurrence",
        "description": "Saves values on one task occurrence without resolving it. Only the fields present in the payload are written. Completing an occurrence and marking it not applicable are separate endpoints. On an occurrence that is already completed or marked not applicable this endpoint still accepts `remarks`, `done_by` and `custom_fields`, but refuses `type_specific`: the recorded measurement is edited through [Complete Task Occurrence](https://developers.apicbase.com/reference/complete-occurrence).",
        "operationId": "save-occurrence",
        "parameters": [
          {
            "name": "occurrence_id",
            "in": "path",
            "description": "The opaque occurrence token from the calendar endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "remarks": {
                    "type": "string",
                    "example": "Cooler was 1 degree over, door left open.",
                    "description": "The remarks entered on the occurrence."
                  },
                  "done_by": {
                    "type": "string",
                    "nullable": true,
                    "example": "100000000000045",
                    "description": "The ID of the user who performed the task, reported back as completion.done_by. Has to be a user of the library with access to the occurrence's outlet. Left out, it is not changed."
                  },
                  "type_specific": {
                    "type": "object",
                    "description": "The values entered for the occurrence's own task type, one key per type. Refused on an occurrence that is already completed or marked not applicable. See [Template types](https://developers.apicbase.com/docs/compliance-task-reference-values#template-types).",
                    "properties": {
                      "temperatures": {
                        "type": "array",
                        "description": "The measured temperatures of a temperature_check occurrence. Merged per measurement.",
                        "items": {
                          "type": "object",
                          "required": [
                            "key",
                            "value"
                          ],
                          "properties": {
                            "key": {
                              "type": "string",
                              "example": "t1",
                              "description": "The key of the template temperature this measurement belongs to."
                            },
                            "value": {
                              "type": "number",
                              "nullable": true,
                              "example": -19.5,
                              "description": "The measured temperature, as a number — a numeric string is rejected. Null clears the measurement."
                            }
                          }
                        }
                      },
                      "checklist": {
                        "type": "array",
                        "description": "The labels of the checked items of a checklist_task occurrence. Replaced as a whole, not merged. A label the task does not define is rejected.",
                        "items": {
                          "type": "string",
                          "example": "Check the door seal"
                        }
                      }
                    }
                  },
                  "custom_fields": {
                    "type": "object",
                    "description": "The values of the library's task custom fields, keyed by field slug. 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.",
                    "additionalProperties": true,
                    "example": {
                      "responsible_shift": "Morning",
                      "thermometer_id": "TH-12"
                    }
                  }
                }
              },
              "examples": {
                "Request Example": {
                  "value": {
                    "remarks": "Cooler was 1 degree over, door left open.",
                    "done_by": "100000000000045",
                    "type_specific": {
                      "temperatures": [
                        {
                          "key": "t1",
                          "value": -19.5
                        },
                        {
                          "key": "t2",
                          "value": 4.5
                        }
                      ]
                    },
                    "custom_fields": {
                      "responsible_shift": "Morning"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "occurrence_id": "AgBa8xB6_FkAWvMQerlFC0nP",
                      "begin": "2026-06-24T08:00:00",
                      "template": {
                        "id": "100000000000010",
                        "name": "Fridge temperature control",
                        "type": "temperature_check",
                        "assignee": null,
                        "type_specific": {
                          "ccp": {
                            "id": "100000000000001",
                            "name": "Fridge #1",
                            "code": "CCP-01"
                          },
                          "temperatures": [
                            {
                              "key": "t1",
                              "title": "Freezer",
                              "min_temperature": -22,
                              "max_temperature": -18
                            },
                            {
                              "key": "t2",
                              "title": "Cooler",
                              "min_temperature": 2,
                              "max_temperature": 7
                            }
                          ]
                        },
                        "description": "Morning check",
                        "prevent_early_execution": true,
                        "active": true,
                        "recurrence": {
                          "frequency": "weekly",
                          "start_date": "2026-06-01",
                          "end_date": null,
                          "start_time": "08:00",
                          "interval": 1,
                          "weekdays": [
                            "Monday",
                            "Wednesday",
                            "Friday"
                          ],
                          "day_of_month": null,
                          "month_of_year": null
                        },
                        "attachments": [
                          {
                            "id": "100000000000061",
                            "file": {
                              "url": "https://storage.apicbase.com/task_files/instruction.pdf",
                              "name": "instruction.pdf"
                            }
                          }
                        ],
                        "created": "2026-06-01T08:00:00Z",
                        "modified": "2026-06-15T12:30:00Z"
                      },
                      "awaiting_update": false,
                      "mitigation_policy": 2,
                      "completion": {
                        "result": "ok",
                        "submitted_at": "2026-06-24T08:15:00Z",
                        "done_by": {
                          "id": "100000000000045",
                          "username": "chef@restaurant.com",
                          "first_name": "John",
                          "last_name": "Doe",
                          "url": "https://app.apicbase.com/api/v2/accounts/users/100000000000045/"
                        },
                        "submitted_by": {
                          "id": "100000000000045",
                          "username": "chef@restaurant.com",
                          "first_name": "John",
                          "last_name": "Doe",
                          "url": "https://app.apicbase.com/api/v2/accounts/users/100000000000045/"
                        },
                        "remarks": "All within range",
                        "has_attachments": true,
                        "mitigation_skipped": false,
                        "had_corrective_action": false
                      },
                      "attachments": [
                        {
                          "id": "100000000000077",
                          "file": {
                            "url": "https://storage.apicbase.com/task_files/photo.jpg",
                            "name": "photo.jpg"
                          }
                        }
                      ],
                      "type_specific": {
                        "temperatures": [
                          {
                            "key": "t1",
                            "title": "Freezer",
                            "value": -19.5
                          },
                          {
                            "key": "t2",
                            "title": "Cooler",
                            "value": 4.5
                          }
                        ]
                      },
                      "custom_fields": [
                        {
                          "slug": "responsible_shift",
                          "name": "Shift",
                          "required": true,
                          "value": "Morning"
                        },
                        {
                          "slug": "thermometer_id",
                          "name": "Thermometer",
                          "required": false,
                          "value": "TH-12"
                        }
                      ],
                      "history": [
                        {
                          "result": "nok",
                          "submitted_at": "2026-06-24T07:50:00Z",
                          "done_by": {
                            "id": "100000000000045",
                            "username": "chef@restaurant.com",
                            "first_name": "John",
                            "last_name": "Doe",
                            "url": "https://app.apicbase.com/api/v2/accounts/users/100000000000045/"
                          },
                          "remarks": "Freezer above range, called maintenance",
                          "mitigation_skipped": false,
                          "type_specific": {
                            "temperatures": [
                              {
                                "key": "t1",
                                "title": "Freezer",
                                "value": -12.4
                              },
                              {
                                "key": "t2",
                                "title": "Cooler",
                                "value": 4.5
                              }
                            ]
                          }
                        }
                      ]
                    }
                  },
                  "Checklist task": {
                    "value": {
                      "occurrence_id": "AgBa8xC1_FkAWvMQerlFC0nR",
                      "begin": "2026-06-24T22:00:00",
                      "template": {
                        "id": "100000000000011",
                        "name": "Closing checklist",
                        "type": "checklist_task",
                        "assignee": {
                          "id": "100000000000045",
                          "username": "chef@restaurant.com",
                          "first_name": "John",
                          "last_name": "Doe",
                          "url": "https://app.apicbase.com/api/v2/accounts/users/100000000000045/"
                        },
                        "type_specific": {
                          "ccp": {
                            "id": "100000000000002",
                            "name": "Kitchen close",
                            "code": "CCP-07"
                          },
                          "checklist": [
                            "Check the door seal",
                            "Wipe down the shelves",
                            "Empty the waste bins"
                          ]
                        },
                        "description": "Run through every item before locking up",
                        "prevent_early_execution": false,
                        "active": true,
                        "recurrence": {
                          "frequency": "daily",
                          "start_date": "2026-06-01",
                          "end_date": "2026-12-31",
                          "start_time": "22:00",
                          "interval": 1,
                          "weekdays": null,
                          "day_of_month": null,
                          "month_of_year": null
                        },
                        "attachments": [],
                        "created": "2026-06-02T09:10:00Z",
                        "modified": "2026-06-02T09:10:00Z"
                      },
                      "awaiting_update": false,
                      "mitigation_policy": 2,
                      "completion": {
                        "result": "nok",
                        "submitted_at": "2026-06-24T22:20:00Z",
                        "done_by": {
                          "id": "100000000000045",
                          "username": "chef@restaurant.com",
                          "first_name": "John",
                          "last_name": "Doe",
                          "url": "https://app.apicbase.com/api/v2/accounts/users/100000000000045/"
                        },
                        "submitted_by": {
                          "id": "100000000000045",
                          "username": "chef@restaurant.com",
                          "first_name": "John",
                          "last_name": "Doe",
                          "url": "https://app.apicbase.com/api/v2/accounts/users/100000000000045/"
                        },
                        "remarks": "Waste bins left for the morning shift",
                        "has_attachments": false,
                        "mitigation_skipped": false,
                        "had_corrective_action": false
                      },
                      "attachments": [],
                      "type_specific": {
                        "checklist": [
                          "Check the door seal",
                          "Wipe down the shelves"
                        ]
                      },
                      "custom_fields": [],
                      "history": []
                    }
                  },
                  "General task": {
                    "value": {
                      "occurrence_id": "AgBa8xC2_FkAWvMQerlFC0nS",
                      "begin": "2026-07-01T09:00:00",
                      "template": {
                        "id": "100000000000012",
                        "name": "Monthly team briefing",
                        "type": "general_task",
                        "assignee": null,
                        "type_specific": {},
                        "description": "",
                        "prevent_early_execution": false,
                        "active": false,
                        "recurrence": {
                          "frequency": "monthly",
                          "start_date": "2026-01-01",
                          "end_date": null,
                          "start_time": "09:00",
                          "interval": 1,
                          "weekdays": null,
                          "day_of_month": 1,
                          "month_of_year": null
                        },
                        "attachments": [],
                        "created": "2026-01-05T11:00:00Z",
                        "modified": "2026-05-20T15:45:00Z"
                      },
                      "awaiting_update": false,
                      "mitigation_policy": null,
                      "completion": {
                        "result": null,
                        "submitted_at": null,
                        "done_by": null,
                        "submitted_by": null,
                        "remarks": "",
                        "has_attachments": false,
                        "mitigation_skipped": false,
                        "had_corrective_action": false
                      },
                      "attachments": [],
                      "type_specific": {},
                      "custom_fields": [],
                      "history": []
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "occurrence_id": {
                      "type": "string",
                      "example": "AgBa8xB6_FkAWvMQerlFC0nP",
                      "description": "The opaque token identifying this occurrence. Do not parse it."
                    },
                    "begin": {
                      "type": "string",
                      "example": "2026-06-24T08:00:00",
                      "description": "When the occurrence is scheduled, in `YYYY-MM-DDTHH:MM:SS` format. This is a wall-clock time in the outlet's own timezone and carries no offset: read it as-is, the way the user sees it in the app. Do not convert it."
                    },
                    "template": {
                      "type": "object",
                      "description": "The occurrence's task template, in the same shape as the template details endpoint but without the outlets list (an occurrence is bound to a single outlet).",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "100000000000010",
                          "description": "The ID of the task template."
                        },
                        "name": {
                          "type": "string",
                          "example": "Fridge temperature control",
                          "description": "The name of the task template."
                        },
                        "type": {
                          "type": "string",
                          "example": "temperature_check",
                          "description": "The template type slug. Determines the contents of type_specific. See [Template types](https://developers.apicbase.com/docs/compliance-task-reference-values#template-types). The set is open: new values may be added without it counting as a breaking change."
                        },
                        "assignee": {
                          "type": "object",
                          "nullable": true,
                          "description": "The user the task is assigned to.",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "100000000000045",
                              "description": "The ID of the user."
                            },
                            "username": {
                              "type": "string",
                              "example": "chef@restaurant.com",
                              "description": "The email address of the user."
                            },
                            "first_name": {
                              "type": "string",
                              "example": "John",
                              "description": "The first name of the user."
                            },
                            "last_name": {
                              "type": "string",
                              "example": "Doe",
                              "description": "The last name of the user."
                            },
                            "url": {
                              "type": "string",
                              "example": "https://app.apicbase.com/api/v2/accounts/users/100000000000045/",
                              "description": "The URL of the user's detail endpoint."
                            }
                          }
                        },
                        "type_specific": {
                          "type": "object",
                          "description": "Type-dependent template definitions. The keys present depend on the template type. See [Template types](https://developers.apicbase.com/docs/compliance-task-reference-values#template-types).",
                          "properties": {
                            "ccp": {
                              "type": "object",
                              "description": "The linked critical control point. Present for every template type except `general_task`, `order` and `count`.",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "example": "100000000000001",
                                  "description": "The ID of the critical control point."
                                },
                                "name": {
                                  "type": "string",
                                  "example": "Fridge #1",
                                  "description": "The name of the critical control point (CCP)."
                                },
                                "code": {
                                  "type": "string",
                                  "example": "CCP-01",
                                  "description": "A short code identifying the CCP. Can be empty."
                                }
                              }
                            },
                            "temperatures": {
                              "type": "array",
                              "description": "Temperature check definitions. Present for temperature_check templates only.",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string",
                                    "example": "t1",
                                    "description": "The internal key used to match entered values against this definition."
                                  },
                                  "title": {
                                    "type": "string",
                                    "example": "Freezer",
                                    "description": "The label of the temperature measurement point."
                                  },
                                  "min_temperature": {
                                    "type": "number",
                                    "example": -22,
                                    "description": "The lowest allowed temperature for the measurement."
                                  },
                                  "max_temperature": {
                                    "type": "number",
                                    "example": -18,
                                    "description": "The highest allowed temperature for the measurement."
                                  }
                                }
                              }
                            },
                            "checklist": {
                              "type": "array",
                              "description": "The checklist item labels. Present for checklist_task templates only.",
                              "items": {
                                "type": "string",
                                "example": "Check the door seal"
                              }
                            }
                          }
                        },
                        "description": {
                          "type": "string",
                          "example": "Morning check",
                          "description": "The description of the task template. Can be empty."
                        },
                        "prevent_early_execution": {
                          "type": "boolean",
                          "example": true,
                          "description": "Whether the task cannot be completed before its scheduled day."
                        },
                        "active": {
                          "type": "boolean",
                          "example": true,
                          "description": "Whether the template's schedule is enabled."
                        },
                        "recurrence": {
                          "type": "object",
                          "description": "The template's schedule. All keys are always present; keys that do not apply to the frequency are null.",
                          "properties": {
                            "frequency": {
                              "type": "string",
                              "enum": [
                                "once",
                                "daily",
                                "weekly",
                                "monthly",
                                "yearly"
                              ],
                              "example": "weekly",
                              "description": "How often the task repeats. See [Recurrence](https://developers.apicbase.com/docs/compliance-task-reference-values#recurrence)."
                            },
                            "start_date": {
                              "type": "string",
                              "format": "date",
                              "example": "2026-06-01",
                              "description": "The first day of the schedule, in ISO 8601 `YYYY-MM-DD` format."
                            },
                            "end_date": {
                              "type": "string",
                              "format": "date",
                              "nullable": true,
                              "description": "The last day of the schedule, or null when it repeats indefinitely. Always null for frequency once."
                            },
                            "start_time": {
                              "type": "string",
                              "nullable": true,
                              "example": "08:00",
                              "description": "The time of day the task is due, in `HH:MM` format."
                            },
                            "interval": {
                              "type": "integer",
                              "nullable": true,
                              "example": 1,
                              "description": "The repeat interval, e.g. 2 with frequency weekly means every two weeks."
                            },
                            "weekdays": {
                              "type": "array",
                              "nullable": true,
                              "description": "The days of the week the task repeats on. Only set for frequency weekly, null otherwise.",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "Monday",
                                  "Tuesday",
                                  "Wednesday",
                                  "Thursday",
                                  "Friday",
                                  "Saturday",
                                  "Sunday"
                                ],
                                "example": "Monday"
                              }
                            },
                            "day_of_month": {
                              "type": "integer",
                              "nullable": true,
                              "description": "The day of the month the task repeats on. Only set for frequency monthly and yearly, null otherwise."
                            },
                            "month_of_year": {
                              "type": "integer",
                              "nullable": true,
                              "description": "The month the task repeats in (1-12). Only set for frequency yearly, null otherwise."
                            }
                          }
                        },
                        "attachments": {
                          "type": "array",
                          "description": "Instruction files attached to the template.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "example": "100000000000061",
                                "description": "The ID of the attachment."
                              },
                              "file": {
                                "type": "object",
                                "properties": {
                                  "url": {
                                    "type": "string",
                                    "example": "https://storage.apicbase.com/task_files/instruction.pdf",
                                    "description": "The download URL of the attachment file."
                                  },
                                  "name": {
                                    "type": "string",
                                    "example": "instruction.pdf",
                                    "description": "The file name of the attachment."
                                  }
                                },
                                "description": "The attached file, with its name and download URL."
                              }
                            }
                          }
                        },
                        "created": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true,
                          "example": "2026-06-01T08:00:00Z",
                          "description": "When the template was created."
                        },
                        "modified": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true,
                          "example": "2026-06-15T12:30:00Z",
                          "description": "When the template was last modified."
                        }
                      }
                    },
                    "awaiting_update": {
                      "type": "boolean",
                      "example": false,
                      "description": "True when the occurrence was completed with a NOK result, the CCP's mitigation policy requires a corrective action, and mitigation was not skipped."
                    },
                    "mitigation_policy": {
                      "type": "integer",
                      "enum": [
                        0,
                        1,
                        2
                      ],
                      "nullable": true,
                      "example": 2,
                      "description": "Whether a corrective action is asked for when this occurrence fails. Taken from the linked CCP, and frozen once the occurrence is completed, so it can differ from the CCP's current policy. Null for a task type that carries no CCP. See [Mitigation policy](https://developers.apicbase.com/docs/compliance-task-reference-values#mitigation-policy)."
                    },
                    "completion": {
                      "type": "object",
                      "description": "The completion state. Always an object: all fields are empty or null while nothing has been recorded, partially filled once values are saved, filled once the task is resolved.",
                      "properties": {
                        "result": {
                          "type": "string",
                          "nullable": true,
                          "enum": [
                            "ok",
                            "nok",
                            "not_applicable"
                          ],
                          "example": "ok",
                          "description": "The outcome of the task: `ok` or `nok` once it is completed, `not_applicable` once it is marked not applicable, or null while it is neither. See [Completion result](https://developers.apicbase.com/docs/compliance-task-reference-values#completion-result)."
                        },
                        "submitted_at": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true,
                          "example": "2026-06-24T08:15:00Z",
                          "description": "When the task was resolved — completed or marked not applicable — or null while it is neither."
                        },
                        "done_by": {
                          "type": "object",
                          "nullable": true,
                          "description": "The user recorded as the performer of the task.",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "100000000000045",
                              "description": "The ID of the user."
                            },
                            "username": {
                              "type": "string",
                              "example": "chef@restaurant.com",
                              "description": "The email address of the user."
                            },
                            "first_name": {
                              "type": "string",
                              "example": "John",
                              "description": "The first name of the user."
                            },
                            "last_name": {
                              "type": "string",
                              "example": "Doe",
                              "description": "The last name of the user."
                            },
                            "url": {
                              "type": "string",
                              "example": "https://app.apicbase.com/api/v2/accounts/users/100000000000045/",
                              "description": "The URL of the user's detail endpoint."
                            }
                          }
                        },
                        "submitted_by": {
                          "type": "object",
                          "nullable": true,
                          "description": "The logged-in user who submitted the completion. Can differ from done_by when the performer was picked from a list.",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "100000000000045",
                              "description": "The ID of the user."
                            },
                            "username": {
                              "type": "string",
                              "example": "chef@restaurant.com",
                              "description": "The email address of the user."
                            },
                            "first_name": {
                              "type": "string",
                              "example": "John",
                              "description": "The first name of the user."
                            },
                            "last_name": {
                              "type": "string",
                              "example": "Doe",
                              "description": "The last name of the user."
                            },
                            "url": {
                              "type": "string",
                              "example": "https://app.apicbase.com/api/v2/accounts/users/100000000000045/",
                              "description": "The URL of the user's detail endpoint."
                            }
                          }
                        },
                        "remarks": {
                          "type": "string",
                          "example": "All within range",
                          "description": "Remarks entered on completion. Empty string when none."
                        },
                        "has_attachments": {
                          "type": "boolean",
                          "example": true,
                          "description": "Whether the completion has attachments. The attachment list itself is in the top-level attachments field."
                        },
                        "mitigation_skipped": {
                          "type": "boolean",
                          "example": false,
                          "description": "Whether the user explicitly skipped the corrective action for a failed (`nok`) check. Only ever true when the occurrence's mitigation_policy is 1 (optional); any other policy refuses the skip. See [Mitigation policy](https://developers.apicbase.com/docs/compliance-task-reference-values#mitigation-policy)."
                        },
                        "had_corrective_action": {
                          "type": "boolean",
                          "example": false,
                          "description": "True when the task was completed with a NOK result and later corrected to OK."
                        }
                      }
                    },
                    "attachments": {
                      "type": "array",
                      "description": "Files attached to the task (photos, documents)",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "100000000000077",
                            "description": "The ID of the attachment."
                          },
                          "file": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "example": "https://storage.apicbase.com/task_files/photo.jpg",
                                "description": "The download URL of the attachment file."
                              },
                              "name": {
                                "type": "string",
                                "example": "photo.jpg",
                                "description": "The file name of the attachment."
                              }
                            },
                            "description": "The attached file, with its name and download URL."
                          }
                        }
                      }
                    },
                    "type_specific": {
                      "type": "object",
                      "description": "The values entered on completion, matching the template type. temperature_check: temperatures as {key, title, value}; checklist_task: the labels of the checked items; empty object for other types or while nothing was entered.",
                      "properties": {
                        "temperatures": {
                          "type": "array",
                          "description": "The entered temperature values. Present for temperature_check templates only.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string",
                                "example": "t1",
                                "description": "The key of the matching definition in template.type_specific.temperatures."
                              },
                              "title": {
                                "type": "string",
                                "example": "Freezer",
                                "description": "The label of the measured temperature point."
                              },
                              "value": {
                                "type": "number",
                                "nullable": true,
                                "example": -19.5,
                                "description": "The measured temperature, or null while it was not entered."
                              }
                            }
                          }
                        },
                        "checklist": {
                          "type": "array",
                          "description": "The labels of the checked items. Present for checklist_task templates only.",
                          "items": {
                            "type": "string",
                            "example": "Check the door seal"
                          }
                        }
                      }
                    },
                    "custom_fields": {
                      "type": "array",
                      "description": "The library's configurable task fields with the values entered for this occurrence.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slug": {
                            "type": "string",
                            "example": "responsible_shift",
                            "description": "The machine-readable key of the custom field."
                          },
                          "name": {
                            "type": "string",
                            "example": "Shift",
                            "description": "The display name of the custom field."
                          },
                          "required": {
                            "type": "boolean",
                            "example": true,
                            "description": "Whether the field has to be filled in to complete the occurrence."
                          },
                          "value": {
                            "type": "string",
                            "nullable": true,
                            "example": "Morning",
                            "description": "The entered value, or null when not filled in."
                          }
                        }
                      }
                    },
                    "history": {
                      "type": "array",
                      "description": "Previous versions of the completion, newest first, up to 50 entries. The current version is in completion. Empty when the occurrence was never re-submitted.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "result": {
                            "type": "string",
                            "nullable": true,
                            "enum": [
                              "ok",
                              "nok",
                              "not_applicable"
                            ],
                            "example": "nok",
                            "description": "The outcome of that version of the task, `ok`, `nok` or `not_applicable`, or null while it was neither completed nor marked not applicable."
                          },
                          "submitted_at": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true,
                            "example": "2026-06-24T07:50:00Z",
                            "description": "When that version was resolved, in ISO 8601 format, or null while it was neither completed nor marked not applicable."
                          },
                          "done_by": {
                            "type": "object",
                            "nullable": true,
                            "description": "The user recorded as the performer of this version.",
                            "properties": {
                              "id": {
                                "type": "string",
                                "example": "100000000000045",
                                "description": "The ID of the user."
                              },
                              "username": {
                                "type": "string",
                                "example": "chef@restaurant.com",
                                "description": "The email address of the user."
                              },
                              "first_name": {
                                "type": "string",
                                "example": "John",
                                "description": "The first name of the user."
                              },
                              "last_name": {
                                "type": "string",
                                "example": "Doe",
                                "description": "The last name of the user."
                              },
                              "url": {
                                "type": "string",
                                "example": "https://app.apicbase.com/api/v2/accounts/users/100000000000045/",
                                "description": "The URL of the user's detail endpoint."
                              }
                            }
                          },
                          "remarks": {
                            "type": "string",
                            "example": "Freezer above range, called maintenance",
                            "description": "Remarks recorded on that version. Can be empty."
                          },
                          "mitigation_skipped": {
                            "type": "boolean",
                            "example": false,
                            "description": "Whether the user explicitly skipped the corrective action for that version's failed (`nok`) check. Only ever true when the mitigation_policy in force for that version was 1 (optional)."
                          },
                          "type_specific": {
                            "type": "object",
                            "description": "The values entered in this version, in the same shape as the occurrence-level type_specific.",
                            "properties": {
                              "temperatures": {
                                "type": "array",
                                "description": "The temperature values entered in this version. Present for temperature_check templates only.",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "key": {
                                      "type": "string",
                                      "example": "t1",
                                      "description": "The key of the matching definition in template.type_specific.temperatures."
                                    },
                                    "title": {
                                      "type": "string",
                                      "example": "Freezer",
                                      "description": "The label of the measured temperature point."
                                    },
                                    "value": {
                                      "type": "number",
                                      "nullable": true,
                                      "example": -12.4,
                                      "description": "The measured temperature, or null while it was not entered."
                                    }
                                  }
                                }
                              },
                              "checklist": {
                                "type": "array",
                                "description": "The labels of the items checked in this version. Present for checklist_task templates only.",
                                "items": {
                                  "type": "string",
                                  "example": "Check the door seal"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request — the payload failed validation, or a save rule refused it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Two forms. A field the serializer rejects comes back keyed by field name, nested under `type_specific` where it applies. A rule the save service refuses comes back as a single `message` instead."
                },
                "examples": {
                  "done_by_unknown": {
                    "summary": "The performer is not a user of the library",
                    "value": {
                      "done_by": [
                        "Invalid id \"999999999999999\" - user does not exist."
                      ]
                    }
                  },
                  "temperature_not_a_number": {
                    "summary": "A measurement sent as something other than a number",
                    "value": {
                      "type_specific": {
                        "temperatures": [
                          {
                            "value": [
                              "A valid number is required."
                            ]
                          }
                        ]
                      }
                    }
                  },
                  "temperatures_not_a_list": {
                    "summary": "A key rejected as a whole, reported under non_field_errors",
                    "value": {
                      "type_specific": {
                        "temperatures": {
                          "non_field_errors": [
                            "Expected a list of items but got type \"str\"."
                          ]
                        }
                      }
                    }
                  },
                  "type_specific_on_a_resolved_occurrence": {
                    "summary": "The measurement of a completed or not-applicable occurrence edited here instead of through the complete endpoint",
                    "value": {
                      "message": "Editing the measurement of a resolved task is only allowed through the complete endpoint."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — the Tasks module is off, or the user lacks the permission needed.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "detail": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "examples": {
                  "module_disabled": {
                    "summary": "The Tasks module is not enabled for the library",
                    "value": {
                      "detail": "Your library does not have Compliance Tasks module active."
                    }
                  },
                  "no_permission": {
                    "summary": "The user lacks the permission this endpoint needs",
                    "value": {
                      "message": "You have no permission to perform that action. If you think you should be allowed please contact your library admin"
                    }
                  },
                  "completed_task_edit": {
                    "summary": "A resolved occurrence edited without the permission to edit completed tasks — the same message as any other missing permission",
                    "value": {
                      "message": "You have no permission to perform that action. If you think you should be allowed please contact your library admin"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Occurrence not found.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "not_found": {
                    "summary": "Unknown, malformed or out-of-reach occurrence token — a foreign occurrence is a 404 so its existence is not leaked",
                    "value": {
                      "message": "Occurrence not found."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict — another request is writing this day of the task.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string"
                    }
                  },
                  "description": "The save is refused rather than queued behind the other request, and nothing is written, so the same request can simply be sent again."
                },
                "examples": {
                  "day_locked": {
                    "summary": "Another request is saving the same day of the same task in the same outlet",
                    "value": {
                      "detail": "This task is currently being modified. Please try again."
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://app.apicbase.com/oauth/authorize/",
            "tokenUrl": "https://api.apicbase.com/oauth/token/",
            "refreshUrl": "https://api.apicbase.com/oauth/token/",
            "scopes": {
              "accounts": "Access to user, library, and outlet endpoints.",
              "library": "Access to library content (recipes, ingredients, menus, packages).",
              "inventory": "Access to inventory events and stock data.",
              "procurement": "Access to purchase orders, deliveries, and supplier ordering.",
              "sales": "Access to POS, sales, and sales analytics endpoints.",
              "media": "Access to media (images, files)."
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```