---
title: "Render a document template for a case"
method: POST
path: "/v1/cases/{id}/document-templates/{key}/render"
tags: ["Cases"]
---

# Render a document template for a case

`POST /v1/cases/{id}/document-templates/{key}/render`

## Request

- Base URL: `https://api.dotfile.com`
- URL: `https://api.dotfile.com/v1/cases/{id}/document-templates/{key}/render`
- Auth: API key in header `X-DOTFILE-API-KEY`

Render a `case_report` document template for a case and get the PDF back in the response. The latest published version of the template is used. No request body is needed. Unlike `POST /cases/{id}/generate-report`, which queues the full case report and delivers it through the `CaseReport.Generated` webhook, this endpoint answers synchronously and renders the template configured in your workspace.

Rendering goes through a third party, so this endpoint can also answer `CASE_REPORT_RENDER_FAILED`: a `400` carrying the reason when the template itself cannot be rendered, or a `502` when the rendering service is unavailable. Retrying only helps the `502`.

---

#### See also  
Learn more about [Cases](./cases-guide)

## Path parameters

- `id` string, required
- `key` string, required

## Response `200`

The rendered report

**ℹ️ Click to see full payload**

## Other responses

- `400`: The request is either malformed or contain invalid parameters. - Make sure the identifier specified in the URL is a valid UUID - The document template has no published version yet (`DOCUMENT_TEMPLATE_NOT_PUBLISHED`) - The case has too many checks for a synchronous report (`CASE_REPORT_TOO_MANY_CHECKS`), use `POST /cases/{id}/generate-report` instead - The document template could not be rendered (`CASE_REPORT_RENDER_FAILED`)
- `404`: No case or document template can be found.
- `502`: The rendering service is unavailable (`CASE_REPORT_RENDER_FAILED`). Retry the request.

## Changes

- **2026-11-03** `50cab516e856`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/dotfile/apis/api-specifications/changes/v1/cases/:id/document-templates/:key/render/post.md)

---

[API](https://skmtc.dev/dotfile/apis/api-specifications.md) - [All operations](https://skmtc.dev/dotfile/apis/api-specifications/llms.txt) - [OpenAPI document](https://skmtc.dev/dotfile/apis/api-specifications/revisions/50cab516e856?raw)
