Declaration Templates (Admin)

Ai Generate Template

Generate declaration template HTML using AI (Claude).

The AI generates HTML body content using the V5 CSS design system and we return it as an editable DRAFT (design_json + html_content) — it is NOT saved. The frontend opens it in the editor; the user picks the mandatory Tipo de Documento and saves via the normal POST /declaration-templates (which enforces a valid tipo_doc). This mirrors the import-document flow and guarantees no NULL-tipo_doc template is ever persisted.

Body: example_text: str (required, min 10 chars) — description of what the user wants placeholders: list[str] (required, min 1) — placeholder keys to include id_modulo: int (required) — 5, 11, or 12 name: str (optional) — template name (defaults to "Declaração IA") trigger_action: str (optional) — trigger for auto-generation tipo_doc: int (optional) — document type ID, pre-fills the draft's metadata

post/api/declaration-templates/ai-generate

Request

  • Base URL
    https://api.multigest.pt (the document declares no server; this is the origin it was published from)
  • URL
    https://api.multigest.pt/api/declaration-templates/ai-generate
  • Auth
    API key in header x-api-token and API key in header x-origin-verify

Headers

x-api-tokenstring nullable

Request body

object required

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 21 revisions of this API.