# Delete location in zone

Canonical page: https://docs.ovok.com/api/slim/zones/delete-location-in-zone

`DELETE /v1/slim/zones/{zoneId}/locations/{locationId}`

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'
```
