{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://api.pdfmonkey.io/schemas/document-template.json", "title": "DocumentTemplate", "description": "A PDF Monkey document template defining the HTML/Liquid body, SCSS styles, sample data, and generation settings used to produce PDF documents.", "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique template identifier" }, "app_id": { "type": "string", "format": "uuid", "description": "Workspace (app) identifier this template belongs to" }, "identifier": { "type": "string", "minLength": 1, "maxLength": 100, "description": "Human-readable unique identifier for the template within the workspace" }, "edition_mode": { "type": "string", "enum": ["code", "builder"], "description": "Whether this template was created with the code editor or visual builder" }, "output_type": { "type": "string", "enum": ["pdf", "image"], "description": "Output format for documents generated from this template" }, "is_draft": { "type": "boolean", "description": "Whether the template is currently in draft state (unpublished changes pending)" }, "body": { "type": ["string", "null"], "description": "Published HTML + Liquid template body content" }, "body_draft": { "type": ["string", "null"], "description": "Draft HTML + Liquid template body (not yet published)" }, "scss_style": { "type": ["string", "null"], "description": "Published CSS/SCSS stylesheet for the template" }, "scss_style_draft": { "type": ["string", "null"], "description": "Draft CSS/SCSS stylesheet (not yet published)" }, "sample_data": { "type": ["string", "null"], "description": "Published JSON sample data used for template preview and testing" }, "sample_data_draft": { "type": ["string", "null"], "description": "Draft JSON sample data (not yet published)" }, "settings": { "$ref": "#/$defs/TemplateSettings", "description": "Published PDF generation settings" }, "settings_draft": { "$ref": "#/$defs/TemplateSettings", "description": "Draft PDF generation settings (not yet published)" }, "pdf_engine_id": { "type": ["string", "null"], "format": "uuid", "description": "UUID of the PDF rendering engine to use for generation" }, "pdf_engine_draft_id": { "type": ["string", "null"], "format": "uuid", "description": "UUID of the draft PDF rendering engine" }, "template_folder_id": { "type": ["string", "null"], "format": "uuid", "description": "UUID of the folder this template is organized in" }, "ttl": { "type": ["integer", "null"], "minimum": 0, "description": "Time-to-live in seconds for documents generated from this template. Null means no expiry." }, "created_at": { "type": "string", "format": "date-time", "description": "ISO 8601 timestamp when the template was created" }, "updated_at": { "type": "string", "format": "date-time", "description": "ISO 8601 timestamp of the last template update" } }, "required": ["id", "app_id", "identifier", "edition_mode", "output_type", "is_draft", "created_at", "updated_at"], "$defs": { "TemplateSettings": { "type": "object", "description": "PDF generation settings controlling layout, dimensions, and rendering behavior", "properties": { "footer": { "type": "object", "description": "Footer configuration with optional left, center, right, or content properties" }, "header": { "type": "object", "description": "Header configuration with optional left, center, right, or content properties" }, "inject_javascript": { "type": "boolean", "description": "Whether to execute JavaScript during PDF generation" }, "margin": { "type": "object", "description": "Page margins in millimeters", "properties": { "top": {"type": "number", "minimum": 0}, "bottom": {"type": "number", "minimum": 0}, "left": {"type": "number", "minimum": 0}, "right": {"type": "number", "minimum": 0} } }, "orientation": { "type": "string", "enum": ["portrait", "landscape"], "description": "Page orientation" }, "paper_format": { "type": "string", "enum": ["a0", "a1", "a2", "a3", "a4", "a5", "a6", "letter", "custom"], "description": "Standard paper size. Use 'custom' with paper_height and paper_width." }, "paper_height": { "type": "number", "minimum": 0, "description": "Custom paper height in millimeters (only used when paper_format is 'custom')" }, "paper_width": { "type": "number", "minimum": 0, "description": "Custom paper width in millimeters (only used when paper_format is 'custom')" }, "transparent_background": { "type": "boolean", "description": "Whether the PDF background should be transparent" }, "use_emojis": { "type": "boolean", "description": "Whether to enable emoji rendering in the generated PDF" }, "use_paged": { "type": "boolean", "description": "Whether to use Paged.js for print/page layout processing" } } } } }