---
title: "Confirm template upload and set metadata"
method: POST
path: "/api/v1/templates/{id}/confirm"
tags: ["Templates"]
---

# Confirm template upload and set metadata

`POST /api/v1/templates/{id}/confirm`

## Request

- Base URL: `https://api.korala.ai`
- URL: `https://api.korala.ai/api/v1/templates/{id}/confirm`
- 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

- CreateTemplateDto
  - `name` string, required
  - `description` string
  - `autoImportFormFields` boolean: When the base PDF is a fillable form, its embedded fields are placed as template fields automatically — same positions, types, character limits and font sizes the form declares — and assigned to the template's first signer role (one named "Signer" is created when the template has none). Defaults to false for templates created with an API key (integrations provision their own roles and fields) and true for templates created from the dashboard; pass a value to override either way.

## Response `200`

- TemplateDto
  - `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

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