# Change history keys

Canonical page: https://docs.ovok.com/slim-apis/audit/change-history-keys

Use this catalogue to render [`details.key` and `details.values`](/slim-apis/audit/list-change-history). A key is stable; localize its sentence in your client. Values are strings, numbers or `null`. A `null` value means that side was unset. `genericMessage` carries plain text in `values.message`. If a key is unknown to your client, show a generic change row and keep the key and values available for diagnostics.

`actions` is derived from a key where a rule exists. It matches only rows recorded after the action filter shipped; older rows do not match. A dash means there is no action value.

## How a save becomes rows [#how-a-save-becomes-rows]

- A home-wide threshold save can write one row per current resident affected, with each row 1 ms apart. Discharged-recent residents are skipped. A bed-time window change is written only for residents whose out-of-bed setting is effectively on.
- A room zone change writes a `residentMovedToZone` and `residentRemovedFromZone` pair for each resident still in the room. Clearing the zone writes only the removed row.
- A compound assignment key is used only when every placeholder is present. Otherwise the changed device, room and zone are recorded in separate rows.
- A save that changes nothing writes no change-history row.
- When an assignment and its removal share the same time, the assigned row sorts above the unassigned row (newest first).

## Threshold [#threshold]

| Key | When it is written | Values | Action |
| --- | --- | --- | --- |
| `orgThresholdMetricUpdated`, `patientThresholdMetricUpdated` | A home or resident changes a metric's enabled state or band values. A switch-off writes its disabled row without a second value row. | `metric`, `metricCode`, `metricI18nKey`, `unit`; relevant `fromEnabled`/`toEnabled`, `fromAbsoluteMin`/`toAbsoluteMin`, `fromAbsoluteMax`/`toAbsoluteMax`, relative bounds, deviation percentages, and period fields. Unset bounds are `null`. | `thresholdChanged` |
| `orgBaselineMetricUpdated`, `patientBaselineMetricUpdated` | A home or resident changes a baseline metric. | Same band values as the metric update keys. | `thresholdChanged` |
| `orgTimeOutOfBedMetricUpdated`, `patientTimeOutOfBedMetricUpdated` | A home or resident changes an out-of-bed metric's band. | Same band values as the metric update keys; includes `fromDeviationPercent` and `toDeviationPercent` when changed. | `thresholdChanged` |
| `patientThresholdMetricSetToIndividual`, `patientThresholdMetricSetToGlobal`, `patientThresholdMetricSetToAutoBaseline`; `patientBaselineMetricSetToIndividual`, `patientBaselineMetricSetToGlobal`, `patientBaselineMetricSetToAutoBaseline`; `patientTimeOutOfBedMetricSetToIndividual`, `patientTimeOutOfBedMetricSetToGlobal`, `patientTimeOutOfBedMetricSetToAutoBaseline` | A resident changes whether a metric follows the home, uses individual settings, or uses an automatic baseline. | Metric identity plus the available absolute/relative bands, deviation percentages, enabled state and `unit`. A missing side is `null`. | `thresholdChanged` |
| `orgBaselineMetricEnabled`, `orgBaselineMetricDisabled`, `patientBaselineMetricEnabled`, `patientBaselineMetricDisabled`; `orgThresholdMetricEnabled`, `orgThresholdMetricDisabled`, `patientThresholdMetricEnabled`, `patientThresholdMetricDisabled`; `orgTimeOutOfBedMetricEnabled`, `orgTimeOutOfBedMetricDisabled`, `patientTimeOutOfBedMetricEnabled`, `patientTimeOutOfBedMetricDisabled` | A home or resident turns a metric on or off. | `metric`, `metricI18nKey`. | `thresholdChanged` |
| `orgTimeOutOfBedPeriodChanged`, `patientTimeOutOfBedPeriodChanged` | A home or resident changes the out-of-bed bed-time window. | `fromPeriodStart`, `toPeriodStart`, `fromPeriodEnd`, `toPeriodEnd`; `fromPeriodTimezone` and `toPeriodTimezone` when the time zone changed. | `thresholdChanged` |
| `orgTimeOutOfBedMetricSwitchedToBaseline`, `patientTimeOutOfBedMetricSwitchedToBaseline`; `orgTimeOutOfBedMetricSwitchedToAbsolute`, `patientTimeOutOfBedMetricSwitchedToAbsolute` | An out-of-bed metric changes between an absolute limit and a baseline-relative limit. | Metric identity, `unit`, and the new absolute limit or deviation percentage. | `thresholdChanged` |
| `orgThresholdRangeChanged` | A home changes the allowed range for a vital. | `metric`, `metricCode`, `metricI18nKey`, `unit`, `fromRangeMin`, `toRangeMin`, `fromRangeMax`, `toRangeMax`. | `thresholdChanged` |
| `patientSignalsThresholdSet` | A Signals threshold is created or changed through Ovok's Signals threshold route. An unchanged save writes no row. | `resident`, `metricCode`, `metricI18nKey`, `fromSource`, `fromLow`, `fromHigh`, `toLow`, `toHigh`, `reason`. | `thresholdChanged` |
| `patientSignalsThresholdRemoved` | A Signals threshold is removed through Ovok's Signals threshold route. | `resident`, `metricCode`, `metricI18nKey`, `fromLow`, `fromHigh`, `reason`. | `thresholdChanged` |
| `orgSignalsSettingsChanged` | One or more Signals project settings change. An unchanged save writes no row. | `reason` and one `<setting>From`/`<setting>To` pair for each changed setting. `episodicAlerts` and `synchronousMode` are `on` or `off`; `throttleLimit` is a number or `null`. | `thresholdChanged` |
| `patientOutOfBedThresholdInitialized` | A resident is created while an enabled home out-of-bed limit applies. | `metric`, `metricI18nKey`, `max`, `unit`, `periodStart`, `periodEnd`. | `thresholdChanged` |

## Location [#location]

| Key | When it is written | Values | Action |
| --- | --- | --- | --- |
| `locationCreated`, `locationDeleted` | A room is created or deleted. | `location` | `created`, `deleted` |
| `locationRenamed` | A room is renamed. | `from`, `to` | `renamed` |
| `locationFloorChanged`, `locationRoomChanged`, `locationBedChanged` | A room's floor, room label or bed label changes. | `location`, `from`, `to` | `moved` |
| `locationZoneChanged` | A room moves to, from or between zones. | `location`, `fromZone`, `toZone`; an unset side is `null`. | `moved` |
| `residentMovedToLocation`, `residentRemovedFromLocation` | A resident is assigned to or removed from a room. | `resident`, `locationId` | `moved`, `unassigned` |
| `residentRemovedFromLocationAndZone` | A resident is removed from a room and zone together when no device is part of the change. | `resident`, `locationId`, and `zoneId` when present. | `unassigned` |
| `deviceLocationChanged` | A device is put in, moved between or removed from rooms. | `device`, `fromLocation`, `toLocation`; an unset side is `null`. | `moved` |

## Zone [#zone]

| Key | When it is written | Values | Action |
| --- | --- | --- | --- |
| `zoneCreated`, `zoneDeleted` | A zone is created or deleted. | `zone` | `created`, `deleted` |
| `zoneRenamed` | A zone is renamed. | `from`, `to` | `renamed` |
| `residentMovedToZone`, `residentRemovedFromZone` | A resident is assigned to or removed from a zone, including a room's zone change. | `resident`, `zoneId` | `moved`, `unassigned` |
| `deviceZoneChanged` | A device's effective zone changes. The effective zone comes from its room when it has one, otherwise its owner. | `device`, `fromZone`, `toZone`; an unset side is `null`. | `moved` |
| `locationZoneChanged` | A room's zone changes. | `location`, `fromZone`, `toZone`; an unset side is `null`. | `moved` |

## Device [#device]

| Key | When it is written | Values | Action |
| --- | --- | --- | --- |
| `deviceCreated`, `deviceDeleted` | A device is created or deleted. | `device` | `created`, `deleted` |
| `deviceRenamed` | A device is renamed. | `from`, `to` | `renamed` |
| `deviceProjectChanged` | A device moves between projects; each project gets its own row. | `device`, `fromProject`, `toProject` | `moved` |
| `residentAssignedToDeviceAndLocation` | A resident is assigned to a device and room in one save. The key may also include the zone. | `resident`, `deviceId`, `locationId`, optional `zoneId` | `assigned` |
| `residentDeviceAssigned`, `residentDeviceUnassigned` | A device is assigned to or removed from a resident without a complete compound assignment. | `resident`, `deviceId` | `assigned`, `unassigned` |
| `residentUnassignedFromDevicesAndLocation`, `residentUnassignedFromDevicesAndLocationWithZone` | One or more devices and a room are removed from a resident together; the second key also includes the zone. | `resident`, `deviceId`, `locationId`, optional `zoneId` | `unassigned` |
| `residentUnassignedFromDeviceAndLocation` | Legacy row for removing multiple devices without a room or zone change. | `resident`, `deviceId` | `unassigned` |
| `deviceLocationChanged`, `deviceZoneChanged` | A device changes room or effective zone. | See the Location and Zone tables. | `moved` |

## Resident [#resident]

| Key | When it is written | Values | Action |
| --- | --- | --- | --- |
| `residentDeleted` | A resident is deleted. | `resident` | `deleted` |
| `residentNameChanged`, `residentFirstNameChanged`, `residentLastNameChanged`, `residentMaidenNameChanged` | A resident's display, first, last or maiden name changes. | `from`, `to`; `resident` is included on the maiden-name key. A maiden name may be `null`. | `renamed` |
| `residentBirthDateChanged`, `residentGenderChanged` | A resident's birth date or gender changes. | `from`, `to` | — |
| `residentDischarged` | A resident is discharged. | `resident`, `date` | `discharged` |
| `residentReactivated` | A discharged resident is reactivated. | `resident` | `reactivated` |
| `residentDischargeDateChanged` | A resident's discharge date changes. | `from`, `to` | — |
| `residentAssignedToDeviceAndLocation`, `residentMovedToLocation`, `residentMovedToZone`, `residentUnassignedFromDevicesAndLocation`, `residentRemovedFromLocation`, `residentRemovedFromZone` | A resident's device, room or zone assignment changes. | See the Device, Location and Zone tables. | `assigned`, `moved` or `unassigned` |

## Access [#access]

| Key | When it is written | Values | Action |
| --- | --- | --- | --- |
| `userInvited` | A user is invited to the project with a role. | `user`, `role` | `created` |
| `userRenamed` | A user is renamed. | `from`, `to` | `renamed` |
| `userRemoved` | A user is removed from the project. | `user` | `deleted` |
| `roleCreated`, `roleDeleted` | An access role is created or deleted. | `role` | `created`, `deleted` |
| `rolePermissionsChanged` | A role's permissions change. Identical permissions write no row. | `role`, `from`, `to` | — |
| `userRoleChanged` | A user's assigned roles change. Identical roles write no row. | `user`, `fromRole`, `toRole`; either role value may be `null`. | — |
