Thresholds

Update patient threshold

Update patient threshold using Ovok’s Slim API.

MethodPath
PUT/v1/slim/threshold/patient/:patientId

Authentication · Access policies

Saves one resident's own thresholds.

Deprecated. Use PUT /v2/slim/threshold/patient/{patientId}. This v1 route stays available, unchanged, until every client has moved.

Auth: Bearer token. The caller must be a practitioner, an admin, a super admin, or hold the "System Owner" access policy. The access policy must grant Goal:update (admins and super admins skip this check). Scope: The resident must be in the caller's project (from the token) or one of its sub-projects.

Request

Path parameters

NameTypeRequiredDescription
patientIdstring (uuid)YesThe resident's Patient id. The path decides the resident.

Body

Keys not listed below are ignored. Every metric takes the same fields as settings.heartRate (mode, enabled, period, average, averageRange) plus its own band block. A metric you leave out takes its default (mode: "organization", disabled, zero bounds), which switches it off for this resident when the home has it on; send every metric you want to keep following the home.

NameTypeRequiredDescription
patientIdstringYesRequired but ignored; the path decides the resident.
status"active" | "revoked"YesRequired; the saved threshold is always active.
idstringNoIgnored.
projectIdstringNoIgnored. The caller's project is used.
datestring (ISO 8601 date-time)NoIgnored. The save time is used.
settingsobjectYesThe resident's limits per metric.
settings.heartRateobjectNoHeart-rate limit. Default: organization, disabled, absolute of 0 to 0.
settings.heartRate.mode"organization" | "patient"Yes, if the object is sentpatient stores your absolute / relative limits as the resident's own. organization follows the home. "patient-auto" answers 422.
settings.heartRate.enabledbooleanYes, if the object is sentWhether the metric alerts.
settings.heartRate.absoluteobjectNoThe fixed band.
settings.heartRate.absolute.enabledbooleanYes, if absolute is sentWhether the fixed band is armed.
settings.heartRate.absolute.minnumberYes, if absolute is sentLower bound in beats per minute. At least 0. Must not exceed max.
settings.heartRate.absolute.maxnumberYes, if absolute is sentUpper bound in beats per minute. At most 1000.
settings.heartRate.periodobjectNoBed-time window. Default { "start": "19:00:00", "end": "09:00:00" }. Only durationOfOutOfBed uses it.
settings.heartRate.averagenumberNoIgnored. Set by the server.
settings.heartRate.averageRangeobjectNoIgnored. Set by the server.
settings.respiratoryRateobjectNoRespiratory-rate limit. Same fields as settings.heartRate, in breaths per minute, except that absolute is required when the object is sent.
settings.meanHeartRateobjectNoBaseline (mean) heart-rate band. Default: organization, disabled.
settings.meanHeartRate.mode"organization" | "patient"Yes, if the object is sentAs for settings.heartRate.mode.
settings.meanHeartRate.enabledbooleanYes, if the object is sentWhether the metric alerts.
settings.meanHeartRate.relativeobjectYes, if the object is sentThe band as multipliers of the resident's baseline.
settings.meanHeartRate.relative.enabledbooleanYesWhether the relative band is armed. Arming one needs a baseline average on record (see 424).
settings.meanHeartRate.relative.minnumberYesLower multiplier. At least 0. Must not exceed max.
settings.meanHeartRate.relative.maxnumberYesUpper multiplier. At most 1000.
settings.meanRespiratoryRateobjectNoBaseline (mean) respiratory-rate band. Same fields as settings.meanHeartRate.
settings.durationOfOutOfBedobjectNoOut-of-bed limit. Default: organization, disabled, absolute of 0 seconds.
settings.durationOfOutOfBed.mode"organization" | "patient"Yes, if the object is sentAs for settings.heartRate.mode.
settings.durationOfOutOfBed.enabledbooleanYes, if the object is sentWhether the metric alerts.
settings.durationOfOutOfBed.absoluteobjectNoThe longest exit allowed.
settings.durationOfOutOfBed.absolute.enabledbooleanYes, if absolute is sentWhether the limit is armed.
settings.durationOfOutOfBed.absolute.maxnumberYes, if absolute is sentSeconds, at most 1000000. Rounded down to a multiple of 60.
settings.durationOfOutOfBed.relativeobjectNoA relative band: enabled (boolean) and max (number, at most 100).
settings.durationOfOutOfBed.periodobjectNoBed-time window. Default { "start": "19:00:00", "end": "09:00:00" }.
settings.durationOfOutOfBed.period.mode"organization" | "patient"Nopatient stores start and end as the resident's own window. Anything else uses the home's window.
settings.durationOfOutOfBed.period.startstring (HH:MM:SS)Yes, if period is sentWindow start.
settings.durationOfOutOfBed.period.endstring (HH:MM:SS) | nullNoWindow end. Equal to start means 24 hours; before start crosses midnight. A window of 23 hours 59 minutes or more counts as the whole day for out-of-bed baseline evaluation.
settings.durationOfOutOfBed.period.timezonestring | nullNoTime zone stored with the window.
settings.durationOfOutOfBed.period.durationSecondsnumberNoDeprecated. 0 to 86400. Used only to derive end when end is left out.
settings.sleepDurationobjectNoSleep-duration limit. Default: organization, disabled.
settings.sleepDuration.mode"organization" | "patient"Yes, if the object is sentAs for settings.heartRate.mode.
settings.sleepDuration.enabledbooleanYes, if the object is sentWhether the metric alerts.
settings.sleepDuration.absoluteobjectYes, if the object is sent{ enabled, min, max } in hours. min at least 0, max at most 1000, min not above max.
settings.numberOfTimesGettingOutOfBedobjectNoOut-of-bed count limit. Default: organization, disabled.
settings.numberOfTimesGettingOutOfBed.mode"organization" | "patient"Yes, if the object is sentAs for settings.heartRate.mode.
settings.numberOfTimesGettingOutOfBed.enabledbooleanYes, if the object is sentWhether the metric alerts.
settings.numberOfTimesGettingOutOfBed.absoluteobjectYes, if the object is sent{ enabled, max }. max at most 1000.

Behaviour

  • Each metric's mode decides what is stored:
    • patient: your absolute / relative limits.
    • organization: the home's limits. Sending enabled: false for a metric the home has enabled switches it to patient mode, disabled. Leaving the metric out does the same.
  • For a patient metric, enabled: false also stores its absolute and relative bands off (out of bed keeps its relative band), and a metric sent enabled: true with every band disabled is stored disabled.
  • patient-auto is no longer accepted: a body that uses it is refused with 422.
  • patientId in the body is required but ignored; the path decides the resident.
  • average and averageRange are set by the server; values you send are ignored.
  • Enabling a relative heart-rate or respiratory-rate band for a resident with no baseline average answers 424, because the band would have nothing to be relative to.
  • Every save writes the resident's settings to Signals before it answers. A successful response has signalsSync: { "status": "ok" } once Signals holds the settings. If Signals does not accept them, Ovok restores the previous state and returns 502 with saved: false; nothing is saved. Send the save again.
  • A second save for the same resident while one is running answers 409 with saved: false and changes nothing. Send it again after the first save finishes.
  • The v1 body cannot set the optional vitals (stored ones are kept) or a working relative out-of-bed band (v1 drops its min), so saving a patient out-of-bed limit here clears the resident's own band. PUT /v2/slim/threshold/patient/{patientId} sets both.
  • Each changed metric appears as a Threshold row in change history; an unchanged save writes no row. See the key catalogue.
  • The response is the saved threshold, as stored: unlike a read, it is not overlaid with what Signals holds.

Example

curl -X PUT 'https://api.sandbox.ovok.com/v1/slim/threshold/patient/3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21' \
  -H "Authorization: Bearer ${OVOK_TOKEN}" \
  -H 'Content-Type: application/json' \
  -d '{
    "patientId": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21",
    "status": "active",
    "settings": {
      "heartRate": { "mode": "patient", "enabled": true, "absolute": { "enabled": true, "min": 45, "max": 110 } },
      "meanHeartRate": { "mode": "organization", "enabled": false, "relative": { "enabled": false, "min": 0, "max": 0 } },
      "respiratoryRate": { "mode": "organization", "enabled": true, "absolute": { "enabled": true, "min": 0, "max": 0 } },
      "meanRespiratoryRate": { "mode": "organization", "enabled": false, "relative": { "enabled": false, "min": 0, "max": 0 } },
      "durationOfOutOfBed": { "mode": "organization", "enabled": true, "absolute": { "enabled": true, "max": 0 } },
      "sleepDuration": { "mode": "organization", "enabled": true, "absolute": { "enabled": true, "min": 0, "max": 0 } },
      "numberOfTimesGettingOutOfBed": { "mode": "organization", "enabled": true, "absolute": { "enabled": true, "max": 0 } }
    }
  }'

Only heartRate is the resident's own here. Every other metric follows the home, so the home's values replace the placeholder numbers.

Successful response

200 — Patient threshold updated successfully.

{
  "patientId": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21",
  "projectId": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b11",
  "status": "active",
  "date": "2026-10-09T09:20:05.000Z",
  "period": { "start": "2026-10-09T09:20:05.000Z" },
  "settings": {
    "heartRate": {
      "period": { "start": "19:00:00", "end": "09:00:00" },
      "mode": "patient",
      "enabled": true,
      "absolute": { "enabled": true, "min": 45, "max": 110 }
    },
    "meanHeartRate": {
      "period": { "start": "19:00:00", "end": "09:00:00" },
      "mode": "organization",
      "enabled": false,
      "relative": { "enabled": false, "min": 0, "max": 0 }
    },
    "respiratoryRate": {
      "period": { "start": "19:00:00", "end": "09:00:00" },
      "mode": "organization",
      "enabled": true,
      "absolute": { "enabled": true, "min": 8, "max": 25 }
    },
    "meanRespiratoryRate": {
      "period": { "start": "19:00:00", "end": "09:00:00" },
      "mode": "organization",
      "enabled": false,
      "relative": { "enabled": false, "min": 0, "max": 0 }
    },
    "durationOfOutOfBed": {
      "period": { "mode": "organization", "start": "19:00:00", "end": "09:00:00", "timezone": null },
      "mode": "organization",
      "enabled": true,
      "absolute": { "enabled": true, "max": 600 }
    },
    "sleepDuration": {
      "period": { "start": "19:00:00", "end": "09:00:00" },
      "mode": "organization",
      "enabled": true,
      "absolute": { "enabled": true, "min": 7, "max": 10 }
    },
    "numberOfTimesGettingOutOfBed": {
      "period": { "start": "19:00:00", "end": "09:00:00" },
      "mode": "organization",
      "enabled": true,
      "absolute": { "enabled": true, "max": 0 }
    }
  }
}
FieldTypeDescription
patientIdstringThe id from the path.
projectIdstringThe caller's project.
status"active"Always active.
datestring (ISO 8601 date-time)When this save was stored.
periodobjectThe save's own timestamp.
period.startstring (ISO 8601 date-time)The save time, the same as date.
settingsobjectThe resident's limits per metric, as stored by this save. Every metric the body carried (or defaulted) is present.
settings.heartRateobjectHeart-rate limit.
settings.heartRate.mode"organization" | "patient"patient for the resident's own limit; organization for one that follows the home.
settings.heartRate.enabledbooleanWhether the metric alerts.
settings.heartRate.absoluteobjectThe fixed band. For an organization metric, the home's band.
settings.heartRate.absolute.enabledbooleanWhether the fixed band is armed.
settings.heartRate.absolute.minnumberLower bound in beats per minute.
settings.heartRate.absolute.maxnumberUpper bound in beats per minute.
settings.heartRate.relativeobjectThe relative (baseline) band as multipliers: { enabled, min, max }. Only on metrics that carry one.
settings.heartRate.periodobjectThe bed-time window: start and end (string (HH:MM:SS)), plus mode and timezone on durationOfOutOfBed. Present on every metric; used only by durationOfOutOfBed.
settings.heartRate.averagenumberThe baseline average an armed relative band is anchored to. Omitted otherwise.
settings.heartRate.averageRangeobjectThe multipliers applied to average: { min, max }. Omitted without average.
settings.respiratoryRateobjectRespiratory-rate limit. Same fields as settings.heartRate.
settings.meanHeartRateobjectBaseline (mean) heart-rate band: the same fields, with relative instead of absolute.
settings.meanRespiratoryRateobjectBaseline (mean) respiratory-rate band. Same fields as settings.meanHeartRate.
settings.durationOfOutOfBedobjectOut-of-bed limit. The same fields, with absolute.max in seconds. period.mode says whether the window is the home's or the resident's own.
settings.sleepDurationobjectSleep-duration limit. The same fields, with absolute.min and absolute.max in hours.
settings.numberOfTimesGettingOutOfBedobjectOut-of-bed count limit. The same fields, with absolute.max a count.

Errors

StatusMeaning
400Your session has no project.
401Bearer token is missing, invalid or expired.
403You are not a practitioner, admin or System Owner, you lack Goal:update, or the patient is outside your project and its sub-projects or carries no project.
409Another save for this resident is running. The body has saved: false; nothing was changed. Send the save again after the first finishes.
422The body fails validation (including "patient-auto" as a mode).
424The body arms a baseline (relative) band for a metric with no stored average for this resident. The body names the metrics in missing.
500The save failed and restoring the previous limits failed too. The body has saved: false.
502The home's stored thresholds could not be read, or Signals did not accept the resident's settings. The body has saved: false; nothing was saved. Send the save again.
503The access policy could not be read right now. Retry.

Last updated on

On this page