The
/documents/templates endpoints — including template versions and publish — are available in beta. Feedback welcome at help@corti.ai or via your Corti contact.What is a template?
A template combines one or more published sections with a top-level instruction and exposes a single, versioned resource that can be referenced at generation time. Where a section is the building block, a template is the assembled note: e.g. a Post-Consultation Note template made up of Chief Complaint, History of Present Illness, Assessment, and Plan sections. A template has:- Metadata —
name,description,language,labels. Metadata is not passed to the LLM. instructions.prompt— a template-level prompt that applies to all sections during generation (e.g. setting overall tone, framing the encounter, or referencing the audience for the note).sections[]— references to existing sections bysectionId, plus anorderIndexcontrolling the order they appear in the generated document.
Prerequisites
You will need:- At least one published section. See Create a Section.
- The section’s
id(UUID). You can obtain this from the create response or by listing sections viaGET /documents/sections.
Only published sections can be referenced in a published template version. If you reference an unpublished section, the template version will fail to publish until that section is published.
Template lifecycle
Create the template
POST /documents/templates creates the template resource and its version 0. By default the new version is automatically published (publish: true).Iterate with new versions
POST /documents/templates/{templateID}/versions creates a new version with a fresh generation block. New versions are not automatically published.Publish a version
POST /documents/templates/{templateID}/versions/{versionID}/publish sets that version as the published version of the template.Create your first template
The template below references two sections you’ve already published.orderIndex starts at 0 and controls section order in the output.
GET /documents/templates/{templateID} the response is resolved — each referenced section is fully expanded with all inheritance applied, ready to be consumed as-is. The version reads (GET /documents/templates/{templateID}/versions/{versionID} and LIST /documents/templates/{templateID}/versions) return the raw template version — only the values the template itself owns, plus the section references. Use the version reads when you need to distinguish inherited fields from fields this template explicitly overrides.
Template response
How template instructions interact with section instructions
A template’sgeneration.instructions.prompt is applied at the top level, alongside each section’s own instructions. Use it for cross-section guidance that you don’t want to repeat in every section:
- Overall persona, audience or register (e.g. “Write for a referring specialist”).
- Encounter framing (e.g. “This is a follow-up visit, not a new consultation”).
- Patient or scenario context that all sections should respect.
Design tips
- Author once, reuse everywhere. A single well-tuned
corti-hpi-style section can power multiple templates. Avoid embedding section-specific guidance in templates. - Prefer narrow, focused sections. Sections that try to do too much are harder to reuse and harder to constrain via
outputSchema. - Use
labelsfor discovery. Labels are how you (and downstream consumers) filter sections and templates at list time. - Use inheritance for variants. Pediatric, geriatric or specialty-specific variants of a base template are a good fit for
inheritFromId.
Next steps
Inheritance
Create inheriting variants of this template to scale across customers, departments and specialties.
Versioning & publishing
Iterate by creating new versions and publishing them on your own cadence.
Manage & discover
Read resolved-vs-raw, update metadata, delete with inheritance guards, filter LIST results.
Create a Section
Author and version the building blocks you’ll compose into templates.