# Update patient threshold

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

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

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` (an admin or super admin who holds no access policy skips 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.
- Every limit is evaluated by Signals, so every save writes the resident's settings to Signals before it answers, all or nothing: Signals holds the saved limits once it answers, or it answers 502 with `saved: false` and nothing is changed (a 500 says putting the previous limits back failed too). Send the save again.
- Change-history entries are written for each changed metric.
- The response is the saved threshold.

## Example

```bash
curl -X PUT 'https://api.sandbox.ovok.com/v1/slim/threshold/patient/c3499c27-2973-0a7f-807e-fb8676a92dcb' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \
  -H 'Content-Type: application/json' \
  -d '{
    "patientId": "c3499c27-2973-0a7f-807e-fb8676a92dcb",
    "status": "active",
    "settings": {
      "heartRate": { "mode": "patient", "enabled": true, "absolute": { "enabled": true, "min": 45, "max": 110 } }
    }
  }'
```
