# Delete location

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

`DELETE /v1/slim/location/{id}`

Deletes a location that has no devices attached.

**Auth:** Bearer token. The caller must be a Medplum project admin or super admin. The access policy must grant `Location:delete` and `Device:update` (an admin or super admin who holds no access policy skips the access-policy check).
**Scope:** The location must belong to the caller's project (from the token).

## Behaviour

- Detach every device first (`PUT /v1/slim/location/{id}` with `"deviceId": []`). A location with a device attached is refused.
- The Location resource is deleted.
- The write is atomic and takes a short write lock. A concurrent write to the same location gets a 409.
- A location-deleted entry is added to the change history. A failure to write that entry does not fail the request.
- The response has no body.

## Example

```bash
curl -X DELETE 'https://api.sandbox.ovok.com/v1/slim/location/c3499c27-2973-0a7f-807e-fb8676a92dcb' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'
```
