> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corti.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Inheritance

> Create inheriting variants of clinical document sections and templates with the Corti API — scale across customers, departments and specialties by overriding only the fields you need while inheriting the rest from a parent resource

<Badge className="accent-badge" shape="rounded">Beta</Badge>

Inheritance is how you scale your library across customers, departments and specialties without duplicating prompts. A child section or template references a parent via `inheritFromId`; any field you omit in `generation` is inherited from the parent's **published** version at request time. Override only the fields that materially differ — the rest stay in sync with upstream improvements.

Both sections and templates support inheritance via the same `inheritFromId` mechanism. The override semantics differ slightly between resources — sections inherit instructions field-by-field, templates inherit `instructions.prompt` and the section composition.

<Tip>For the full decision matrix on **when** to inherit vs. author detached, plus the seven canonical override patterns, see the [Customization Cookbook](/textgen/customization-cookbook).</Tip>

***

## Inheriting from an existing section

Instead of writing a section from scratch, you can inherit from an existing one and override only the fields you need. The published version of the referenced section provides the defaults; any field you omit in `generation` is inherited.

```json title="Inherit & override" expandable theme={null}
{
  "name": "HPI (Pediatric)",
  "languages": ["en"],
  "inheritFromId": "<your-section-id>",
  "generation": {
    "instructions": {
      "writingStylePrompt": "Use family-centred language; refer to the patient as 'the child'."
    }
  }
}
```

<Note>Inheritance follows the **published** version of the referenced section at request time. If the upstream section is republished with improvements, your inherited section will pick them up for any field you have not overridden.</Note>

***

## Inheriting from an existing template

You can create a template that inherits from another template's published version. Fields you omit in `generation` are inherited; fields you provide override.

```json title="Inherit & override" expandable theme={null}
{
  "name": "Post-Consultation Note (Pediatrics)",
  "languages": ["en"],
  "inheritFromId": "<your-template-id>",
  "generation": {
    "instructions": {
      "prompt": "Produce a pediatric consultation note. Refer to the patient as 'the child'."
    }
  }
}
```

If you omit `sections` from `generation`, the inherited template's section composition is kept as-is. Provide a `sections` array if you want to replace the section composition entirely.

<Note>Inheritance resolves against the **published** version of the referenced template at request time. Future improvements to the upstream template propagate to fields you have not overridden.</Note>

***

## Inheriting from a Corti Standard — important caveats

<Warning>
  **Inheriting from a Corti Standard — silent updates.** Corti improves and refines its [Corti Standard](/textgen/corti-standards) sections and templates continuously. Updates are typically **silent** — small prompt refinements and quality fixes ship the same way many small API releases do, **without per-change notes**. Only clear schema-breaking changes or significant behavior changes are explicitly communicated.

  **Inheritance cannot pin you to a specific upstream version.** If your integration requires staying on a specific behavior, **do not use `inheritFromId` against a Corti Standard** — instead, **re-create** the resource as your own by copying its configuration into a `POST /documents/sections` (or `POST /documents/templates`) request *without* `inheritFromId`. The new resource is yours to version; subsequent Corti updates will not reach it.

  This caveat applies specifically to inheritance from Corti Standards. When inheriting from sections or templates you yourself authored, your project controls the publish cadence — there are no silent updates from Corti to worry about.
</Warning>
