---
title: "GET /api/v1/template-preparation"
method: GET
path: "/api/v1/template-preparation"
tags: ["Template Preparation Browser"]
---

# GET /api/v1/template-preparation

`GET /api/v1/template-preparation`

## Request

- Base URL: `https://api.korala.ai`
- URL: `https://api.korala.ai/api/v1/template-preparation`
- Auth: HTTP bearer

## Headers

- `authorization` string, required

## Response `200`

- TemplatePreparationStateDto
  - `removableFieldIds` string[], required: Review fields the browser may remove now. The API protects the last linked placement and any required minimum.
  - `mode` 'full' | 'review', required
  - `reviewReady` boolean, required
  - `template` TemplateWithDetailsDto, required
    - `collectionIds` string[]: Collection memberships; omitted on lists unless includeCollections=true.
    - `markdown` MarkdownTemplateSourceDto
      - `source` string, required
      - `sampleData` object, required
      - `revision` number, required
      - `formatVersion` 1, required
      - `pageSize` 'A4' | 'Letter', required
      - `pageCount` number: Pages the source renders to with its sample data, as of the last save. Absent on templates saved before this was recorded.
    - `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
    - `description` string, nullable
    - `templateType` 'pdf' | 'docx' | 'markdown', required
    - `baseFileUrl` string, required
    - `isActive` boolean, required
    - `sandbox` boolean, required: Created with a test-mode API key (sandbox template)
    - `formFieldsDetected` number, nullable: How many interactive form fields the base PDF ships with, counted when the upload was confirmed. 0 for a flat PDF, null when the file was never scanned.
    - `autoImportFormFields` boolean, required: Whether those embedded fields were placed as template fields automatically when the upload was confirmed.
    - `detectedMergeFields` DetectedMergeFieldDto[], nullable: Auto-detected input fields from DOCX or Markdown (null for PDF templates)
      - `name` string, required
      - `occurrences` number, required
    - `catalogFormSlug` string, nullable: Standard Forms catalog slug this was cloned from, e.g. "irs-w9" (null for uploaded templates)
    - `catalogFormTitle` string, nullable: Catalog form title at clone time, e.g. "IRS Form W-9 …"
    - `catalogRevision` string, nullable: Catalog form revision at clone time, e.g. "Rev. March 2024"
    - `catalogVersionId` string, nullable: ID of the catalog form version this was cloned from
    - `fieldCount` number: Fields the template places. On template lists only.
    - `signerRoleCount` number: Signer roles the template defines. On template lists only.
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `signerRoles` TemplateSignerRoleDto[], required
      - `id` string, required
      - `templateId` string, required
      - `name` string, required
      - `signingOrder` number, required
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
    - `fields` TemplateFieldDto[], required
      - `valueKey` string, nullable: Repeated text value key, scoped to the owning signer.
      - `id` string, required
      - `templateId` string, required
      - `signerRoleId` string, nullable
      - `fieldType` 'signature' | 'initials' | 'date' | 'text' | 'checkbox' | 'dropdown' | 'radio', required
      - `placement` 'coordinate' | 'anchor' | 'bookmark', required
      - `pageNumber` number, required: 1-based page number, or -1 for last page.
      - `xPosition` number, nullable
      - `yPosition` number, nullable
      - `width` number, required
      - `height` number, required
      - `required` boolean, required
      - `mergeFieldName` string, nullable
      - `defaultValue` string, nullable
      - `editable` boolean, required: When true, a prefilled value is a suggestion the signer can change before signing.
      - `sharedFill` boolean, required: One signer role owns the generated field, but until that signer signs any signer able to act may fill or correct it. Never true on signature or initials fields.
      - `signingDate` boolean, nullable: Date fields only. True fills the field with the date the signer signs: the signing page shows today and the signer does not type it. False makes it an ordinary date the signer enters. Refused on any other type. Null on a date made before the flag existed: a date on the signer’s own signature line is then the date of signing.
      - `label` string, nullable: Human-readable label shown to the signer for this field
      - `acroFieldName` string, nullable: Embedded AcroForm field this field is linked to; generated document fields inherit the link.
      - `acroOptionValue` string, nullable: For radio-group AcroForm fields: the option this field selects.
      - `options` string[], nullable: Allowed values for dropdown fields
      - `maxLength` number, nullable: Maximum characters accepted at fill time
      - `inputMask` string, nullable: Input mask where # represents one digit
      - `validationPattern` string, nullable: Regex the filled value must match
      - `validationMessage` string, nullable: Signer-facing error when validationPattern does not match
      - `dateFormat` string, nullable: Date fields only: format the auto-filled date is rendered in, e.g. 'MM-DD-YYYY'
      - `fontSize` number, nullable: Point size the value is drawn at, copied onto generated document fields. Null fits the size to the box.
      - `textColor` string, nullable: Color the value is drawn in, as #rrggbb
      - `textAlign` 'left' | 'center' | 'right': Horizontal alignment of the value inside the field box
      - `fontFamily` string, nullable: Base font the value is drawn in, copied onto generated document fields
      - `multiline` boolean, required: Whether the value may contain line breaks (a multiline form field)
      - `groupKey` string, nullable
      - `groupRequired` boolean, required: Whether at least one member of this group must be selected
      - `requiredWhenFieldId` string, uuid, nullable: Id of the template field whose checked/filled state makes this field required on generated documents; null when unconditional
      - `requiredWhenValue` string, nullable: Exact controller value the condition triggers on; null means any checked/filled state
      - `anchorText` string, nullable
      - `anchorPosition` 'replace' | 'left' | 'right' | 'above' | 'below', required
      - `anchorOffsetX` number, required
      - `anchorOffsetY` number, required
      - `hideAnchor` boolean, required
      - `anchorMatchWholeWord` boolean, required
      - `bookmarkName` string, nullable
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
  - `parentOrigin` string, required
  - `uploaded` boolean, required
  - `completed` boolean, required

---

[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)
