---
title: "Preview Declaration"
method: POST
path: "/api/declarations/preview"
tags: ["Declarations"]
---

# Preview Declaration

`POST /api/declarations/preview`

Render a declaration as HTML for frontend preview.

Body:
    template_id: int — Z_DeclarationTemplates.id
    subject_id: int — Record ID (vehicle, contract, or client)
    client_id: int (optional) — Client/supplier ID (auto-detected for vehicles)
    website_id: int (optional) — Website ID for theme colors (auto-detected if not sent)

Returns:
    rendered_html: str — Full HTML with resolved placeholders, Tailwind CSS, header
    context: dict — Raw placeholder data
    template: dict — Template metadata (id, name, id_modulo, tipo_doc)

## Headers

- `x-api-token` string, nullable

## Request body

- object

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/multigest/apis/multigest-protected-api.md) · [All operations](https://skmtc.dev/multigest/apis/multigest-protected-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/multigest/multigest-protected-api/revisions/4b44eb76b3ee/schema)
