# Update patient threshold (v2)

Canonical page: https://docs.ovok.com/api/slim/threshold/patient/v2/update-patient-threshold-v2

`PUT /v2/slim/threshold/patient/{patientId}`

Updates the patient threshold in the v2 contract. `mode` is required on
every settings field, and dictates which values the branch requires:

- `mode: 'organization'` — follow the org default; send no other
  values.
- `mode: 'patient'` (HR/RR/OOB) — individual absolute bounds. HR/RR:
  `enabled` + `min` + `max`. OOB: `enabled` + `maxDurationSeconds`,
  plus an optional `deviationPercent` (integer 5–300, or `null` to
  switch it off) that alerts sooner when an exit runs that far past the
  resident's usual one. It only ever brings the limit forward:
  `maxDurationSeconds` stays the limit when there is no baseline yet.
  Leaving `deviationPercent` out keeps what is stored.
- `mode: 'baseline'` (HR/RR only) — individual baseline-driven
  alerting. `enabled` + `deviationPercent`.
- `settings.bedTimePeriod`: `mode: 'organization'` (follow org window)
  or `mode: 'patient'` + `start` + `end`.

Semantics:

- Save = applied, all or nothing. Every save writes the resident's
  settings to Signals before it answers: `signalsSync: { status: 'ok' }`
  once Signals holds them, or 502 with `saved: false` and nothing
  changed (a 500 says putting the previous limits back failed too).
  Send the save again.
- A second save of the same resident while one is still running answers
  409 with `saved: false` and changes nothing. Send it again.
- `enabled: false` preserves stored values (bounds or
  deviationPercent) — Disable round-trips untouched.
- `timezone` never travels up on PUT bodies.
- `settings.oxygenSaturation`, `pulseRate`, `perfusionIndex`,
  `bodyTemperature` (each optional): `{ mode: 'organization' }` follows
  the home; `{ mode: 'patient', enabled, min, max }` is the resident's
  own limit, either bound `null` for a one-sided one. Leaving one out,
  or sending `null`, keeps what is stored. Following a home that does
  not watch the vital removes the resident's rule in Signals.
- A resident's own enabled limits, the four vitals' included, must sit
  inside the home's `ranges` (see GET). One outside answers 422
  naming the field, and nothing is saved. A limit sent back unchanged is
  not re-checked, so a home that narrows its range does not block a
  resident's other edits. Ranges are the home's: set them on
  `PUT /v2/slim/threshold`; a `ranges` key here is ignored.
