---
title: "Delete directory"
method: DELETE
path: "/ehr/{ehr_id}/directory"
tags: ["DIRECTORY"]
---

# Delete directory

`DELETE /ehr/{ehr_id}/directory`

Deletes directory FOLDER associated with the EHR identified by `ehr_id`.

The existing latest `version_uid` of directory FOLDER resource (i.e. the `preceding_version_uid`) must be specified in the `If-Match` header.

## Path parameters

- `ehr_id` string, uuid, required

## Headers

- `If-Match` string, required

## Response `204`

`204 No Content` is returned when the resource identified by the request parameters has been (logically) deleted.

## Other responses

- `400` — `400 Bad Request` is returned when the request could not be parsed or is invalid (e.g. malformed request URL syntax, missing required header or parameter, or syntactically invalid header, parameter or content). The response body MAY contain error details.
- `404` — `404 Not Found` is returned when an EHR with `ehr_id` does not exist.
- `412` — `412 Precondition Failed` is returned when `If-Match` request header doesn't match the latest version on the service side. Returns also latest `version_uid` in the `ETag` header.

---

[API](https://skmtc.net/openehr/apis/ehr-api.md) · [All operations](https://skmtc.net/openehr/apis/ehr-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openehr/ehr-api/versions/a0e37a217524/schema)
