---
title: "Fill documents without generating them"
method: POST
path: "/v1/doc-gen/drafts"
tags: ["Document Generation"]
---

# Fill documents without generating them

`POST /v1/doc-gen/drafts`

## Request

- Base URL: `https://api.talonic.com`
- URL: `https://api.talonic.com/v1/doc-gen/drafts`
- Auth: HTTP bearer

Fills every chosen template for every chosen row on the server and returns, per document, the values with their origins and the fields still missing. Nothing is stored. Needs the `read` scope; as a POST it still requires a person at or above member behind the key. A batch holds at most 500 documents (rows times templates).

## Request body

- DocGenGenerateRequest: Name a template with `template_id` (and `with_pair`) or an explicit set with `template_ids`.
  - `template_id` string, uuid
  - `template_ids` string[]
  - `with_pair` boolean: Also generate the template's companion.
  - `data_product_id` string, uuid, required
  - `record_ids` string[], required: Row ids of the data product.
  - `values` object: Values for every document by field key. A field entered per document takes the value as entered, a passage decided per document takes yes or no, and any other field takes it as an edit over the fill.
  - `documents` DocGenDocumentValues[]: Values for single documents; they win over `values`.
    - `record_id` string, required
    - `template_id` string, uuid: Only this template's document; every template of the batch when omitted.
    - `values` object, required: Values by field key.
  - `profile` object: The writer's details for this batch only (name, kuerzel, titel, bereich, unterschrift); the saved profile is unchanged.
  - `save_to_workspace` boolean: When false, the files are deleted 24 hours after generation.
  - `allow_missing` boolean: Generate although some documents leave fields empty.
  - `dry_run` boolean

## Response `201`

The templates and the filled documents.

- DocGenDraftsResult
  - `templates` object[]
    - `id` string, uuid
    - `name` string
  - `documents` DocGenDraft[]
    - `template_id` string, uuid
    - `template_name` string
    - `record_id` string
    - `record_label` string
    - `filled` integer
    - `total` integer
    - `missing` object[]
      - `key` string
      - `label` string
      - `source` 'product' | 'reference' | 'extract' | 'first' | 'case' | 'user' | 'rule' | 'today' | 'party' | 'variant' | 'condition' | 'fixed' | 'lookup': The type of the field's source.
    - `values` object

## Other responses

- `400`: The request is invalid.
- `403`: The API key does not have the required scope.
- `404`: A template, or a row that is not in the data product or not readable by the key.
- `422`: The batch exceeds 500 documents.

## Changes

- **2026-10-28** `0a485a46163e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/talonic/apis/talonic-api/changes/v1/doc-gen/drafts/post.md)

---

[API](https://skmtc.dev/talonic/apis/talonic-api.md) - [All operations](https://skmtc.dev/talonic/apis/talonic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/talonic/apis/talonic-api/revisions/9f6d53e2ab5e?raw)
