---
title: "Export a chart as an image"
method: POST
path: "/v1/export"
tags: ["Export"]
---

# Export a chart as an image

`POST /v1/export`

## Request

- Base URL: `https://api.stackdata.io`
- URL: `https://api.stackdata.io/v1/export`
- Auth: one of:
  - none
  - API key in header `X-API-Key`

Rasterises a client-supplied SVG chart to PNG (or returns watermarked SVG if no
rasteriser is installed). The incoming SVG is **scrubbed** first; anything unsafe
(scripts, external references, event handlers) is rejected with `400`.

The **watermark is decided server-side by the caller's tier** — free-tier exports always
carry the StackData mark and the client cannot opt out.

## Request body

- object
  - `svg` string, required: The chart as an SVG string, with colours inlined.
  - `title` string: Title rendered above the chart.
  - `theme` object: Optional theme tokens (background, ink, …).

## Response `200`

The image. PNG when a rasteriser is available, otherwise watermarked SVG.

## Other responses

- `400`: The SVG was invalid or unsafe and was rejected before rendering.

---

[API](https://skmtc.dev/stackdata/apis/stackdata-api.md) · [All operations](https://skmtc.dev/stackdata/apis/stackdata-api/llms.txt) · [OpenAPI document](https://skmtc.dev/stackdata/apis/stackdata-api/revisions/91358ae3f6e8?raw)
