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

# Choose a template

> Find the clinician's available templates and select the output you want to generate.

Templates define the structure of notes and documents. List the templates
available to the clinician with `scribe:read`.

## List available templates

| Method and path | Returns |
| - | - |
| `GET /templates` | Available templates across categories |
| `GET /templates/consult-note-templates` | Consultation-note templates |
| `GET /templates/document-templates` | Document templates, such as letters |
| `GET /templates/{template_id}` | One template, including its category, version, and structure |

```bash theme={null}
curl "$CORTEXA_API_BASE/templates/consult-note-templates?page=1&per_page=20" \
  --header "Authorization: Bearer $CORTEXA_JWT"
```

Example list response:

```json theme={null}
{
  "items": [{"id":"template_example","name":"Synthetic SOAP","description":"A template for a synthetic consultation."}],
  "page": 1,
  "per_page": 20,
  "total": 1,
  "has_next": false
}
```

Save your selected ID as `CORTEXA_TEMPLATE_ID`. Follow `has_next` for more pages.

## Inspect a template

```bash theme={null}
curl "$CORTEXA_API_BASE/templates/$CORTEXA_TEMPLATE_ID" \
  --header "Authorization: Bearer $CORTEXA_JWT"
```

The response contains `id`, `name`, `description`, `category`, `current_version`,
and `structure`. Template structure is an object; its contents depend on the
template. Do not assume all templates have identical fields.

## Use the selection

| Task | Where to pass the template |
| - | - |
| Generate consult notes | `template_ids` array on `POST /sessions/{session_id}/consult-note` |
| Associate templates when creating a session | `template_ids` array on `POST /sessions` |
| Create a document | `template_id` on `POST /sessions/{session_id}/documents` |
| Generate from a new custom prompt | [Custom template response](/developers/custom-templates.md) |

Choose a template from the clinician's available list.

## Custom templates and EHR fields

Use [custom prompts](/developers/custom-templates.md) to create a private template and generate
its first document. General template update/delete endpoints are not exposed by
this API.

Use [section mappings](/developers/sectional-notes.md#save-a-template-mapping) to save the EHR
field ID for each template heading. You can also override a field on one note.

Continue with [consult notes](/developers/notes.md) or [additional documents](/developers/documents.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.