HIP EHRbase openEHR REST API

EHRbase's implementation of the official openEHR REST API (ITS-REST) — EHR, EHR_STATUS, COMPOSITION, DIRECTORY, CONTRIBUTION, versioned objects, ADL 1.4 / ADL 2 template definitions and Archetype Query Language (AQL) execution, plus the EHRbase status heartbeat. 31 paths / 45 operations.

Operations 45

GET /rest/openehr/v1/ehr/{ehr_id} Get EHR by id #
PUT /rest/openehr/v1/ehr/{ehr_id} Create EHR with id #
GET /rest/openehr/v1/ehr/{ehr_id}/ehr_status Get EHR_STATUS version by time #
PUT /rest/openehr/v1/ehr/{ehr_id}/ehr_status Update EHR_STATUS #
GET /rest/openehr/v1/ehr/{ehr_id}/directory Get folder in directory version at time #
PUT /rest/openehr/v1/ehr/{ehr_id}/directory Update directory #
POST /rest/openehr/v1/ehr/{ehr_id}/directory Create directory #
DELETE /rest/openehr/v1/ehr/{ehr_id}/directory Delete directory #
GET /rest/openehr/v1/ehr/{ehr_id}/composition/{versioned_object_uid} Get composition at time #
PUT /rest/openehr/v1/ehr/{ehr_id}/composition/{versioned_object_uid} Update composition #
GET /rest/openehr/v1/definition/query/{qualified_query_name}/{version} Get stored query and info/metadata #
PUT /rest/openehr/v1/definition/query/{qualified_query_name}/{version} Store a query #
GET /rest/openehr/v1/definition/query/{qualified_query_name} List stored queries #
PUT /rest/openehr/v1/definition/query/{qualified_query_name} Store a query #
GET /rest/openehr/v1/query/{qualified_query_name}/{version} Execute stored query #
POST /rest/openehr/v1/query/{qualified_query_name}/{version} Execute stored query #
GET /rest/openehr/v1/query/{qualified_query_name} Execute stored query #
POST /rest/openehr/v1/query/{qualified_query_name} Execute stored query #
GET /rest/openehr/v1/query/aql Execute ad-hoc (non-stored) AQL query #
POST /rest/openehr/v1/query/aql Execute ad-hoc (non-stored) AQL query #
GET /rest/openehr/v1/ehr Get EHR summary by subject id and namespace #
POST /rest/openehr/v1/ehr Create EHR #
POST /rest/openehr/v1/ehr/{ehr_id}/contribution Create contribution #
POST /rest/openehr/v1/ehr/{ehr_id}/composition Create composition #
GET /rest/openehr/v1/definition/template/adl2 List templates #
POST /rest/openehr/v1/definition/template/adl2 Upload a template #
GET /rest/openehr/v1/definition/template/adl1.4 List templates #
POST /rest/openehr/v1/definition/template/adl1.4 Upload a template #
GET /rest/openehr/v1/ehr/{ehr_id}/versioned_ehr_status Get versioned EHR_STATUS #
GET /rest/openehr/v1/ehr/{ehr_id}/versioned_ehr_status/version Get versioned EHR_STATUS version by time #
GET /rest/openehr/v1/ehr/{ehr_id}/versioned_ehr_status/version/{version_uid} Get versioned EHR_STATUS version by id #
GET /rest/openehr/v1/ehr/{ehr_id}/versioned_ehr_status/revision_history Get versioned EHR_STATUS revision history #
GET /rest/openehr/v1/ehr/{ehr_id}/versioned_composition/{versioned_object_uid} Get versioned composition #
GET /rest/openehr/v1/ehr/{ehr_id}/versioned_composition/{versioned_object_uid}/version Get versioned composition version at time #
GET /rest/openehr/v1/ehr/{ehr_id}/versioned_composition/{versioned_object_uid}/version/{version_uid} Get versioned composition version by id #
GET /rest/openehr/v1/ehr/{ehr_id}/versioned_composition/{versioned_object_uid}/revision_history Get versioned composition revision history #
GET /rest/openehr/v1/ehr/{ehr_id}/ehr_status/{version_uid} Get EHR_STATUS by version id #
GET /rest/openehr/v1/ehr/{ehr_id}/directory/{version_uid} Get folder in directory version #
GET /rest/openehr/v1/ehr/{ehr_id}/contribution/{contribution_uid} Get contribution by id #
GET /rest/openehr/v1/definition/template/adl2/{template_id}/{version_pattern} Get template #
GET /rest/openehr/v1/definition/template/adl1.4/{template_id} Get template #
GET /rest/openehr/v1/definition/template/adl1.4/{template_id}/webtemplate Deprecated since 2.2.0 and marked for removal #
GET /rest/openehr/v1/definition/template/adl1.4/{template_id}/example Get an example composition for the specified template #
GET /rest/openehr/v1/definition/query List stored queries #
DELETE /rest/openehr/v1/ehr/{ehr_id}/composition/{preceding_version_uid} Delete composition #

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/hip-ehrbase-openehr"
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

vitagroup-hip-ehrbase-openehr.json Raw ↑
{"openapi":"3.1.0","info":{"title":"EHRbase API","description":"EHRbase implements the [official openEHR REST API](https://specifications.openehr.org/releases/ITS-REST/latest/). Additionally, EHRbase provides a custom `status` heartbeat endpoint, an [Admin API](https://docs.ehrbase.org/docs/EHRbase/Explore/Admin-REST) (if activated) and a [Status and Metrics API](https://docs.ehrbase.org/docs/EHRbase/Explore/Status-And-Metrics) (if activated) for monitoring and maintenance.  Note: The openEHR REST API is documented in their official documentation, not here. Please refer to their separate documentation.","license":{"name":"Apache 2.0","url":"https://github.com/ehrbase/ehrbase/blob/develop/LICENSE.md"},"version":"v1"},"externalDocs":{"description":"EHRbase Documentation","url":"https://docs.ehrbase.org/"},"servers":[{"url":"http://localhost:8080/ehrbase","description":"Generated server url"}],"paths":{"/rest/openehr/v1/ehr/{ehr_id}":{"get":{"tags":["EHR"],"summary":"Get EHR by id","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#tag/EHR/operation/ehr_get_by_id"},"operationId":"getEhrById","parameters":[{"name":"ehr_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK, is returned when the requested EHR resource is successfully retrieved.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EHR"}},"example":{"archetype_node_id":"openEHR-EHR-EHR_STATUS.generic.v1","name":{"value":"EHR status"},"uid":{"_type":"OBJECT_VERSION_ID","value":"9e3eb79b-1caa-4ab9-8cd4-d374b7c42bb4::local.ehrbase.org::1"},"subject":{"_type":"PARTY_SELF"},"is_queryable":true,"is_modifiable":true}}}},"404":{"description":"Not Found, is returned when an EHR with <code>ehr_id</code>  does not exist."}}},"put":{"tags":["EHR"],"summary":"Create EHR with id","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/1.0.3/ehr.html#tag/EHR/operation/ehr_get_by_id"},"operationId":"createEhrWithId","parameters":[{"name":"openEHR-VERSION","in":"header","required":false,"schema":{"type":"string"}},{"name":"openEHR-AUDIT_DETAILS","in":"header","required":false,"schema":{"type":"string"}},{"name":"Prefer","in":"header","required":false,"schema":{"type":"string"}},{"name":"ehr_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EHR"}},"example":{"archetype_node_id":"openEHR-EHR-EHR_STATUS.generic.v1","name":{"value":"EHR status"},"uid":{"_type":"OBJECT_VERSION_ID","value":"9e3eb79b-1caa-4ab9-8cd4-d374b7c42bb4::local.ehrbase.org::1"},"subject":{"_type":"PARTY_SELF"},"is_queryable":true,"is_modifiable":true}}}},"responses":{"201":{"description":"Created, is returned when the EHR has been successfully created. The new EHR resource is returned in the body when the request's <code>Prefer</code> header value is <code>return=representation</code> , otherwise only headers are returned.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EHR"}},"example":{"archetype_node_id":"openEHR-EHR-EHR_STATUS.generic.v1","name":{"value":"EHR status"},"uid":{"_type":"OBJECT_VERSION_ID","value":"9e3eb79b-1caa-4ab9-8cd4-d374b7c42bb4::local.ehrbase.org::1"},"subject":{"_type":"PARTY_SELF"},"is_queryable":true,"is_modifiable":true}}}},"400":{"description":"Bad Request, is returned when the request URL or body (if provided) could not be parsed or has invalid content."},"409":{"description":"Conflict, Unable to create a new EHR due to a conflict with an already existing EHR with the same subject id, namespace pair, whenever EHR_STATUS is supplied."}}}},"/rest/openehr/v1/ehr/{ehr_id}/ehr_status":{"get":{"tags":["EHR_STATUS"],"summary":"Get EHR_STATUS version by time","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#ehr_status-ehr_status-get"},"operationId":"getEhrStatusVersionByTime","parameters":[{"name":"ehr_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"version_at_time","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK, is returned when the requested EHR_STATUS is successfully retrieved.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EHR_STATUS"}},"example":{"archetype_node_id":"openEHR-EHR-EHR_STATUS.generic.v1","name":{"value":"EHR status"},"uid":{"_type":"OBJECT_VERSION_ID","value":"9e3eb79b-1caa-4ab9-8cd4-d374b7c42bb4::local.ehrbase.org::1"},"subject":{"_type":"PARTY_SELF"},"is_queryable":true,"is_modifiable":true}}}},"400":{"description":"Bad Request, is returned when the request has invalid content such as an invalid <code>version_at_time</code> format."},"404":{"description":"Not Found, is returned when an EHR with <code>ehr_id</code> does not exist, or when a version of the resource identified by the request parameters (at specified <code>version_at_time</code>) does not exist."}}},"put":{"tags":["EHR_STATUS"],"summary":"Update EHR_STATUS","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#ehr_status-ehr_status-put"},"operationId":"updateEhrStatus","parameters":[{"name":"ehr_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string"}},{"name":"Prefer","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EHR_STATUS"}},"example":{"archetype_node_id":"openEHR-EHR-EHR_STATUS.generic.v1","name":{"value":"EHR status"},"uid":{"_type":"OBJECT_VERSION_ID","value":"9e3eb79b-1caa-4ab9-8cd4-d374b7c42bb4::local.ehrbase.org::1"},"subject":{"_type":"PARTY_SELF"},"is_queryable":true,"is_modifiable":true}}},"required":true},"responses":{"200":{"description":"OK, is returned when the EHR_STATUS is successfully updated, and the updated resource is returned in the body when <code>Prefer</code> header value is <code>return=representation</code>.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EHR_STATUS"}},"example":{"archetype_node_id":"openEHR-EHR-EHR_STATUS.generic.v1","name":{"value":"EHR status"},"uid":{"_type":"OBJECT_VERSION_ID","value":"9e3eb79b-1caa-4ab9-8cd4-d374b7c42bb4::local.ehrbase.org::1"},"subject":{"_type":"PARTY_SELF"},"is_queryable":true,"is_modifiable":true}}}},"204":{"description":"No Content, is returned when the <code>Prefer</code> header is missing or is set to <code>return=minimal</code>"},"400":{"description":"Bad Request, is returned when the request URL or body (if provided) could not be parsed or has invalid content."},"404":{"description":"Not Found, is returned when an EHR with <code>ehr_id</code> does not exist."},"412":{"description":"Precondition Failed, is returned when <code>If-Match</code> request header doesn't match the latest version on the service side. Returns also latest <code>version_uid</code> in the <code>Location</code> and <codeETag></code> headers."}}}},"/rest/openehr/v1/ehr/{ehr_id}/directory":{"get":{"tags":["DIRECTORY"],"summary":"Get folder in directory version at time","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#directory-directory-get-1"},"operationId":"getFolderInDirectoryVersionAtTime","parameters":[{"name":"ehr_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"version_at_time","in":"query","required":false,"schema":{"type":"string"}},{"name":"path","in":"query","required":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","default":"application/json"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}},"204":{"description":"No Content","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}}}},"put":{"tags":["DIRECTORY"],"summary":"Update directory","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#directory-directory-put"},"operationId":"updateDirectory","parameters":[{"name":"ehr_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"If-Match","in":"header","required":true,"schema":{"$ref":"#/components/schemas/ObjectVersionId"}},{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","default":"application/json"}},{"name":"Prefer","in":"header","required":false,"schema":{"type":"string","default":"return=minimal"}},{"name":"openEHR-VERSION","in":"header","required":false,"schema":{"type":"string"}},{"name":"openEHR-AUDIT_DETAILS","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Folder"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}},"204":{"description":"No Content","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}},"412":{"description":"Precondition Failed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}}}},"post":{"tags":["DIRECTORY"],"summary":"Create directory","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#directory-directory-post"},"operationId":"createDirectory","parameters":[{"name":"ehr_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"openEHR-VERSION","in":"header","required":false,"schema":{"type":"string"}},{"name":"openEHR-AUDIT_DETAILS","in":"header","required":false,"schema":{"type":"string"}},{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","default":"application/json"}},{"name":"Prefer","in":"header","required":false,"schema":{"type":"string","default":"return=minimal"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Folder"}}},"required":true},"responses":{"201":{"description":"Created","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}}}},"delete":{"tags":["DIRECTORY"],"summary":"Delete directory","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#directory-directory-delete"},"operationId":"deleteDirectory","parameters":[{"name":"ehr_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"openEHR-VERSION","in":"header","required":false,"schema":{"type":"string"}},{"name":"openEHR-AUDIT_DETAILS","in":"header","required":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","default":"application/json"}},{"name":"If-Match","in":"header","required":true,"schema":{"$ref":"#/components/schemas/ObjectVersionId"}}],"responses":{"204":{"description":"No Content","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}},"412":{"description":"Precondition Failed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DirectoryResponseData"}}}}}}},"/rest/openehr/v1/ehr/{ehr_id}/composition/{versioned_object_uid}":{"get":{"tags":["COMPOSITION"],"summary":"Get composition at time","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#composition-composition-get"},"operationId":"getComposition","parameters":[{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}},{"name":"ehr_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"versioned_object_uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","description":"Composition format","required":false,"schema":{"type":"string","enum":["JSON","XML","STRUCTURED","FLAT"]}},{"name":"version_at_time","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}},"application/xml":{"schema":{"type":"object"}},"application/openehr.wt.flat.schema+json":{"schema":{"type":"object"}},"application/openehr.wt.structured.schema+json":{"schema":{"type":"object"}}}}}},"put":{"tags":["COMPOSITION"],"summary":"Update composition","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#composition-composition-put"},"operationId":"updateComposition","parameters":[{"name":"openehrVersion","in":"query","required":true,"schema":{"type":"string"}},{"name":"openEHR-AUDIT_DETAILS","in":"header","required":false,"schema":{"type":"string"}},{"name":"Content-Type","in":"header","required":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}},{"name":"Prefer","in":"header","required":false,"schema":{"type":"string"}},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string"}},{"name":"ehr_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"versioned_object_uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"templateId","in":"query","required":false,"schema":{"type":"string"}},{"name":"format","in":"query","description":"Composition format","required":false,"schema":{"type":"string","enum":["JSON","XML","STRUCTURED","FLAT"]}}],"requestBody":{"content":{"application/json":{"schema":{"type":"string"}},"application/xml":{"schema":{"type":"string"}},"application/openehr.wt.flat.schema+json":{"schema":{"type":"string"}},"application/openehr.wt.structured.schema+json":{"schema":{"type":"string"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"string"}},"application/xml":{"schema":{"type":"string"}},"application/openehr.wt.flat.schema+json":{"schema":{"type":"string"}},"application/openehr.wt.structured.schema+json":{"schema":{"type":"string"}}}}}}},"/rest/openehr/v1/definition/query/{qualified_query_name}/{version}":{"get":{"tags":["STORED_QUERY"],"summary":"Get stored query and info/metadata","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/definitions.html#definitions-stored-query-get-1"},"operationId":"getStoredQueryVersion","parameters":[{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}},{"name":"qualified_query_name","in":"path","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryDefinitionResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/QueryDefinitionResponseData"}}}}}},"put":{"tags":["STORED_QUERY"],"summary":"Store a query","description":"Content type application/json is still supported but it's deprecated, please use text/plain instead.","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/definitions.html#definitions-stored-query-put"},"operationId":"putStoredQuery","parameters":[{"name":"Content-Type","in":"header","required":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}},{"name":"qualified_query_name","in":"path","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","required":false,"schema":{"type":"string","default":"AQL"}}],"requestBody":{"content":{"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryDefinitionResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/QueryDefinitionResponseData"}}}}}}},"/rest/openehr/v1/definition/query/{qualified_query_name}":{"get":{"tags":["STORED_QUERY"],"summary":"List stored queries","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/definitions.html#definitions-stored-query-get"},"operationId":"getStoredQueryList","parameters":[{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}},{"name":"qualified_query_name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryDefinitionListResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/QueryDefinitionListResponseData"}}}}}},"put":{"tags":["STORED_QUERY"],"summary":"Store a query","description":"Content type application/json is still supported but it's deprecated, please use text/plain instead.","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/definitions.html#definitions-stored-query-put"},"operationId":"putStoredQuery_1","parameters":[{"name":"Content-Type","in":"header","required":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}},{"name":"qualified_query_name","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","required":false,"schema":{"type":"string","default":"AQL"}}],"requestBody":{"content":{"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryDefinitionResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/QueryDefinitionResponseData"}}}}}}},"/rest/openehr/v1/query/{qualified_query_name}/{version}":{"get":{"tags":["QUERY"],"summary":"Execute stored query","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/query.html#query-execute-query-get-1"},"operationId":"executeStoredQuery","parameters":[{"name":"qualified_query_name","in":"path","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","required":true,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"fetch","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/QueryResponseData"}}}}}},"post":{"tags":["QUERY"],"summary":"Execute stored query","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/query.html#query-execute-query-post-1"},"operationId":"executeStoredQuery_1","parameters":[{"name":"qualified_query_name","in":"path","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}},{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object"}}},"application/xml":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/QueryResponseData"}}}}}}},"/rest/openehr/v1/query/{qualified_query_name}":{"get":{"tags":["QUERY"],"summary":"Execute stored query","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/query.html#query-execute-query-get-1"},"operationId":"executeStoredQuery_2","parameters":[{"name":"qualified_query_name","in":"path","required":true,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"fetch","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/QueryResponseData"}}}}}},"post":{"tags":["QUERY"],"summary":"Execute stored query","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/query.html#query-execute-query-post-1"},"operationId":"executeStoredQuery_3","parameters":[{"name":"qualified_query_name","in":"path","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}},{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object"}}},"application/xml":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/QueryResponseData"}}}}}}},"/rest/openehr/v1/query/aql":{"get":{"tags":["QUERY"],"summary":"Execute ad-hoc (non-stored) AQL query","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/query.html#query-execute-query-get"},"operationId":"executeAdHocQuery","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"fetch","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/QueryResponseData"}}}}}},"post":{"tags":["QUERY"],"summary":"Execute ad-hoc (non-stored) AQL query","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/query.html#query-execute-query-post"},"operationId":"executeAdHocQuery_1","parameters":[{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}},{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object"}}},"application/xml":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryResponseData"}},"application/xml":{"schema":{"$ref":"#/components/schemas/QueryResponseData"}}}}}}},"/rest/openehr/v1/ehr":{"get":{"tags":["EHR"],"summary":"Get EHR summary by subject id and namespace","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#tag/EHR/operation/ehr_get_by_subject"},"operationId":"getEhrBySubject","parameters":[{"name":"subject_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"subject_namespace","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK, is returned when the requested EHR resource is successfully retrieved.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EHR"}},"example":{"archetype_node_id":"openEHR-EHR-EHR_STATUS.generic.v1","name":{"value":"EHR status"},"uid":{"_type":"OBJECT_VERSION_ID","value":"9e3eb79b-1caa-4ab9-8cd4-d374b7c42bb4::local.ehrbase.org::1"},"subject":{"_type":"PARTY_SELF"},"is_queryable":true,"is_modifiable":true}}}},"404":{"description":"Not Found, is returned when an EHR with supplied subject parameters does not exist."}}},"post":{"tags":["EHR"],"summary":"Create EHR","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#tag/EHR/operation/ehr_create"},"operationId":"createEhr","parameters":[{"name":"openEHR-VERSION","in":"header","required":false,"schema":{"type":"string"}},{"name":"openEHR-AUDIT_DETAILS","in":"header","required":false,"schema":{"type":"string"}},{"name":"Prefer","in":"header","required":false,"schema":{"type":"string","default":"return=minimal"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EHR"}},"example":{"archetype_node_id":"openEHR-EHR-EHR_STATUS.generic.v1","name":{"value":"EHR status"},"uid":{"_type":"OBJECT_VERSION_ID","value":"9e3eb79b-1caa-4ab9-8cd4-d374b7c42bb4::local.ehrbase.org::1"},"subject":{"_type":"PARTY_SELF"},"is_queryable":true,"is_modifiable":true}}}},"responses":{"201":{"description":"Created, is returned when the EHR has been successfully created. The new EHR resource is returned in the body when the request's <code>Prefer</code>  header value is <code>return=representation</code> , otherwise only headers are returned.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EHR"}},"example":{"archetype_node_id":"openEHR-EHR-EHR_STATUS.generic.v1","name":{"value":"EHR status"},"uid":{"_type":"OBJECT_VERSION_ID","value":"9e3eb79b-1caa-4ab9-8cd4-d374b7c42bb4::local.ehrbase.org::1"},"subject":{"_type":"PARTY_SELF"},"is_queryable":true,"is_modifiable":true}}}},"400":{"description":"Bad Request, is returned when the request URL or body (if provided) could not be parsed or has invalid content."},"409":{"description":"Conflict, Unable to create a new EHR due to a conflict with an already existing EHR with the same subject id, namespace pair, whenever EHR_STATUS is supplied."}}}},"/rest/openehr/v1/ehr/{ehr_id}/contribution":{"post":{"tags":["CONTRIBUTION"],"summary":"Create contribution","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#contribution-contribution-post"},"operationId":"createContribution","parameters":[{"name":"openEHR-VERSION","in":"header","required":false,"schema":{"type":"string"}},{"name":"openEHR-AUDIT_DETAILS","in":"header","required":false,"schema":{"type":"string"}},{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}},{"name":"Prefer","in":"header","required":false,"schema":{"type":"string"}},{"name":"ehr_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/xml":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}}},"required":true},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}},"application/xml":{"schema":{"type":"object"}}}}}}},"/rest/openehr/v1/ehr/{ehr_id}/composition":{"post":{"tags":["COMPOSITION"],"summary":"Create composition","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#composition-composition-post"},"operationId":"createComposition","parameters":[{"name":"openEHR-VERSION","in":"header","required":false,"schema":{"type":"string"}},{"name":"openEHR-AUDIT_DETAILS","in":"header","required":false,"schema":{"type":"string"}},{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}},{"name":"Prefer","in":"header","required":false,"schema":{"type":"string"}},{"name":"ehr_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"templateId","in":"query","required":false,"schema":{"type":"string"}},{"name":"format","in":"query","description":"Composition format","required":false,"schema":{"type":"string","enum":["JSON","XML","STRUCTURED","FLAT"]}}],"requestBody":{"content":{"application/json":{"schema":{"type":"string"}},"application/xml":{"schema":{"type":"string"}},"application/openehr.wt.flat.schema+json":{"schema":{"type":"string"}},"application/openehr.wt.structured.schema+json":{"schema":{"type":"string"}}},"required":true},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"string"}},"application/xml":{"schema":{"type":"string"}},"application/openehr.wt.flat.schema+json":{"schema":{"type":"string"}},"application/openehr.wt.structured.schema+json":{"schema":{"type":"string"}}}}}}},"/rest/openehr/v1/definition/template/adl2":{"get":{"tags":["ADL 2 TEMPLATE"],"summary":"List templates","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/definition.html#tag/ADL2/operation/definition_template_adl2_get"},"operationId":"getTemplatesNew","parameters":[{"name":"openEHR-VERSION","in":"header","required":false,"schema":{"type":"string"}},{"name":"openEHR-AUDIT_DETAILS","in":"header","required":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateResponseData"}}}}}},"post":{"tags":["ADL 2 TEMPLATE"],"summary":"Upload a template","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/definition.html#tag/ADL2/operation/definition_template_adl2_upload"},"operationId":"createTemplateNew","parameters":[{"name":"openEHR-VERSION","in":"header","required":false,"schema":{"type":"string"}},{"name":"openEHR-AUDIT_DETAILS","in":"header","required":false,"schema":{"type":"string"}},{"name":"Content-Type","in":"header","required":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}},{"name":"Prefer","in":"header","required":false,"schema":{"type":"string"}},{"name":"version","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"text/plain":{"schema":{"type":"string"}}},"required":true},"responses":{"201":{"description":"Created","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/TemplateResponseData"}}}}}}},"/rest/openehr/v1/definition/template/adl1.4":{"get":{"tags":["ADL 1.4 TEMPLATE"],"summary":"List templates","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/definition.html#tag/ADL1.4/operation/definition_template_adl1.4_list"},"operationId":"getTemplatesClassic","parameters":[{"name":"openEHR-VERSION","in":"header","required":false,"schema":{"type":"string"}},{"name":"openEHR-AUDIT_DETAILS","in":"header","required":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateMetaDataDto"}}},"application/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateMetaDataDto"}}}}}}},"post":{"tags":["ADL 1.4 TEMPLATE"],"summary":"Upload a template","externalDocs":{"url":"https://specifications.openehr.org/releases/ITS-REST/latest/definition.html#tag/ADL1.4/operation/definition_template_adl1.4_upload"},"operationId":"createTemplateClassic","parameters":[{"name":"openEHR-VERSION","in":"header","required":false,"schema":{"type":"string"}},{"name":"openEHR-AUDIT_DETAILS","in":"header","required":false,"schema":{"type":"string"}},{"name":"Prefer","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/xml":{"schema":{"type":"string"}}},"required":true},"responses":{"201":{"description":"Created","content":{"

# --- truncated at 32 KB (65 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/vitagroup/refs/heads/main/openapi/vitagroup-hip-ehrbase-openehr.json