Export a PNG or SVG file
export_diagramExports the diagram, or one frame (frameId: the frame and everything inside it), as a PNG or SVG file and returns a download link for the person. Returns { downloadUrl, expiresAt, maxDownloads, downloadsLeft, reused, filename, mimeType, bytes, width, height, scale, requestedScale, seq, watermark, watermarkSource, watermarkStyle, watermarkPosition, externalImageCount, externalImageNodeIds, warnings }. The link downloads the file (it is not an inline image) until expiresAt (15 minutes), for up to 5 downloads, and anyone with the link can use it until then. Calling again with the same arguments while the diagram is unchanged returns the same open link (reused: true, with downloadsLeft) instead of a new file. PNG: scale 1–4 pixels per diagram unit (default 2), long edge up to 3072 px; scale in the result is the pixels per unit actually used, and warnings lists png_scale_capped (size limit) or png_size_reduced (file size limit) when it is lower than requested (for a large diagram, a frameId or format svg gives a sharper file). SVG: a still image unless animate is true. Files always have the theme’s opaque background and a fixed margin; PDF and JPEG files, a transparent background and custom margins are made in the editor (Share → Export). watermark adds the Archboard watermark; it is always added when the organization’s plan requires it (watermarkSource "plan"). watermarkStyle and watermarkPosition choose its look and corner; warnings lists watermark_style_adjusted when the requested style was replaced by badge. PNG is drawn by the same renderer as render_snapshot, with the same limits: external and AVIF images render as placeholders, colour emoji render in one colour, text inside nested SVG images is not drawn. In SVG, external and AVIF images are placeholders. When images point to a web address, warnings lists external_images_placeholder with externalImageCount and externalImageNodeIds (add_image imports them).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | PNG only: pixels per diagram unit (default 2). The long edge is capped at 3072 px. The result’s scale is the value actually used. | |
| theme | No | Colour theme (default light); the file’s background is the theme’s opaque canvas colour. | light |
| format | No | File format: png (default) or svg. PDF and JPEG files are made in the editor (Share → Export). | png |
| animate | No | SVG only: keep the diagram’s edge animations (SMIL). Default false: a still SVG. | |
| frameId | No | Export only this frame (or any node) and its subtree. | |
| filename | No | File name without extension, in any language (default: the diagram title; with frameId, the title and the frame name). | |
| diagramId | Yes | Diagram id (from list_diagrams or create_diagram). | |
| watermark | No | Add the Archboard watermark. Ignored when the organization’s plan always adds it (watermarkSource "plan"). | |
| watermarkStyle | No | Watermark style: badge (default: logo, name and domain on a light chip), badge-dark (the same on a dark chip), mark (logo only; replaced by badge when the organization’s plan requires the watermark), band (edge band). | |
| watermarkPosition | No | Corner: bottom-right (default), bottom-left, top-right, top-left. |