Update device
| Method | Path |
|---|---|
PUT | /v1/slim/device/:id |
Authentication · Access policies
Updates a device's name and identifier, and assigns or unassigns its zone, location and resident.
Auth: bearer token. The caller must be a practitioner, an admin or a System Owner, and needs Device:update.
Scope: the device must belong to the caller's project (from the token).
Behaviour
nameis required and replaces the device's user-friendly name.- For
organizationId,locationIdandpatientId: omit the field to leave it unchanged, sendnullto unassign, or send a UUID to assign. - Assigning a resident moves them: the resident is removed from every other device they hold. The resident who was on this device before loses it. Each resident who loses a device has their active out-of-bed episode closed in the same transaction.
- All changes are written in one transaction. If any part fails, nothing is written.
- Sending values the device already has is not an error, and writes nothing.
- Resident assignment changes, renames, identifier changes and zone changes are recorded in the change history.
- The response is the same as
GET /v1/slim/device/{id}after the update.
Example
curl -X PUT 'https://api.sandbox.ovok.com/v1/slim/device/3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21' \
-H "Authorization: Bearer ${OVOK_TOKEN}" \
-H 'Content-Type: application/json' \
-d '{"name": "Sleepiz/3001000", "patientId": null}'
Successful response
200 — The updated device.
Errors
| Status | Meaning |
|---|---|
401 | Bearer token is missing, invalid or expired. |
403 | You are not a practitioner, admin or System Owner, you lack Device:update, your session has no project, or the device is not in your project. |
404 | No device with this id exists. |
409 | You change patientId or locationId while your project is moving to another Signals tenant. Retry when the move is done. |
422 | The body fails validation, another device in your project has this name, or you assign a location to a discharged resident. |