Cadasto EHR API

The openEHR ITS-REST EHR API as implemented and published by Cadasto: create and read EHRs, read and update EHR_STATUS, commit/retrieve/update/logically-delete versioned COMPOSITIONs, manage the DIRECTORY (folder) structure, create and read CONTRIBUTIONs for atomic multi-object commits, and read/write ITEM_TAGs. 33 operations. Updates use RFC 7232 If-Match optimistic concurrency; deletes are logical and preserve version history for audit.

Operations 33

POST /ehr Create EHR #
GET /ehr Get EHR by subject id #
PUT /ehr/{ehr_id} Create EHR with id #
GET /ehr/{ehr_id} Get EHR by id #
GET /ehr/{ehr_id}/ehr_status/{version_uid} Get EHR_STATUS by version id #
GET /ehr/{ehr_id}/ehr_status Get EHR_STATUS at time #
PUT /ehr/{ehr_id}/ehr_status Update EHR_STATUS #
GET /ehr/{ehr_id}/versioned_ehr_status Get versioned EHR_STATUS #
GET /ehr/{ehr_id}/versioned_ehr_status/revision_history Get versioned EHR_STATUS revision history #
GET /ehr/{ehr_id}/versioned_ehr_status/version Get versioned EHR_STATUS version at time #
GET /ehr/{ehr_id}/versioned_ehr_status/version/{version_uid} Get versioned EHR_STATUS version by id #
POST /ehr/{ehr_id}/composition Create COMPOSITION #
GET /ehr/{ehr_id}/composition/{uid_based_id} Get COMPOSITION #
PUT /ehr/{ehr_id}/composition/{uid_based_id} Update COMPOSITION #
DELETE /ehr/{ehr_id}/composition/{uid_based_id} Delete COMPOSITION #
GET /ehr/{ehr_id}/versioned_composition/{versioned_object_uid} Get versioned COMPOSITION #
GET /ehr/{ehr_id}/versioned_composition/{versioned_object_uid}/revision_history Get versioned COMPOSITION revision history #
GET /ehr/{ehr_id}/versioned_composition/{versioned_object_uid}/version Get versioned COMPOSITION version at time #
GET /ehr/{ehr_id}/versioned_composition/{versioned_object_uid}/version/{version_uid} Get versioned COMPOSITION version by id #
POST /ehr/{ehr_id}/directory Create directory #
PUT /ehr/{ehr_id}/directory Update directory #
DELETE /ehr/{ehr_id}/directory Delete directory #
GET /ehr/{ehr_id}/directory Get folder in directory version at time #
GET /ehr/{ehr_id}/directory/{version_uid} Get folder in directory version #
POST /ehr/{ehr_id}/contribution Create CONTRIBUTION #
GET /ehr/{ehr_id}/contribution/{contribution_uid} Get CONTRIBUTION by id #
GET /ehr/{ehr_id}/tags Get EHR tags #
GET /ehr/{ehr_id}/composition/{uid_based_id}/tags Get COMPOSITION tags #
PUT /ehr/{ehr_id}/composition/{uid_based_id}/tags Update COMPOSITION tags #
DELETE /ehr/{ehr_id}/composition/{uid_based_id}/tags/{key} Delete COMPOSITION tag by key #
GET /ehr/{ehr_id}/ehr_status/{uid_based_id}/tags Get EHR_STATUS tags #
PUT /ehr/{ehr_id}/ehr_status/{uid_based_id}/tags Update EHR_STATUS tags #
DELETE /ehr/{ehr_id}/ehr_status/{uid_based_id}/tags/{key} Delete EHR_STATUS tag by key #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/cadasto-ehr-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

cadasto-ehr-api-openapi.json Raw ↑
{
  "openapi": "3.1.1",
  "info": {
    "title": "EHR API",
    "version": "latest",
    "x-status": "STABLE",
    "x-spec": "ehr"
  },
  "servers": [
    {
      "url": "https://{baseUrl}/openehr/v1",
      "description": "An example openEHR server URL.",
      "variables": {
        "baseUrl": {
          "default": "cataniamc.prod.cadasto.com",
          "description": "The (example) server base URL prefix providing openEHR services. This may contain server name, port and base path prefix."
        }
      }
    }
  ],
  "security": [],
  "paths": {
    "/ehr": {
      "post": {
        "operationId": "ehr_create",
        "summary": "Create EHR",
        "description": "Create a new `EHR` with an auto-generated identifier.\n\nAn EHR_STATUS resource needs to be always created and committed in the new EHR.\nThis resource MAY be also supplied by the client as the request body.\nIf not supplied, a default EHR_STATUS will be used by the service with following attributes:\n  - `is_queryable`: true\n  - `is_modifiable`: true\n  - `subject`: a PARTY_SELF object\n\nAll other required EHR attributes and resources will be automatically created as needed by the [EHR creation semantics](https://specifications.openehr.org/releases/RM/latest/ehr.html#_ehr_creation_semantics).\n\nThe optional `cadasto-person-uid` request header links the new EHR to an existing\n[Demographic](/docs/guides/openehr#demographics) PERSON in the same contribution.\nSee the [Cadasto demographic link guide](/docs/guides/cadasto-demographic-link).\n",
        "tags": [
          "EHR"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Prefer"
          },
          {
            "$ref": "#/components/parameters/cadasto-person-uid"
          }
        ],
        "requestBody": {
          "description": "An EHR_STATUS resource MAY be also supplied by the client as the request body.\n",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EhrStatus"
              }
            }
          },
          "required": false
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/201_EHR"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "409": {
            "$ref": "#/components/responses/409_EHR"
          },
          "422": {
            "$ref": "#/components/responses/422_cadasto_person_uid_unknown"
          }
        }
      },
      "get": {
        "operationId": "ehr_get_by_subject",
        "summary": "Get EHR by subject id",
        "description": "Retrieve the EHR with the specified `subject_id` and `subject_namespace`.\n\nThese subject parameters will be matched against EHR's EHR_STATUS.subject.external_ref.id.value and \nEHR_STATUS.subject.external_ref.namespace values.\n",
        "tags": [
          "EHR"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/subject_id"
          },
          {
            "$ref": "#/components/parameters/subject_namespace"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_EHR"
          },
          "404": {
            "$ref": "#/components/responses/404_EHR_subject"
          }
        }
      }
    },
    "/ehr/{ehr_id}": {
      "put": {
        "operationId": "ehr_create_with_id",
        "summary": "Create EHR with id",
        "description": "Create a new EHR with the specified `ehr_id` identifier.\n\nThe value of the `ehr_id` unique identifier MUST be valid [HIER_OBJECT_ID](https://specifications.openehr.org/releases/BASE/latest/base_types.html#_hier_object_id_class) value.\nIt is strongly RECOMMENDED that an UUID always be used for this.\n\nAn EHR_STATUS resource needs to be always created and committed in the new EHR.\nThis resource MAY be also supplied by the client as the request body.\nIf not supplied, a default EHR_STATUS will be used by the service with following attributes:\n  - `is_queryable`: true\n  - `is_modifiable`: true\n  - `subject`: a PARTY_SELF object\n\nAll other required EHR attributes and resources will be automatically created as needed by the [EHR creation semantics](https://specifications.openehr.org/releases/RM/latest/ehr.html#_ehr_creation_semantics).\n\nThe optional `cadasto-person-uid` request header links the new EHR to an existing\n[Demographic](/docs/guides/openehr#demographics) PERSON in the same contribution.\nSee the [Cadasto demographic link guide](/docs/guides/cadasto-demographic-link).\n",
        "tags": [
          "EHR"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/Prefer"
          },
          {
            "$ref": "#/components/parameters/cadasto-person-uid"
          }
        ],
        "requestBody": {
          "description": "An EHR_STATUS resource MAY be also supplied by the client as the request body.\n",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EhrStatus"
              }
            }
          },
          "required": false
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/201_EHR"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "409": {
            "$ref": "#/components/responses/409_EHR_with_id"
          },
          "422": {
            "$ref": "#/components/responses/422_cadasto_person_uid_unknown"
          }
        }
      },
      "get": {
        "operationId": "ehr_get_by_id",
        "summary": "Get EHR by id",
        "description": "Retrieve the EHR with the specified `ehr_id`.\n\nSend the optional `include-cadasto-person-uid` request header to also receive the\nlinked PERSON UID in the `cadasto-person-uid` response header — see the\n[Cadasto demographic link guide](/docs/guides/cadasto-demographic-link).\n",
        "tags": [
          "EHR"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/include-cadasto-person-uid"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_EHR_get_by_id"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id"
          }
        }
      }
    },
    "/ehr/{ehr_id}/ehr_status/{version_uid}": {
      "get": {
        "operationId": "ehr_status_get_by_version_id",
        "summary": "Get EHR_STATUS by version id",
        "description": "Retrieves a particular version of the EHR_STATUS identified by `version_uid` and associated with the EHR identified by `ehr_id`.\n\nSend `Prefer: include_item_tags` to also receive the `openehr-item-tag` response header with the current tags.\n",
        "tags": [
          "EHR_STATUS"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/version_uid"
          },
          {
            "$ref": "#/components/parameters/Prefer"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_EHR_STATUS_retrieved"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id_or_version_uid"
          }
        }
      }
    },
    "/ehr/{ehr_id}/ehr_status": {
      "get": {
        "operationId": "ehr_status_get_at_time",
        "summary": "Get EHR_STATUS at time",
        "description": "Retrieves a version of the EHR_STATUS associated with the EHR identified by `ehr_id`.\n\nIf `version_at_time` is supplied, retrieves the version extant _at specified time_, otherwise retrieves the _latest_ EHR_STATUS version.\n\nSend `Prefer: include_item_tags` to also receive the `openehr-item-tag` response header with the current tags.\n",
        "tags": [
          "EHR_STATUS"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/version_at_time"
          },
          {
            "$ref": "#/components/parameters/Prefer"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_EHR_STATUS_retrieved"
          },
          "400": {
            "$ref": "#/components/responses/400_invalid_version_at_time"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id_or_no_version_at_time"
          }
        }
      },
      "put": {
        "operationId": "ehr_status_update",
        "summary": "Update EHR_STATUS",
        "description": "Updates EHR_STATUS associated with the EHR identified by `ehr_id`.\n\nThe existing latest `version_uid` of EHR_STATUS resource (i.e. the `preceding_version_uid`) must be specified in the `If-Match` header.\n\nThe response will contain the updated EHR_STATUS resource when the `Prefer` header has a value of `return=representation`.\n\nThe optional `openehr-item-tag` request header replaces all ITEM_TAG resources associated with the target in the same transaction as the update.\n\nThe optional `cadasto-person-uid` request header links the EHR to a PERSON in the\nsame contribution. The link is **append-only** here: an EHR that already has a\nlink cannot be re-linked via this header (`409 Conflict`). See the\n[Cadasto demographic link guide](/docs/guides/cadasto-demographic-link).\n",
        "tags": [
          "EHR_STATUS"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/If-Match"
          },
          {
            "$ref": "#/components/parameters/Prefer"
          },
          {
            "$ref": "#/components/parameters/openehr-item-tag"
          },
          {
            "$ref": "#/components/parameters/cadasto-person-uid"
          }
        ],
        "requestBody": {
          "description": "The new EHR_STATUS.\n",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EhrStatus"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_EHR_STATUS_updated"
          },
          "204": {
            "$ref": "#/components/responses/204_EHR_STATUS"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id"
          },
          "409": {
            "$ref": "#/components/responses/409_EHR_STATUS_cadasto_person_uid"
          },
          "412": {
            "$ref": "#/components/responses/412_EHR_STATUS"
          },
          "422": {
            "$ref": "#/components/responses/422_cadasto_person_uid_unknown"
          }
        }
      }
    },
    "/ehr/{ehr_id}/versioned_ehr_status": {
      "get": {
        "operationId": "versioned_ehr_status_get",
        "summary": "Get versioned EHR_STATUS",
        "description": "Retrieves a VERSIONED_EHR_STATUS associated with an EHR identified by `ehr_id`.\n",
        "tags": [
          "EHR_STATUS"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_VERSIONED_EHR_STATUS"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id"
          }
        }
      }
    },
    "/ehr/{ehr_id}/versioned_ehr_status/revision_history": {
      "get": {
        "operationId": "versioned_ehr_status_revision_history",
        "summary": "Get versioned EHR_STATUS revision history",
        "description": "Retrieves revision history of the VERSIONED_EHR_STATUS associated with the EHR identified by `ehr_id`.\n",
        "tags": [
          "EHR_STATUS"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_REVISION_HISTORY"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id"
          }
        }
      }
    },
    "/ehr/{ehr_id}/versioned_ehr_status/version": {
      "get": {
        "operationId": "versioned_ehr_status_version_get_at_time",
        "summary": "Get versioned EHR_STATUS version at time",
        "description": "Retrieves a VERSION from the VERSIONED_EHR_STATUS associated with the EHR identified by `ehr_id`.\n\nIf `version_at_time` is supplied, retrieves the VERSION extant _at specified time_, otherwise retrieves the _latest_ VERSION.\n\nSend `Prefer: include_item_tags` to also receive the `openehr-item-tag` response header with the current tags.\n",
        "tags": [
          "EHR_STATUS"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/version_at_time"
          },
          {
            "$ref": "#/components/parameters/Prefer"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_VERSION_at_time"
          },
          "400": {
            "$ref": "#/components/responses/400_invalid_version_at_time"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id_or_no_version_at_time"
          }
        }
      }
    },
    "/ehr/{ehr_id}/versioned_ehr_status/version/{version_uid}": {
      "get": {
        "operationId": "versioned_ehr_status_version_get_by_id",
        "summary": "Get versioned EHR_STATUS version by id",
        "description": "Retrieves a VERSION identified by `version_uid` of an EHR_STATUS associated with the EHR identified by `ehr_id`.\n\nSend `Prefer: include_item_tags` to also receive the `openehr-item-tag` response header with the current tags.\n",
        "tags": [
          "EHR_STATUS"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/version_uid"
          },
          {
            "$ref": "#/components/parameters/Prefer"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_VERSION"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id_or_version_uid"
          }
        }
      }
    },
    "/ehr/{ehr_id}/composition": {
      "post": {
        "operationId": "composition_create",
        "summary": "Create COMPOSITION",
        "description": "Creates the first version of a new COMPOSITION in the EHR identified by `ehr_id`.\n\nThe optional `openehr-item-tag` request header attaches ITEM_TAG resources to the new COMPOSITION in the same transaction as the create.\n",
        "tags": [
          "COMPOSITION"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/Prefer"
          },
          {
            "$ref": "#/components/parameters/openehr-item-tag"
          }
        ],
        "requestBody": {
          "description": "The COMPOSITION.\n",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Composition"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/201_COMPOSITION"
          },
          "400": {
            "$ref": "#/components/responses/400_COMPOSITION"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id"
          },
          "422": {
            "$ref": "#/components/responses/422_COMPOSITION"
          }
        }
      }
    },
    "/ehr/{ehr_id}/composition/{uid_based_id}": {
      "get": {
        "operationId": "composition_get",
        "summary": "Get COMPOSITION",
        "description": "Retrieves a version of the COMPOSITION identified by `uid_based_id` and associated with the EHR identified by `ehr_id`.\n\nThe `uid_based_id` can take a form of an OBJECT_VERSION_ID identifier taken from VERSION.uid.value (i.e. a `version_uid`), or a form of a HIER_OBJECT_ID identifier taken from VERSIONED_OBJECT.uid.value (i.e. a `versioned_object_uid`).\nThe former is used to retrieve a specific known version of the COMPOSITION (e.g. one identified by `8849182c-82ad-4088-a07f-48ead4180515::cataniamc.prod.cadasto.com::1`), whereas the later (e.g. an identifier like `8849182c-82ad-4088-a07f-48ead4180515`) is be used to retrieve a version from the version container whenever the _version_tree_id_ is unknown or irrelevant (such as when most recent version is requested).\n\nWhen the `uid_based_id` has the form of a HIER_OBJECT_ID, if the `version_at_time` is supplied, retrieves the version extant _at specified time_, otherwise retrieves the _latest_ COMPOSITION version.\n\nSee [Resource identification](overview.html#tag/Resources/Resource-identification) for more details about the identifiers usage and meaning.\n\nSend `Prefer: include_item_tags` to also receive the `openehr-item-tag` response header with the current tags.\n",
        "tags": [
          "COMPOSITION"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/uid_based_id"
          },
          {
            "$ref": "#/components/parameters/version_at_time"
          },
          {
            "$ref": "#/components/parameters/Prefer"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_COMPOSITION_retrieved"
          },
          "204": {
            "$ref": "#/components/responses/204_because_deleted_at_time"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id_or_no_version_at_time"
          }
        }
      },
      "put": {
        "operationId": "composition_update",
        "summary": "Update COMPOSITION",
        "description": "Updates COMPOSITION identified by `uid_based_id` and associated with the EHR identified by `ehr_id`.\n\nThe `uid_based_id` can take only a form of an HIER_OBJECT_ID identifier taken from VERSIONED_OBJECT.uid.value (i.e. a `versioned_object_uid`).\n\nIf the request body already contains a COMPOSITION.uid.value, it must match the `uid_based_id` in the URL.\n\nThe existing latest `version_uid` of COMPOSITION resource (i.e. the `preceding_version_uid`) must be specified in the `If-Match` header.\n\nThe optional `openehr-item-tag` request header replaces all ITEM_TAG resources associated with the target in the same transaction as the update.\n",
        "tags": [
          "COMPOSITION"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/uid_based_id_as_versioned_object_uid"
          },
          {
            "$ref": "#/components/parameters/If-Match"
          },
          {
            "$ref": "#/components/parameters/Prefer"
          },
          {
            "$ref": "#/components/parameters/openehr-item-tag"
          }
        ],
        "requestBody": {
          "description": "The new COMPOSITION.\n",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Composition"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_COMPOSITION_updated"
          },
          "400": {
            "$ref": "#/components/responses/400_COMPOSITION"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id_or_uid_based_id"
          },
          "412": {
            "$ref": "#/components/responses/412_COMPOSITION"
          },
          "422": {
            "$ref": "#/components/responses/422_COMPOSITION"
          }
        }
      },
      "delete": {
        "operationId": "composition_delete",
        "summary": "Delete COMPOSITION",
        "description": "Deletes the COMPOSITION identified by `uid_based_id` and associated with the EHR identified by `ehr_id`.\n\nThe `uid_based_id` MUST be in a form of an OBJECT_VERSION_ID identifier taken from the last (most recent) VERSION.uid.value, representing the `preceding_version_uid` to be deleted.\n",
        "tags": [
          "COMPOSITION"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/uid_based_id_as_version_uid"
          }
        ],
        "responses": {
          "204": {
            "$ref": "#/components/responses/204_COMPOSITION_deleted"
          },
          "400": {
            "$ref": "#/components/responses/400_already_deleted"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id_or_uid_based_id"
          },
          "409": {
            "$ref": "#/components/responses/409_COMPOSITION_with_uid_based_id"
          }
        }
      }
    },
    "/ehr/{ehr_id}/versioned_composition/{versioned_object_uid}": {
      "get": {
        "operationId": "versioned_composition_get",
        "summary": "Get versioned COMPOSITION",
        "description": "Retrieves a VERSIONED_COMPOSITION identified by `versioned_object_uid` and associated with the EHR identified by `ehr_id`.\n",
        "tags": [
          "COMPOSITION"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/versioned_object_uid_COMPOSITION"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_VERSIONED_COMPOSITION"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id_or_versioned_object_uid"
          }
        }
      }
    },
    "/ehr/{ehr_id}/versioned_composition/{versioned_object_uid}/revision_history": {
      "get": {
        "operationId": "versioned_composition_revision_history",
        "summary": "Get versioned COMPOSITION revision history",
        "description": "Retrieves revision history of the VERSIONED_COMPOSITION identified by `versioned_object_uid` and associated with the EHR identified by `ehr_id`.\n",
        "tags": [
          "COMPOSITION"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/versioned_object_uid_COMPOSITION"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_REVISION_HISTORY"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id_or_versioned_object_uid"
          }
        }
      }
    },
    "/ehr/{ehr_id}/versioned_composition/{versioned_object_uid}/version": {
      "get": {
        "operationId": "versioned_composition_version_get_at_time",
        "summary": "Get versioned COMPOSITION version at time",
        "description": "Retrieves a VERSION from the VERSIONED_COMPOSITION identified by `versioned_object_uid` and associated with the EHR identified by `ehr_id`.\n\nIf `version_at_time` is supplied, retrieves the VERSION extant _at specified time_, otherwise retrieves the _latest_ VERSION.\n\nSend `Prefer: include_item_tags` to also receive the `openehr-item-tag` response header with the current tags.\n",
        "tags": [
          "COMPOSITION"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/versioned_object_uid_COMPOSITION"
          },
          {
            "$ref": "#/components/parameters/version_at_time"
          },
          {
            "$ref": "#/components/parameters/Prefer"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_VERSION_of_COMPOSITION_at_time"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id_or_versioned_object_uid_or_no_version_at_time"
          }
        }
      }
    },
    "/ehr/{ehr_id}/versioned_composition/{versioned_object_uid}/version/{version_uid}": {
      "get": {
        "operationId": "versioned_composition_version_get_by_id",
        "summary": "Get versioned COMPOSITION version by id",
        "description": "Retrieves a VERSION identified by `version_uid` of a VERSIONED_COMPOSITION identified by `versioned_object_uid` and associated with the EHR identified by `ehr_id`.\n\nSend `Prefer: include_item_tags` to also receive the `openehr-item-tag` response header with the current tags.\n",
        "tags": [
          "COMPOSITION"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/versioned_object_uid_COMPOSITION"
          },
          {
            "$ref": "#/components/parameters/version_uid_COMPOSITION"
          },
          {
            "$ref": "#/components/parameters/Prefer"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_VERSION"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id_or_versioned_object_uid_or_version_uid"
          }
        }
      }
    },
    "/ehr/{ehr_id}/directory": {
      "post": {
        "operationId": "directory_create",
        "summary": "Create directory",
        "description": "This endpoint is defined but not implemented by the server.",
        "tags": [
          "DIRECTORY"
        ],
        "responses": {
          "501": {
            "description": "This endpoint is not implemented."
          }
        }
      },
      "put": {
        "operationId": "directory_update",
        "summary": "Update directory",
        "description": "Updates directory FOLDER associated with the EHR identified by `ehr_id`.\n\nThe existing latest `version_uid` of directory FOLDER resource (i.e. the `preceding_version_uid`) must be specified in the `If-Match` header.\n",
        "tags": [
          "DIRECTORY"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/If-Match"
          },
          {
            "$ref": "#/components/parameters/Prefer"
          }
        ],
        "requestBody": {
          "description": "The new directory.\n",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Folder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_directory_updated"
          },
          "204": {
            "$ref": "#/components/responses/204_directory_updated"
          },
          "400": {
            "$ref": "#/components/responses/400_FOLDER"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id"
          },
          "412": {
            "$ref": "#/components/responses/412_directory"
          }
        }
      },
      "delete": {
        "operationId": "directory_delete",
        "summary": "Delete directory",
        "description": "This endpoint is defined but not implemented by the server.",
        "tags": [
          "DIRECTORY"
        ],
        "responses": {
          "501": {
            "description": "This endpoint is not implemented."
          }
        }
      },
      "get": {
        "operationId": "directory_get_at_time",
        "summary": "Get folder in directory version at time",
        "description": "Retrieves the version of the directory FOLDER associated with the EHR identified by `ehr_id`. \nIf `version_at_time` is supplied, retrieves the version extant _at specified time_, otherwise retrieves the _latest_ directory FOLDER version. \n\nIf `path` is supplied, retrieves from the directory only the sub-FOLDER that is associated with that path.\n",
        "tags": [
          "DIRECTORY"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/version_at_time"
          },
          {
            "$ref": "#/components/parameters/path"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_FOLDER_retrieved"
          },
          "204": {
            "$ref": "#/components/responses/204_because_deleted_at_time"
          },
          "404": {
            "$ref": "#/components/responses/404_directory_unknown_ehr_id_or_no_version_at_time_or_no_path"
          }
        }
      }
    },
    "/ehr/{ehr_id}/directory/{version_uid}": {
      "get": {
        "operationId": "directory_get_by_version_id",
        "summary": "Get folder in directory version",
        "description": "Retrieves a particular version of the directory FOLDER identified by `version_uid` and associated with the EHR identified by `ehr_id`.\n\nIf `path` is supplied, retrieves from the directory only the sub-FOLDER that is associated with that path.\n",
        "tags": [
          "DIRECTORY"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/version_uid"
          },
          {
            "$ref": "#/components/parameters/path"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/200_FOLDER_retrieved"
          },
          "404": {
            "$ref": "#/components/responses/404_directory_unknown_ehr_id_or_no_version_uid_or_no_path"
          }
        }
      }
    },
    "/ehr/{ehr_id}/contribution": {
      "post": {
        "operationId": "contribution_create",
        "summary": "Create CONTRIBUTION",
        "description": "We will use the relaxed CONTRIBUTION with the following optional attributes:\n  - `uid`: when provided, it will be accepted in case is not in-use, otherwise error will be returned\n  - `audit.time_committed`: server will always set it\n  - `audit.system_id`: when provided, it will be validated\n",
        "tags": [
          "CONTRIBUTION"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/Prefer"
          }
        ],
        "requestBody": {
          "description": "The CONTRIBUTION.\n",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewContribution"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/201_CONTRIBUTION"
          },
          "400": {
            "$ref": "#/components/responses/400_CONTRIBUTION"
          },
          "404": {
            "$ref": "#/components/responses/404_unknown_ehr_id"
          },
          "409": {
            "$ref": "#/components/responses/409"
          }
        }
      }
    },
    "/ehr/{ehr_id}/contribution/{contribution_uid}": {
      "get": {
        "operationId": "contribution_get",
        "summary": "Get CONTRIBUTION by id",
        "description": "Retrieves a CONTRIBUTION identified by `contribution_uid` and associated with the EHR identified by `ehr_id`.\n",
        "tags": [
          "CONTRIBUTION"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ehr_id"
          },
          {
            "$ref": "#/components/parameters/c

# --- truncated at 32 KB (190 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/cadasto/refs/heads/main/openapi/cadasto-ehr-api-openapi.json