On-demand image endpoint
GET /v1/diagrams/{id}/image — render any saved diagram to PNG or SVG, in light or dark theme, at any time.image_url from a generation
When a
POST /v1/diagrams/generate job reaches status: "succeeded", the resulting Generation carries an image_url rendered with the theme/format you requested.When to use which
Use the image endpoint when…
You already have a diagram
id and want its picture — for example to display an existing diagram, re-theme it (light ↔ dark), or switch format (PNG ↔ SVG). It does not call the AI model and does not count against your generation quota.Use image_url when…
You just generated a brand-new diagram and want the rendered image that matches the
theme/format you asked for, without a second round trip. It is only present once the generation has status: "succeeded".Get an image on demand
diagrams:read scope.
string
required
The UUID of the diagram to render.
string
default:"light"
Color theme of the rendered image. One of
light or dark.string
default:"png"
Image format. One of
png or svg.Request
Response
image
The rendered diagram image (or a link to it), in the requested
theme and format. The response carries the standard X-Request-Id and RateLimit-* headers.The image endpoint never calls the AI model and does not consume your monthly generation quota. It is still subject to the account’s burst limit (120 requests / 60s).
Errors
404 — unknown diagram
404 — unknown diagram
A diagram
id that doesn’t exist (or isn’t visible to your key) returns not_found_error / resource_not_found.400 — invalid theme or format
400 — invalid theme or format
An unsupported
theme or format value returns invalid_request_error / invalid_parameter, with param naming the offending query parameter.400 — SVG too large
400 — SVG too large
An SVG above 4 MB returns
invalid_request_error / svg_too_large, with param set to format. Request the same diagram with format=png, which is always returned at a bounded size.422 — diagram too large to render
422 — diagram too large to render
A diagram beyond the renderable size (more than 3,000 elements or 6,000 connections, an element or canvas far larger than any real process, or more than 200,000 characters of labels) returns
validation_error / validation_failed.403 — missing scope
403 — missing scope
A key without the
diagrams:read scope returns permission_error / insufficient_scope.image_url from a generation
When you create a diagram from natural language with POST /v1/diagrams/generate, the job runs asynchronously. You poll GET /v1/generations/{id} until it finishes. On success, the Generation object includes both the saved diagram and an image_url rendered with the theme and format you requested at generation time.
1
Start the generation
POST /v1/diagrams/generate with your prompt (and optional theme, format, name, folder_id) returns 202 Accepted with status: "queued" and a Location header pointing at the generation.2
Poll until succeeded
GET /v1/generations/{id} until status is succeeded (or failed). Honor the Retry-After hint between polls.3
Read image_url
On success,
image_url is populated alongside the created diagram.string | null
The rendered image for the generated diagram, in the
theme/format requested on the generate call. null until the job reaches status: "succeeded". It is a path relative to the API base (https://justflow.it) — prepend the base to fetch it, e.g. https://justflow.it{image_url}.Embedding the image
Because API keys are server-side only (no CORS, never exposed in a browser), don’t point an<img src> directly at the endpoint with a key attached. Instead, fetch the bytes on your server and serve or store them yourself.
Images are drawn by the same renderer as the Just Flow It editor, so they match what you see in the app. SVG labels are real text set in Inter with a system font fallback; where Inter is not installed, a label may wrap slightly differently than in the PNG.