> ## 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.

# Introduction to Templates

> Learn how to working with Corti templates for document generation

In the Corti API, Templates define the structure for documents that are generated by Corti AI models from various inputs, such as conversational transcripts, facts, or other medical documents.

Templates are available in different languages and can be specific to your organization. Each template includes sections that set the

* structure (e.g., SOAP Note template consists of the four sections Subjective, Objective, Assessment and Plan)
* a writing style
* and documentation format

This ensures consistency, clarity, and control in use of AI to support medical reporting.

## Key Features of Templates

|                                         |                                                                                                                                                                                                                      |
| :-------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **One Interaction, Multiple Documents** | Generate multiple types of documentation for a single interaction, e.g., SOAP note and Patient Summary.                                                                                                              |
| **Customizable Formats**                | Use templates tailored for various medical specialties, enabling the generation of various types of clinical notes, letters, discharge summaries, and your unique use case needs.                                    |
| **Flexible Workflows**                  | Use pre-defined templates or cater to more dynamic workflows by selecting the desired, relevant sections.                                                                                                            |
| **Template Management**                 | The API lets you retrieve and review a list of available pre-configured templates and the languages those are available in. Use the query filter for organization `?org` to only retrieve templates provided to you. |

## Retrieving Available Templates

To generate a document, you must use a valid `templateKey` and the template must be available in the desired `outputLanguage`.

To retrieve a list of available templates use the `GET /templates` request and use `?lang=` to filter for available languages. Without any language filtering, the default returned are templates in `en`.

<CodeGroup>
  ```ts title="JavaScript" theme={null}
  // Default templates (en)
  const templates = await client.templates.list();

  // Templates available for a specific org
  const orgTemplates = await client.templates.list({ org: "TestHealth" });

  // Templates available in a specific language
  const danishTemplates = await client.templates.list({ lang: "da" });
  ```

  ```csharp title="C# .NET" theme={null}
  // Default templates (en)
  var templates = await client.Templates.ListAsync(new TemplatesListRequest());

  // Templates available for a specific org
  var orgTemplates = await client.Templates.ListAsync(new TemplatesListRequest { Org = "TestHealth" });

  // Templates available in a specific language
  var danishTemplates = await client.Templates.ListAsync(new TemplatesListRequest { Lang = "da" });
  ```

  ```python title="Python" theme={null}
  import requests

  # Replace these with your values
  ENVIRONMENT = "<eu-or-us>"
  TENANT = "<your-tenant-name>"
  TOKEN = "<your-access-token>"

  url = f"https://api.{ENVIRONMENT}.corti.app/v2/templates/"
  headers = {
      "Authorization": f"Bearer {TOKEN}",
      "Tenant-Name": TENANT,
  }

  # Default templates (en)
  response = requests.get(url, headers=headers)
  response.raise_for_status()
  templates = response.json()["data"]

  # Templates available for a specific org
  response = requests.get(url, headers=headers, params={"org": "TestHealth"})
  response.raise_for_status()
  org_templates = response.json()["data"]

  # Templates available in a specific language
  response = requests.get(url, headers=headers, params={"lang": "da"})
  response.raise_for_status()
  danish_templates = response.json()["data"]
  ```

  ```bash title="cURL" theme={null}
  # Replace these with your values
  ENVIRONMENT="<eu-or-us>"
  TENANT="<your-tenant-name>"
  TOKEN="<your-access-token>"

  # Default templates (en)
  curl "https://api.${ENVIRONMENT}.corti.app/v2/templates/" \
    -H "Authorization: Bearer ${TOKEN}" \
    -H "Tenant-Name: ${TENANT}"

  # Templates available for a specific org
  curl "https://api.${ENVIRONMENT}.corti.app/v2/templates/?org=TestHealth" \
    -H "Authorization: Bearer ${TOKEN}" \
    -H "Tenant-Name: ${TENANT}"

  # Templates available in a specific language
  curl "https://api.${ENVIRONMENT}.corti.app/v2/templates/?lang=da" \
    -H "Authorization: Bearer ${TOKEN}" \
    -H "Tenant-Name: ${TENANT}"
  ```
</CodeGroup>

<br />

<Tip>See details for standard out-of-the-box templates [here](/textgen/templates-standard/)</Tip>
