Export a diagram file
export_diagramExports the diagram, or one frame (frameId: the frame and everything inside it), as a file and returns a download link for the person: png (default), svg, jpeg, pdf (vector) or json (the diagram document, as the editor’s JSON export, with embedded images and files). Animated GIF and WebM are made in the editor (Share → Export). Returns { downloadUrl, expiresAt, maxDownloads, downloadsLeft, reused, filename, mimeType, bytes, width, height, scale, requestedScale, seq, watermark, watermarkSource, watermarkStyle, watermarkPosition, externalImageCount, externalImageNodeIds, warnings, pageCount, pages }. The link downloads the file (not an inline image) until expiresAt (15 minutes), for up to 5 downloads, and anyone with the link can use it until then. The same call on an unchanged diagram returns the same open link (reused: true). Formats follow the organization’s plan as in the editor (otherwise export_format_locked). PNG and JPEG: scale 1–4 pixels per diagram unit (default 2); PNG long edge up to 3072 px, JPEG up to 16 megapixels; warnings lists png_scale_capped, png_size_reduced or jpeg_scale_capped when the scale used is lower. PDF: pdf_raster_fallback when drawn as an image. pages (core.page ids or "all") makes one PDF with one PDF page per page, each at its own size, titles as bookmarks; a page exports without margin and content outside it is cut. SVG: still unless animate is true. background "transparent" (PNG, SVG) removes the background; padding sets the margin. watermark adds the Archboard watermark, always when the plan requires it (watermarkSource "plan"); watermarkStyle and watermarkPosition set its look and corner (watermark_style_adjusted: replaced by badge). JSON has no watermark or size. 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. JPEG and PDF show images from a web address as placeholders too. When images point to a web address, warnings lists external_images_placeholder with externalImageCount and externalImageNodeIds (add_image imports them).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"diagramId": "<diagramId>"
},
"name": "export_diagram"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pages | No | core.page pages: "all" or ids. pdf: one file, one PDF page per page, in page order; other formats: one page. Not with frameId. | |
| scale | No | PNG and JPEG: pixels per diagram unit (default 2); the result’s scale is the value actually used. | |
| theme | No | Colour theme (default light). | light |
| format | No | png (default), svg, jpeg, pdf (vector) or json (the diagram document). | 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. | |
| padding | No | Margin in diagram units (default 40; 0 for a poster frame or a page). | |
| 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"). | |
| background | No | transparent: no background (PNG, SVG). Default canvas: the theme’s background. | canvas |
| pageNumbers | No | PDF of pages: print page numbers. | |
| 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. |