Delete location in zone
- Sandbox: available
- Staging: available
- Production: unknown
Deletes an empty location from a zone, or, with dryRun=true, previews which devices and residents are at it without changing anything.
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 Location:update and Device:update (an admin or super admin who holds no access policy skips this check).
Scope: The zone must belong to the caller's project (from the token), its parent project, or one of its sub-projects. The location must belong to the zone and to your project or a sub-project; a parent project's location is refused.
Behaviour
dryRun=truereturns200withaffected_devicesandaffected_residentsat the location, and awarningwhen either list is not empty. Nothing is written.- Without
dryRun(any other value counts as false), the location is deleted only when no device is assigned to it. The call answers204with no body. - Reassign the location's devices before deleting it; the delete never unassigns devices for you.
- A location-deleted entry is added to the change history. A failure to write that entry does not fail the request.
Example
curl -X DELETE 'https://api.sandbox.ovok.com/v1/slim/zones/c3499c27-2973-0a7f-807e-fb8676a92dcb/locations/87ea5dfc-8b8e-384d-8489-79496e706390?dryRun=true' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'bearerAuthorizationBearer <JWT>zoneId*stringuuidlocationId*stringuuiddryRun?stringtrue returns the preview without deleting. Any other value, or none, deletes the location.
Preview (dryRun=true): affected devices and residents. Confirm: 204 No Content.
application/json- response
Preview of location delete: warning message when devices/residents are affected, and lists of affected devices and residents.
warning?stringaffected_devices*array<>affected_residents*array<>curl -X DELETE 'https://api.sandbox.ovok.com/v1/slim/zones/497f6eca-6276-4993-bfeb-53cbbbba6f08/locations/497f6eca-6276-4993-bfeb-53cbbbba6f08'{ "warning": "string", "affected_devices": [ { "id": "string", "name": "string" } ], "affected_residents": [ { "id": "string", "name": "string" } ]}Create location in zone POST
Creates a location (a FHIR `Location`) inside a zone. The new location's managing organization is the zone. **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 `Location:create` and `Device:update` (an admin or super admin who holds no access policy skips this check). **Scope:** The location is created in the caller's project (from the token). A super-admin caller may pass `?projectId=<uuid>` to create it in that project instead; the project must exist. The zone must belong to the project in use, its parent project, or one of its sub-projects. ## Behaviour - `name` is required and must be unique among the locations your token can search. - `floor`, `room` and `bed` are optional. When at least one is set, no other location in the zone may have the same floor, room and bed. A location with none of them is checked by name only. - The location is created with no devices or residents. Assign them with `PUT /v1/slim/zones/{zoneId}/locations/{locationId}`. - A location-created entry is added to the change history. A failure to write that entry does not fail the request. - The response is the new location, in the same shape as `GET /v1/slim/location/{id}`. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v1/slim/zones/c3499c27-2973-0a7f-807e-fb8676a92dcb/locations' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "name": "Room 101 Bed 1", "floor": "1", "room": "101", "bed": "1" }' ```
Update location in zone PUT
Updates a location in a zone: its name, floor, room and bed, the devices assigned to it, and the resident on those devices. **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 `Location:update` and `Device:update` (an admin or super admin who holds no access policy skips this check). **Scope:** The zone must belong to the caller's project (from the token), its parent project, or one of its sub-projects. The location must be in the caller's project, and its managing organization must be the zone. Devices and residents named in the body must be in your project or a sub-project. ## Behaviour - `name` is required and must be unique among the locations your token can search, not counting this one. - `floor`, `room` and `bed` replace only the values you send; omitted ones keep their stored value. The resulting floor, room and bed must not match another location in the zone. - `deviceId` (one UUID or a list) sets the devices at the location to exactly that set: devices not listed are removed from it, new ones are added. `null` removes every device. Omit `deviceId` to leave the devices unchanged. - `patientId` assigns that resident to the devices named in `deviceId`, or, without `deviceId`, to the location's single device. A resident assigned there before is unassigned from those devices. - **Omitting `patientId` unassigns the current resident from every device at the location** (and from the devices in `deviceId`). Send the current `patientId` to keep the resident. - A discharged resident cannot be assigned. - The write is atomic and takes a short write lock on the devices and locations it touches. - The response is the updated location, in the same shape as `GET /v1/slim/location/{id}`. ## Example ```bash curl -X PUT 'https://api.sandbox.ovok.com/v1/slim/zones/c3499c27-2973-0a7f-807e-fb8676a92dcb/locations/87ea5dfc-8b8e-384d-8489-79496e706390' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "name": "Room 101 Bed 1", "room": "101", "bed": "1", "deviceId": "c3499c27-2973-0a7f-807e-fb8676a92dcb", "patientId": "87ea5dfc-8b8e-384d-8489-79496e706390" }' ```