# API for adding data to an EHR **Category:** [Technical (archive)](https://discourse.openehr.org/c/technical-archive/156) **Created:** 2019-09-27 11:52 UTC **Views:** 1 **Replies:** 4 **URL:** https://discourse.openehr.org/t/api-for-adding-data-to-an-ehr/14428 --- ## Post #1 by @system Hello, In which part of the openEHR API is the definition of how to add an instance of a template to an existing EHR ? Something like "add <serialized 'Health risk assessment'> to <id of EHR>" ? Greetings Georg --- ## Post #2 by @system Please have a look at [https://specifications.openehr.org/releases/ITS-REST/Release-1.0.0/ehr.html#composition](https://specifications.openehr.org/releases/ITS-REST/Release-1.0.0/ehr.html#composition) The instance of the template goes in the body. Different implementations have used different JSON formats for the payload. Ethercis supports both FLAT (originally from ThinkEHR) and it's own ECISFLAT formats. regards --- ## Post #3 by @system ah, cool, that was what I was looking for\. Thank you --- ## Post #4 by @system For the record: there is no concept of "instance of a template", there are instances of COMPOSITIONs that comply with a template. The information model class is COMPOSITION, the constraints to which instances of COMPOSITION should comply are defined in a template. --- ## Post #5 by @system That's worth saying Pablo. It is a common misunderstanding. Similarly there are no archetypes in openehr instance data. Only patterns of data that are valid against the archetype designs. For no technical people we have been describing templates as recipes, with archetypes as recipe components like a sauce which has its own recipe. Thankfully my food recipes do not validate my cooking. Ian --- **Canonical:** https://discourse.openehr.org/t/api-for-adding-data-to-an-ehr/14428 **Original content:** https://discourse.openehr.org/t/api-for-adding-data-to-an-ehr/14428