---
title: "Generate a PDF from template with filled values (no signing)"
method: POST
path: "/api/v1/templates/{id}/generate"
tags: ["Templates"]
---

# Generate a PDF from template with filled values (no signing)

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

## Request

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

Generates a PDF with template fields filled in using provided variables. This endpoint is for document generation only - no signing workflow is initiated.

## Path parameters

- `id` string, required

## Request body

- GenerateDocumentDto
  - `templateData` object: JSON input for Markdown/Liquid templates.
  - `variables` object: Variables to fill in template fields (by merge field name). For DOCX templates, these substitute {{placeholder}} tags in the document body. Falls back to default values if not provided.

## Response `201`

- GeneratedDocumentDto
  - `url` string, required: URL to download the generated PDF
  - `expiresAt` string, date-time, required: Expiration time for the download URL

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