---
title: "Create a document from this template"
method: POST
path: "/api/v1/templates/{id}/create-document"
tags: ["Templates"]
---

# Create a document from this template

`POST /api/v1/templates/{id}/create-document`

## Request

- Base URL: `https://api.korala.ai`
- URL: `https://api.korala.ai/api/v1/templates/{id}/create-document`
- Auth: one of:
  - API key in header `X-API-Key`
  - `bearer` (a scheme the document does not define)

## Path parameters

- `id` string, required

## Request body

- CreateDocumentFromTemplateDto
  - `sandbox` boolean: Dashboard mode. API keys always use their authenticated mode.
  - `collectionIds` string[]: Explicit destination collections. Omission or [] leaves the resource unassigned.
  - `templateData` object: JSON input for Markdown/Liquid templates. Explicit input is required for generation; preview sample data is never used implicitly.
  - `name` string, required
  - `signers` object: Map of signer role ID to signer details (required if template has signer roles)
  - `variables` object: Variables to substitute in text fields (PDF) or DOCX body placeholders (DOCX)
  - `suppressNotifications` boolean: Suppress all email notifications for this document

## Response `201`

- DocumentDto
  - `collectionIds` string[]: Collection memberships; omitted on lists unless includeCollections=true.
  - `googleSource` GoogleProvenanceDto
    - `fileId` string, required
    - `name` string, required
    - `url` string, required
    - `mimeType` string, required
    - `driveVersion` string, required
    - `docsRevision` string
    - `tabCount` number
    - `skipEmptyPages` boolean: Whether conversion suppresses automatic blank parity pages. Absent on older imports, which retain their original pagination.
    - `fetchedAt` string, required
    - `locallyReplacedAt` string: First local file replacement. When present, this provenance describes the original import, not the current template file. Google variable validation no longer applies; the saved pagination policy is retained.
    - `sourceSha256` string, required: SHA-256 of the stored source, after DOCX ZIP normalization.
    - `providerSourceSha256` string: SHA-256 of the original bytes downloaded from Google.
    - `pdfSha256` string, required
    - `dialect` 'korala-simple-v1', required
  - `id` string, required
  - `name` string, required
  - `status` 'draft' | 'pending' | 'completing' | 'completed' | 'failed' | 'voided' | 'expired', required
  - `originalFileUrl` string, required
  - `signedFileUrl` string, nullable
  - `certificateFileUrl` string, nullable
  - `expiresAt` string, date-time, nullable
  - `completedAt` string, date-time, nullable
  - `sandbox` boolean, required: Whether this is a sandbox (test) document
  - `suppressNotifications` boolean, required: Whether email notifications are suppressed
  - `formFieldsDetected` number, nullable: How many interactive form fields the uploaded PDF ships with, counted when the upload was confirmed. 0 for a flat PDF, null when the file was never scanned (e.g. generated from a template).
  - `autoImportFormFields` boolean, required: Whether those embedded fields are placed automatically for the first signer added to this document.
  - `catalogFormSlug` string, nullable: Standard Forms catalog slug this document was generated from, e.g. "irs-w9" (null for non-catalog documents)
  - `catalogFormTitle` string, nullable: Catalog form title, e.g. "IRS Form W-9 …"
  - `catalogRevision` string, nullable: Catalog form revision, e.g. "Rev. March 2024"
  - `catalogVersionId` string, nullable: ID of the catalog form version this document is based on
  - `templateId` string, uuid, nullable: The workspace template this document was created from
  - `templateName` string, nullable: That template's current name, on the document detail only (null if the template was deleted)
  - `signerNames` string[]: Names of the people signing, in signing order. On document lists only.
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `400`: Malformed UUID in path parameter (`id`).

---

[API](https://skmtc.dev/korala/apis/korala-public-api.md) · [All operations](https://skmtc.dev/korala/apis/korala-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/korala/apis/korala-public-api/revisions/5c4d7810c507?raw)
