Skip to main content

Delete location

MethodPath
DELETE/v1/slim/location/:id

Authentication · Access policies

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 (admins and super admins skip the access-policy check, so in practice only the admin role matters). 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​

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

Successful response​

200 — Location deleted. The response has no body.

Errors​

StatusMeaning
400Medplum refuses the delete.
401Bearer token is missing, invalid or expired.
403You are not an admin or super admin, you lack Location:delete or Device:update, or the location does not exist or is outside your project.
409Another write holds the location. Retry.
422id is not a UUID, or devices are still at the location.