Skip to main content

Delete location in zone

MethodPath
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=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​

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​

StatusMeaning
401Bearer token is missing, invalid or expired.
403You 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.
404No zone with this zoneId, or no location with this locationId, exists.
409Another write holds a lock on this location or its devices. Retry the call.
422A path parameter is not a UUID, or devices are still assigned to the location (delete only).