# Delete organization

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

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

Deletes an organization (zone) and moves its residents, rooms and devices out of it.

**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:delete` and `Device:update` (an admin or super admin who holds no access policy skips this check).
**Scope:** The organization must belong to the caller's project (from the token).

## Behaviour

- The Organization resource is deleted.
- Every patient, location and device that references the zone is re-pointed:
  - If the zone has a parent zone in your project, they move to the parent zone.
  - Otherwise their zone reference is removed.
- Device use history is updated for any device whose assignment changes.
- The writes run in one bundle. Because a large zone can exceed the size limit of an atomic write, this route does not take the atomic write lock. A very large zone is written as a checked batch, so a partial failure is reported as an error rather than rolled back.
- A zone-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/organization/c3499c27-2973-0a7f-807e-fb8676a92dcb' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'
```
