Skip to Content
GuidesMarkdown Templates

Try the Markdown playground  without an account. Edit Markdown and Liquid with syntax highlighting, line numbers, undo/redo and formatting shortcuts. Switch to Example data to edit the JSON. The live preview runs in your browser and does not send your draft to the server.

Choose Save in Korala to sign up or continue to the dashboard with your draft. The browser keeps that handoff in the current tab for up to 24 hours. In the dashboard, choose Generate PDF preview to check pagination and signature placement before saving. Use Create document to assign recipients and review a draft before sending.

The live preview shows a continuous document. The generated PDF determines page breaks. You can also create templates through the authenticated API below.

Markdown is the source format; PDF is the generated document. Use DOCX when your existing Word layout is the source of truth. MDX and JavaScript components are unsupported.

Syntax

Korala uses LiquidJS with standard variables, if / elsif / else, unless, and for / else blocks. Only the upcase and downcase filters are enabled. Format dates, currencies and calculated totals in your application. Liquid tags trim the immediately following newline so repeated Markdown table rows stay together.

# Agreement for {{ client.name }} | Deliverable | Fee | | --- | --- | {% for item in items %} | {{ item.description }} | {{ item.fee }} | {% endfor %} {% if includes_support %} Support is included for 30 days after delivery. {% endif %} The parties accept the scope above. :::signatures ::signature{role="client" label="Client signature"} ::signature{role="provider" label="Provider signature"} :::

Use ::pagebreak on its own line for a new page. Signature directives may stand alone at the document root or in a signatures group with one or two roles. Roles are unique identifiers starting with a letter, followed by letters, numbers, underscores or hyphens (40 characters maximum). Labels are optional, up to 80 characters. Keep signature roles unconditional: the roles for a customer document must match the saved template.

Source supports headings, lists, tables, emphasis, code and HTTPS/mailto links. Variables belong in prose, headings or table cells. Their values remain literal text, so customer data cannot add Markdown formatting, HTML or signature blocks. Missing variables cause an error. Variables in code, URLs or directive attributes are rejected. Raw HTML, images, includes, arbitrary filters and JavaScript are unsupported.

The current limits are 128 KiB each for source and JSON data, 200 items per array, eight signer roles and 50 output pages. Rendering is bounded; very large loops may hit the time or output limit first. A4 is the default page size; Letter is also supported. Preview long descriptions and both sides of conditions before reusing a template.

API workflow

All paths below are relative to /api/v1 and use HMAC API key authentication. The downloadable helper handles authentication and requires no npm packages or repository checkout. For these API operations, configure credentials as described under Optional API automation.

From the extracted korala-documents folder, use your Markdown source and explicit example data to preview and save a template:

node scripts/korala.mjs preview agreement.md example.json preview.pdf # Open preview.pdf and review it before saving. node scripts/korala.mjs create agreement.md example.json "Services agreement"

The create command returns the template JSON. Use its id with node scripts/korala.mjs get TEMPLATE_ID to retrieve the current source revision and signer role IDs.

OperationEndpoint
Render without savingPOST /templates/markdown/preview
Create templatePOST /templates/markdown
Edit sourcePATCH /templates/:id/markdown
Read source, revision and rolesGET /templates/:id
Generate a PDFPOST /templates/:id/generate
Create a draft for signingPOST /templates/:id/create-document

Preview accepts source, sampleData, and optional pageSize. Creating also requires name; description is optional. Updating requires the full source payload and revision from the current template. A stale revision returns 409; fetch and reconcile the latest source before retrying. Signature roles and fields are managed through the source editor for Markdown templates.

Generate accepts { "templateData": { ... } }. Create-document accepts the same data plus a document name and signer assignments:

{ "name": "Acme services agreement", "templateData": { "client": { "name": "Acme Studio" }, "items": [{ "description": "Website design", "fee": "$4,500" }], "includes_support": true }, "signers": { "ROLE_ID_FROM_TEMPLATE": { "name": "Jane Smith", "email": "[email protected]" }, "OTHER_ROLE_ID_FROM_TEMPLATE": { "name": "Alex Jones", "email": "[email protected]" } } }

Supply all values referenced by your own source. Saved sampleData is never an implicit default for a customer document. Existing documents keep their generated PDF when you edit a template. Generation records the source revision and hash in the document audit trail.

Creating a draft does not send signing invitations. Use the existing document review/send flow and completion webhooks described in the documents guide.

AI agents

Ask your agent to draft an agreement and open it in Korala. You do not need API keys to use this workflow. Review the draft in the playground, then choose Save in Korala. Sign in or create an account there; Korala carries the draft into the template editor so you can preview the PDF and save it.

Download the Korala document skill . Extract it into your agent’s skills directory and enable it using your agent’s instructions. The archive contains SKILL.md and scripts/korala.mjs; no repository checkout or npm packages are required. The helper requires Node.js 22 or later.

For example, ask: “Create a rental agreement template from these approved terms, with example tenant data and landlord/tenant signature roles. Open it in Korala so I can review and save it.”

The agent creates the Markdown and example data, generates a draft link, and opens it in your browser. If your agent cannot open a browser, click the Open in Korala link it returns.

From the extracted korala-documents folder, save the Markdown from the Syntax section as agreement.md and this data as example.json:

{ "client": { "name": "Acme Studio" }, "items": [{ "description": "Website design", "fee": "$4,500" }], "includes_support": true }

Run:

node scripts/korala.mjs playground agreement.md example.json "Services agreement"

Open the printed URL to load the draft in the playground. This command requires no account or API credentials and does not create a saved template.

The link contains the source and example data in its URL fragment. The browser does not send that fragment in the page request, and Korala removes it after loading. Anyone with the full link can read the draft, so use example data when sharing. Draft links allow up to 64 KiB of encoded content; for larger drafts, paste the source and data into the playground.

Optional API automation

For automated PDF generation or saving templates without browser review, create an API key in Settings → API keys. Make KORALA_API_KEY_ID and KORALA_API_SECRET available to the command runner as environment variables. Keep credentials out of prompts and source files.

Run node scripts/korala.mjs --help for the preview, create, update, get, generate, create-document, send, and status commands. Creating a template or document draft does not send invitations. Use send only when the user has authorized sending.

Keep approved template source in your own files or version control. Review the agent’s edits before saving them to Korala, and pass each customer’s data when generating a document.

Last updated on