Delete location in zone
| Method | Path |
|---|---|
DELETE | /v1/slim/zones/:zoneId/locations/:locationId |
Authentication · Access policies
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 (admins and super admins skip 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/3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21/locations/3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21?dryRun=true' \
-H "Authorization: Bearer ${OVOK_TOKEN}"
Successful response
200 — Preview (dryRun=true): affected devices and residents. Confirm: 204 No Content.
Errors
| Status | Meaning |
|---|---|
401 | Bearer token is missing, invalid or expired. |
403 | You are not a practitioner, admin or System Owner, you lack Location:update or Device:update, your session has no project, the zone or the location is outside your project, or the location is not in this zone. |
404 | No zone with this zoneId, or no location with this locationId, exists. |
409 | Another write holds a lock on this location or its devices. Retry the call. |
422 | A path parameter is not a UUID, or devices are still assigned to the location (delete only). |