Create location in zone
- Sandbox: available
- Staging: available
- Production: unknown
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
nameis required and must be unique among the locations your token can search.floor,roomandbedare 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
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" }'bearerAuthorizationBearer <JWT>zoneId*stringuuidapplication/json- body
name*string1 <= lengthfloor?stringroom?stringbed?stringLocation created in zone.
application/json- response
id*stringLocation id.
name*stringfloor?stringroom?stringbed?stringorganizationId?stringorganizationName?stringdeviceId?array<string>Every device at the location. Omitted when the location has none.
deviceName?stringAlphabetically first name among the devices at the location.
patientId?stringResident on the first device at the location that has one.
patientName?stringcurl -X POST 'https://api.sandbox.ovok.com/v1/slim/zones/497f6eca-6276-4993-bfeb-53cbbbba6f08/locations' \ -H 'Content-Type: application/json' \ -d '{ "name": "string"}'{ "id": "string", "name": "string", "floor": "string", "room": "string", "bed": "string", "organizationId": "string", "organizationName": "string", "deviceId": [ "string" ], "deviceName": "string", "patientId": "string", "patientName": "string"}Get zone detail GET
Returns one zone with all of its locations and the devices and residents assigned to each location. A zone is a FHIR `Organization`. Use it for a zone drill-down view. **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 `Organization:read` and `Location:read` (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. ## Behaviour - Returns every location whose managing organization is the zone; there is no paging. - Each location carries `floor`, `room` and `bed` when set, and its `devices` and `residents`. Devices and residents are sorted by name in natural order (so "Bed 2" sorts before "Bed 10"). - A location with no devices has empty `devices` and `residents` lists. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/slim/zones/c3499c27-2973-0a7f-807e-fb8676a92dcb' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```
Delete location in zone DELETE
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=true` returns `200` with `affected_devices` and `affected_residents` at the location, and a `warning` when 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 answers `204` with 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 ```bash 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' ```