Render reference
POST /api/v1/render — full request and response reference.
#Request
POST https://sankeykit.com/api/v1/render
Authorization: Bearer sk_live_YOUR_KEY
Content-Type: application/jsonThe body is JSON. flows is the only required field in the payload.
#Minimal request
{
"flows": [
{ "source": "Visitors", "target": "Signups", "value": 120 },
{ "source": "Signups", "target": "Paid", "value": 30 }
]
}#Full request
Every field the schema accepts, used at once:
{
"flows": [
{
"source": "a",
"target": "b",
"value": 2,
"previousValue": 4
},
{
"source": "a",
"target": "c",
"value": 1,
"previousValue": 2
},
{
"source": "b",
"target": "d",
"value": 1,
"previousValue": 2
},
{
"source": "b",
"target": "e",
"value": 1,
"previousValue": 2
}
],
"options": {
"width": 901,
"height": 500,
"nodeWidth": 21,
"nodePadding": 48,
"snapEndNodes": true,
"canvasBackground": "#FFFFFF",
"nodeHeightScale": 0.46,
"labelStyle": {
"fontFamily": "'JetBrains Mono', monospace",
"position": "left",
"background": "#000000",
"backgroundOpacity": 0.75,
"layout": "compact",
"title": {
"show": true,
"color": "#FFFFFF",
"size": 8
},
"subtitle": {
"show": true,
"color": "#FFFFFF",
"size": 8
},
"value": {
"show": true,
"color": "#FFFFFF",
"size": 8,
"prefix": "$",
"suffix": "M",
"decimals": 0
},
"previousValue": {
"show": true,
"color": "#FFFFFF",
"size": 8,
"prefix": "$",
"suffix": "Y/Y",
"mode": "absolute"
}
},
"chartTitle": {
"text": "Title",
"size": 46,
"color": "#FF0000",
"align": "right"
},
"chartSubtitle": {
"text": "Subtitle",
"size": 10,
"color": "#FF0000",
"align": "right"
},
"chartFooter": {
"text": "Footer",
"size": 11,
"color": "#000000",
"align": "left"
},
"theme": "pastel",
"colorPalette": [
"#f9a8d4",
"#fca5a5",
"#fdba74",
"#fde68a",
"#bbf7d0",
"#a5f3fc",
"#bfdbfe",
"#ddd6fe",
"#fbcfe8",
"#d9f99d"
]
},
"nodeOverrides": [
{
"id": "a",
"label": "aa",
"color": "#F163EE",
"subtitle": "A"
},
{
"id": "b",
"label": "bb",
"color": "#63F1E6",
"subtitle": "B",
"yOffset": 100.11190795898438
},
{
"id": "c",
"label": "cc",
"color": "#F163A7",
"subtitle": "C",
"yOffset": -40.38221740722656
},
{
"id": "d",
"label": "dd",
"color": "#F1D063",
"subtitle": "D",
"yOffset": 20.206024169921875,
"column": 1.5
},
{
"id": "e",
"label": "ee",
"color": "#65F163",
"subtitle": "E"
}
],
"linkOverrides": [
{
"source": "b",
"target": "e",
"color": "#8283B5",
"gradient": true
},
{
"source": "a",
"target": "b",
"color": "#0005F1"
},
{
"source": "a",
"target": "c",
"color": "#C54CC2"
},
{
"source": "b",
"target": "d",
"color": "#3EDC06"
}
]
}#Response
| Format | Content type | Body |
|---|---|---|
| PNG | image/png | Raw PNG bytes |
Every successful response also includes:
X-RateLimit-Limit: <monthly quota>
X-RateLimit-Remaining: <renders left this period>
X-RateLimit-Reset: <unix timestamp when quota resets>See Limits for what these mean.
#Saving the output
curl https://sankeykit.com/api/v1/render \
-H "Authorization: Bearer sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d @request.json \
-o chart.svgSwitch the output filename (and "format": "png" in the body) to save a PNG instead.
# Parameter reference
Generated from the live request schema in src/lib/server/render.ts — this table
always matches what the API actually accepts.
| Field | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
flows | object[] | Required | — | — | The list of source-to-target flows that make up the chart. At least one is required. |
flows[].source | string | Required | — | min length 1 | Source node id. |
flows[].target | string | Required | — | min length 1 | Target node id. |
flows[].value | number | Required | — | min 0 | Flow magnitude. Determines link/node thickness. |
flows[].previousValue | number | Optional | — | — | Optional prior-period value, used for period-over-period change labels. |
meta | object | Optional | — | — | Optional metadata about the render request, not rendered on the chart itself. |
meta.title | string | Optional | — | — | Internal title for this render, not displayed on the chart. |
meta.description | string | Optional | — | — | Internal description for this render, not displayed on the chart. |
options | object | Optional | {"width":960,"height":540,"format":"svg"} | — | Layout, styling and output options for the chart. |
options.width | number | Optional | 960 | integer, min 1, max 7680 | Output canvas width in pixels. |
options.height | number | Optional | 540 | integer, min 1, max 7680 | Output canvas height in pixels. |
options.padding | object | Optional | — | — | Padding around the chart area, in pixels per side. |
options.padding.top | number | Optional | — | — | Top padding in pixels. |
options.padding.right | number | Optional | — | — | Right padding in pixels. |
options.padding.bottom | number | Optional | — | — | Bottom padding in pixels. |
options.padding.left | number | Optional | — | — | Left padding in pixels. |
options.nodeWidth | number | Optional | — | integer, min 4, max 100 | Width of node rectangles in pixels. |
options.nodePadding | number | Optional | — | integer, min 0, max 100 | Vertical gap between nodes in the same column, in pixels. |
options.iterations | number | Optional | — | integer, min 0, max 500 | Number of layout relaxation iterations used to reduce link crossings. |
options.align | "justify" | "left" | "right" | "center" | Optional | — | — | Horizontal alignment strategy for node columns. |
options.snapEndNodes | boolean | Optional | — | — | Snap source/sink nodes with no incoming or outgoing links to the outer columns. |
options.mergeParallelLinks | boolean | Optional | — | — | Combine multiple links between the same source/target pair into one. |
options.nodeHeightScale | number | Optional | — | min 0.01, max 1 | Scales node rectangle height relative to its flow value (0-1). |
options.canvasBackground | string | Optional | — | — | CSS color for the chart background. |
options.theme | string | Optional | — | — | Named built-in color theme to apply. |
options.colorPalette | string[] | Optional | — | — | Custom ordered list of CSS colors used to color nodes/links. |
options.linkColorMode | "source" | "target" | "gradient" | "fixed" | Optional | — | — | How link color is derived: from the source node, target node, a gradient between them, or a fixed color. |
options.linkColor | string | Optional | — | — | CSS color used for all links when linkColorMode is "fixed". |
options.linkOpacity | number | Optional | — | min 0, max 1 | Opacity applied to all links (0-1). |
options.labelStyle | object | Optional | — | — | Styling for node labels. |
options.labelStyle.position | "outward" | "left" | "right" | "above" | "below" | "inside" | Optional | — | — | Where node labels are placed relative to their node. |
options.labelStyle.fontFamily | string | Optional | — | — | Font family for all labels. |
options.labelStyle.fontSize | number | Optional | — | — | Base font size in pixels for labels. |
options.labelStyle.color | string | Optional | — | — | Default label text color. |
options.labelStyle.background | string | Optional | — | — | Label background color (behind the text). |
options.labelStyle.backgroundOpacity | number | Optional | — | min 0, max 1 | Opacity of the label background (0-1). |
options.labelStyle.layout | "stacked" | "compact" | "semi-compact" | Optional | — | — | How title/subtitle/value lines are arranged within a label. |
options.labelStyle.title | object | Optional | — | — | Style overrides for the title line of a label. |
options.labelStyle.title.show | boolean | Optional | — | — | Whether to show this label element. |
options.labelStyle.title.color | string | Optional | — | — | CSS color for this label element. |
options.labelStyle.title.size | number | Optional | — | — | Font size in pixels for this label element. |
options.labelStyle.subtitle | object | Optional | — | — | Style overrides for the subtitle line of a label. |
options.labelStyle.subtitle.show | boolean | Optional | — | — | Whether to show this label element. |
options.labelStyle.subtitle.color | string | Optional | — | — | CSS color for this label element. |
options.labelStyle.subtitle.size | number | Optional | — | — | Font size in pixels for this label element. |
options.labelStyle.value | object | Optional | — | — | Style and formatting for the value line of a label. |
options.labelStyle.value.show | boolean | Optional | — | — | Whether to show this label element. |
options.labelStyle.value.color | string | Optional | — | — | CSS color for this label element. |
options.labelStyle.value.size | number | Optional | — | — | Font size in pixels for this label element. |
options.labelStyle.value.prefix | string | Optional | — | — | Text prepended to the formatted value, e.g. "$". |
options.labelStyle.value.suffix | string | Optional | — | — | Text appended to the formatted value, e.g. "%". |
options.labelStyle.value.decimals | number | Optional | — | integer | Number of decimal places to round the value to. |
options.labelStyle.value.locale | string | Optional | — | — | BCP 47 locale used for number formatting, e.g. "en-US". |
options.labelStyle.previousValue | object | Optional | — | — | Style and formatting for the period-over-period change line of a label. |
options.labelStyle.previousValue.show | boolean | Optional | — | — | Whether to show this label element. |
options.labelStyle.previousValue.color | string | Optional | — | — | CSS color for this label element. |
options.labelStyle.previousValue.size | number | Optional | — | — | Font size in pixels for this label element. |
options.labelStyle.previousValue.prefix | string | Optional | — | — | Text prepended to the change value. |
options.labelStyle.previousValue.suffix | string | Optional | — | — | Text appended to the change value. |
options.labelStyle.previousValue.mode | "percentage" | "absolute" | "raw" | Optional | — | — | How to express the change versus previousValue: percentage, absolute difference, or raw value. |
options.labelStyle.showSubtitle | boolean | Optional | — | — | Whether to show the subtitle line at all. |
options.labelStyle.subtitleScale | number | Optional | — | — | Scale factor applied to subtitle font size relative to the title. |
options.chartTitle | object | Optional | — | — | Chart title text shown above the chart. |
options.chartTitle.text | string | Optional | — | — | The text content to display. |
options.chartTitle.size | number | Optional | — | — | Font size in pixels. |
options.chartTitle.color | string | Optional | — | — | CSS text color. |
options.chartTitle.align | "left" | "center" | "right" | Optional | — | — | Horizontal text alignment. |
options.chartSubtitle | object | Optional | — | — | Chart subtitle text shown under the title. |
options.chartSubtitle.text | string | Optional | — | — | The text content to display. |
options.chartSubtitle.size | number | Optional | — | — | Font size in pixels. |
options.chartSubtitle.color | string | Optional | — | — | CSS text color. |
options.chartSubtitle.align | "left" | "center" | "right" | Optional | — | — | Horizontal text alignment. |
options.chartFooter | object | Optional | — | — | Footer text shown below the chart. |
options.chartFooter.text | string | Optional | — | — | The text content to display. |
options.chartFooter.size | number | Optional | — | — | Font size in pixels. |
options.chartFooter.color | string | Optional | — | — | CSS text color. |
options.chartFooter.align | "left" | "center" | "right" | Optional | — | — | Horizontal text alignment. |
options.format | "svg" | "png" | Optional | svg | — | Output image format. |
options.scale | number | Optional | — | min 1, max 3 | Pixel density multiplier applied when rendering PNG output, from 1 to 3. Has no effect on SVG output. Free/non-paid accounts are always forced to 1x regardless of what's requested here. |
options.showAttribution | boolean | Optional | — | — | Whether to show the "Made with SankeyKit.com" attribution link on the rendered chart. Defaults to true. |
nodeOverrides | object[] | Optional | — | — | Per-node style and layout overrides, keyed by node id. |
nodeOverrides[].id | string | Required | — | min length 1 | Node id to override (must match a source/target used in flows). |
nodeOverrides[].label | string | Optional | — | — | Display label shown instead of the node id. |
nodeOverrides[].subtitle | string | Optional | — | — | Secondary line of text shown under the label. |
nodeOverrides[].tag | string | Optional | — | — | Free-form tag, not rendered; used for grouping/color lookups. |
nodeOverrides[].color | string | Optional | — | — | CSS color for this node, overriding the palette. |
nodeOverrides[].hidden | boolean | Optional | — | — | Hide this node (and its links) from the output. |
nodeOverrides[].pinned | boolean | Optional | — | — | Pin the node position so layout iterations do not move it. |
nodeOverrides[].column | number | Optional | — | — | Force the node into a specific column position. Fractional values place the node between columns. |
nodeOverrides[].order | number | Optional | — | integer | Vertical ordering hint within its column. |
nodeOverrides[].yOffset | number | Optional | — | — | Manual vertical pixel offset applied after layout. |
nodeOverrides[].previousValue | number | Optional | — | — | Optional prior-period value for this node, used for change labels. |
linkOverrides | object[] | Optional | — | — | Per-link style overrides, keyed by source/target pair. |
linkOverrides[].source | string | Required | — | min length 1 | Source node id of the link to style. |
linkOverrides[].target | string | Required | — | min length 1 | Target node id of the link to style. |
linkOverrides[].color | string | Optional | — | — | CSS color override for this specific link. |
linkOverrides[].opacity | number | Optional | — | min 0, max 1 | Opacity override for this specific link (0-1). |
linkOverrides[].gradient | boolean | Optional | — | — | Blend this link's color from its source node to its target node. When true, "color" is ignored. |