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

# Path 1 — Plain `templateRef`

> Reference a stored, published template by UUID. The lightest path on POST /documents — no side-effects, no auto-generated aggregate, ideal for production traffic.

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

← Back to [Guided Synthesis overview](/textgen/documents-guided-synthesis)

Use this when a published template already encodes everything you need. The base template is **not** modified, and **no new template is persisted** as a side-effect of the call. This is the lightest path — ideal for production traffic.

<CodeGroup>
  ```ts title="JavaScript" expandable theme={null}
  // Replace these with your values
  const INTERACTION_ID = "<your-interaction-id>";
  const TEMPLATE_ID = "<your-template-id>";

  const result = await client.documents.generate({
    outputLanguage: "en-US",
    interactionId: INTERACTION_ID,
    templateRef: { templateId: TEMPLATE_ID },
  });
  ```

  ```csharp title="C# .NET" expandable theme={null}
  using Corti;

  // Replace these with your values
  const string InteractionId = "<your-interaction-id>";
  const string TemplateId = "<your-template-id>";

  var result = await client.Documents.GenerateAsync(
      new GuidedDocumentsGenerateByTemplateRef
      {
          OutputLanguage = "en-US",
          InteractionId = InteractionId,
          TemplateRef = new GuidedTemplateRef { TemplateId = TemplateId },
      });
  ```

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

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

  response = requests.post(
      f"https://api.{ENVIRONMENT}.corti.app/v2/documents",
      headers={
          "Authorization": f"Bearer {TOKEN}",
          "Tenant-Name": TENANT,
          "Content-Type": "application/json",
      },
      json={
          "outputLanguage": "en-US",
          "interactionId": INTERACTION_ID,
          "templateRef": {"templateId": TEMPLATE_ID},
      },
  )
  response.raise_for_status()
  result = response.json()
  ```

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

  curl --request POST \
    --url "https://api.${ENVIRONMENT}.corti.app/v2/documents" \
    --header "Authorization: Bearer ${TOKEN}" \
    --header "Tenant-Name: ${TENANT}" \
    --header "Content-Type: application/json" \
    --data "{
      \"outputLanguage\": \"en-US\",
      \"interactionId\": \"${INTERACTION_ID}\",
      \"templateRef\": { \"templateId\": \"${TEMPLATE_ID}\" }
    }"
  ```
</CodeGroup>

Pin a specific version when you need reproducibility against a known version (otherwise the template's currently published version is used):

```json theme={null}
"templateRef": {
  "templateId":        "<your-template-id>",
  "templateVersionId": "<your-version-id>"
}
```

## When to use this path

| Scenario                                                             | Why Path 1                                                                                                                         |
| :------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------- |
| Production ambient flow where every encounter uses the same template | Reproducible, fastest, no auto-generated aggregate to manage.                                                                      |
| You want full traceability via a known `templateVersionId`           | Pin the version explicitly — the response's `templateId` / `templateVersionId` match your request.                                 |
| You have no per-call tweaks today                                    | If a tweak becomes needed later, you can move to Path 2 (`templateRef` + overrides) without changing the rest of your integration. |

<Tip>If you're new to Guided Synthesis, this is the path to start with. Once it works end-to-end, layer in overrides ([Path 2](/textgen/documents-guided-synthesis/path-2-templateref-overrides)) or assembly ([Path 3](/textgen/documents-guided-synthesis/path-3-assembly)) as your use case grows.</Tip>

## Related

<Columns cols={2}>
  <Card title="Guided Synthesis overview" href="/textgen/documents-guided-synthesis" icon="wand-sparkles">
    Shared concepts: input context, response shape, errors, 30-day retention.
  </Card>

  <Card title="Path 2 — templateRef + overrides" href="/textgen/documents-guided-synthesis/path-2-templateref-overrides" icon="circle-2">
    Keep your base template, patch a section's title, instructions or schema for a single call.
  </Card>
</Columns>
