Skip to main content

Update patient threshold

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.

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.
  • 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.
  • Heart-rate and respiratory-rate limits are evaluated by Signals. When the body states them, the route sends the resident's limits to Signals and waits for Signals to confirm. If Signals does not confirm, it answers 502 with signalsSync: { status: 'pending', reason }. The new limits are already stored by then; save again to retry. A body without medical limits is stored and sent to Signals in the background.
  • While a save of the home's limits (PUT /v2/slim/threshold or PUT /v1/slim/threshold) is running, this save answers 409 and nothing is changed: try again once it is done.
  • Change-history entries are written for each changed metric.
  • The response is the saved threshold.

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 } }
}
}'

Successful response​

200 — Patient threshold updated successfully.

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.
409A save of the home's limits is running. Nothing was changed; try again once it is done.
422The body fails validation.
424The body arms a baseline (relative) band for a metric with no stored average for this resident.
502The home's stored thresholds could not be read, or the body states a heart-rate or respiratory-rate band and Signals did not confirm it. The new band is stored; send the save again to retry.