Organizations

Delete organization

Delete organization using Ovok’s Slim API.

MethodPath
DELETE/v1/slim/organization/:id

Authentication · Access policies

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 (admins and super admins skip this check). Scope: The organization must belong to the caller's project (from the token).

Request

Path parameters

NameTypeRequiredDescription
idstring (uuid)YesOrganization (zone) id.

Behaviour

  • The Organization resource is deleted.
  • Every room, device and resident in the zone is moved to its parent zone when there is one, or loses the zone when there is no parent. Residents removed from or moved between zones are recorded per resident, and devices in the zone's rooms get a device-zone history row.
  • 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. Each room and device that moved to the parent zone, or to no zone, also gets an entry. A failure to write an entry does not fail the request.
  • The response has no body.

Example

curl -X DELETE 'https://api.sandbox.ovok.com/v1/slim/organization/3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21' \
  -H "Authorization: Bearer ${OVOK_TOKEN}"

Successful response

200 — Organization deleted. The response has no body.

Errors

StatusMeaning
400The FHIR backend refuses the write.
401Bearer token is missing, invalid or expired.
403You are not a practitioner, admin or System Owner, you lack Organization:delete or Device:update, or the organization does not exist or is outside your project.
409A resource in the zone changed while the request ran. Retry.
422id is not a UUID.

Last updated on

On this page