Templates

Pre-built chart templates for common use cases. Render with query parameter overrides. Use GET /api/v1/templates to list all templates including your custom ones.

Built-in Templates

16 production-ready templates. All support brand kit overrides via brandKitId and data overrides via labels / data query parameters.

Template IDDescription
mrr-trendMRR line chart with target line and launch window annotations
signups-barSignups bar chart with on-bar data labels
weekly-volume-rateMixed bar (volume) + line (conversion %) with dual Y axes
plan-distributionPlan distribution pie chart
funnel-conversionFunnel stages bar chart showing drop-off at each step
nps-trendNPS score trend line with reference zones
churn-rateMonthly churn rate line chart with target annotation
mrr-growthMRR growth bar chart with month-over-month delta
email-performanceEmail open/click rates bar chart
ad-spend-roiAd spend vs. return bar chart with ROI line overlay
csat-breakdownCSAT score distribution doughnut chart
support-volumeSupport ticket volume bar chart by category
pipeline-stagesSales pipeline stages bar chart
win-rate-trendWin rate trend line with rolling average
quota-attainmentQuota attainment bar chart with target line
ltv-cacLTV vs. CAC comparison bar chart

Rendering a Template

Use the GET endpoint with optional data and style overrides:

text
GET /api/v1/templates/mrr-trend/render?labels=Jan,Feb,Mar,Apr,May&data=12000,15000,18000,22000,25000&format=png&brandKitId=obsidian

Omitting scale defaults to 2× output (retina). Pass scale=1 for 1×.

Query Parameters

ParameterDescription
labelsComma-separated x-axis labels
dataComma-separated numeric values
titleOverride chart title
width, heightDimensions in pixels (100–4000)
formatpng, jpeg, svg, webp
brandKitIdSaved kit UUID or preset: obsidian, linen, polar, studio, ember, harbor
scale / devicePixelRatio1–4; defaults to 2 on this route when omitted
paletteComma-separated hex colors (URL-encode # as %23) — overrides series colors

Card Template Example

Templates that include card composition (header, kpiStrip, footer) render the full card. You can also supply a full card spec to POST /api/v1/render directly:

json
{ "type": "line", "brandKitId": "obsidian", "header": { "eyebrow": "Metrics · Jan–May 2024", "title": "MRR Trend", "badge": { "text": "+14%", "backgroundColor": "#166534", "color": "#dcfce7" } }, "kpiStrip": [ { "label": "MRR", "value": "$25,000", "color": "#22c55e" }, { "label": "ARR", "value": "$300k", "color": "#22c55e" }, { "label": "Growth", "value": "+14%", "color": "#22c55e" } ], "footer": { "left": "chart-output.com", "right": "Updated daily" }, "data": { "labels": ["Jan", "Feb", "Mar", "Apr", "May"], "datasets": [{ "label": "MRR", "data": [12000, 15000, 18000, 22000, 25000] }] } }

Custom Templates

Save any chart spec as a reusable template via the dashboard or API:

json
POST /api/v1/templates { "name": "Monthly MRR", "description": "Standard MRR line chart with card", "chartType": "line", "spec": { ... } // Any valid chart spec including card composition }

Once saved, render it the same way as built-in templates using the returned UUID as the templateId.