SlimSlim/Organization

Delete organization

  • Sandbox: available
  • Staging: available
  • Production: unknown
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

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

Authorization

bearer
headerAuthorizationBearer <JWT>

Path Parameters

id*string
Formatuuid

Response Body

Organization deleted. The response has no body.

Example Request
curl -X DELETE 'https://api.sandbox.ovok.com/v1/slim/organization/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
Empty

Get organization GET

Returns one organization (a zone in the Slim dashboard) by id. Use it to show or edit a zone. **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:read` (an admin or super admin who holds no access policy skips this check). **Scope:** The organization is read with the caller's own token, so you get any organization your Medplum access lets you read. There is no extra project check on this route. ## Behaviour - Read-only. - `description` is the organization's narrative text with the XHTML `<div>` wrapper removed. It is absent when the organization has no narrative. - `parentOrganizationId` is the id from `Organization.partOf`. It is absent for a top-level zone. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/slim/organization/c3499c27-2973-0a7f-807e-fb8676a92dcb' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ``` ```json { "id": "c3499c27-2973-0a7f-807e-fb8676a92dcb", "name": "Ward A", "parentOrganizationId": "87ea5dfc-8b8e-384d-8489-79496e706390", "description": "Ground floor" } ```

Update organization PUT

Updates an organization's (zone's) name, description and parent zone. **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: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). Organizations in a parent project or a sub-project are refused. ## Behaviour - `name` is required and must be unique among the organizations your token can search, not counting this one. - `parentOrganizationId` sets the parent zone. It must name an organization in your own project. **Omitting it removes the current parent**, which makes the zone top-level. - `description`, when non-empty, replaces the narrative text. Omitting it, or sending `null` or an empty string, leaves the existing description unchanged. - The write is atomic and takes a short write lock. A concurrent write to the same resources gets a 409. - A zone-updated entry is added to the change history. A failure to write that entry does not fail the request. - The response is the organization after the update, in the same shape as `GET /v1/slim/organization/{id}`. ## Example ```bash curl -X PUT 'https://api.sandbox.ovok.com/v1/slim/organization/c3499c27-2973-0a7f-807e-fb8676a92dcb' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "name": "Ward A", "parentOrganizationId": "87ea5dfc-8b8e-384d-8489-79496e706390", "description": "Ground floor" }' ```