Skip to content
HALOWERK

Formatwerk

mermaid render

Runs mermaid 12.2 from node_modules (no CDN) in a fresh incognito Chrome context with all network requests blocked, initialised with securityLevel strict (labels sanitised, no click callbacks, no HTML labels) and deterministic ids; directives cannot lift the protected security keys. Syntax errors return the parser message. PNG is rasterised by Chrome from the SVG.

POST https://format.halowerk.com/v1/mermaid-render

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
codestringYesMermaid diagram source.
themestringNo
formatstringNosvg, png (rasterised by Chrome) or both.
scalenumberNoDevice pixel ratio for PNG output.
backgroundstringNo
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "code"
  ],
  "properties": {
    "code": {
      "type": "string",
      "minLength": 1,
      "maxLength": 50000,
      "description": "Mermaid diagram source."
    },
    "theme": {
      "type": "string",
      "enum": [
        "default",
        "neutral",
        "dark",
        "forest",
        "base"
      ],
      "default": "default"
    },
    "format": {
      "type": "string",
      "enum": [
        "svg",
        "png",
        "both"
      ],
      "default": "svg",
      "description": "svg, png (rasterised by Chrome) or both."
    },
    "scale": {
      "type": "number",
      "minimum": 1,
      "maximum": 4,
      "default": 2,
      "description": "Device pixel ratio for PNG output."
    },
    "background": {
      "type": "string",
      "enum": [
        "white",
        "transparent"
      ],
      "default": "white"
    }
  }
}

Open original schema

Published input example

{
  "code": "flowchart TD\n  A[Order received] --> B{Paid?}\n  B -->|yes| C[Ship]\n  B -->|no| D[Send reminder]",
  "format": "svg"
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’