---
title: "Validate Markdown/Liquid and preview a PDF without saving or sending"
method: POST
path: "/api/v1/templates/markdown/preview"
tags: ["Templates"]
---

# Validate Markdown/Liquid and preview a PDF without saving or sending

`POST /api/v1/templates/markdown/preview`

## Request

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

## Request body

- MarkdownSourceDto
  - `source` string, required: Markdown with the supported Liquid variable, if/unless and for syntax.
  - `sampleData` object: Example JSON for previews. Never implicitly fills a generated agreement.
  - `pageSize` 'A4' | 'Letter'

## Response `200`

- MarkdownPreviewDto
  - `pdfBase64` string, required: Base64 encoded PDF. Preview does not save a template or send a document.
  - `pageCount` number, required
  - `mergeFields` DetectedMergeFieldDto[], required
    - `name` string, required
    - `occurrences` number, required
  - `signatures` MarkdownSignatureDto[], required: Every field a signer fills in, in source order: each ::signature, and each ::field (dates, text, initials, checkboxes, dropdowns, radios).
    - `role` string, required
    - `label` string, required
    - `fieldType` 'signature' | 'initials' | 'date' | 'text' | 'checkbox' | 'dropdown' | 'radio', required
    - `required` boolean, required
    - `options` string[]: A dropdown's choices, in order.
    - `groupKey` string: Shared by a radio's choices: one of them is picked.
    - `groupRequired` boolean: Whether the signer must pick one in that group.
    - `signingDate` boolean: A date filled with the date of signing: signingDate="true", or a date inside a :::signatures block that does not say otherwise.
    - `pageNumber` number, required
    - `xPosition` number, required
    - `yPosition` number, required
    - `width` number, required
    - `height` number, 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)
