---
title: "Generate document from template"
method: POST
path: "/documents/templates/{id}/generate"
tags: ["Documents"]
---

# Generate document from template

`POST /documents/templates/{id}/generate`

## Request

- Base URL: `https://hoghogh.ai/api/v1`
- URL: `https://hoghogh.ai/api/v1/documents/templates/{id}/generate`
- Auth: HTTP bearer

## Path parameters

- `id` integer, required

## Request body

- object
  - `caseId` string, uuid
  - `fieldValues` object
  - `outputFormat` 'pdf' | 'docx' | 'txt'

## Response `200`

Generated document with download URL

## Other responses

- `400`: Invalid template or missing fields

---

[API](https://skmtc.dev/hoghogh/apis/chistara-api.md) · [All operations](https://skmtc.dev/hoghogh/apis/chistara-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hoghogh/apis/chistara-api/revisions/457df37a06f7?raw)
