GET /v1/images/{file_key}

Renders images from a file.

If no error occurs, "images" will be populated with a map from node IDs to URLs of the rendered images, and "status" will be omitted. The image assets will expire after 30 days. Images up to 32 megapixels can be exported. Any images that are larger will be scaled down.

Important: the image map may contain values that are null. This indicates that rendering of that specific node has failed. This may be due to the node id not existing, or other reasons such has the node having no renderable components. It is guaranteed that any node that was requested for rendering will be represented in this map whether or not the render succeeded.

To render multiple images from the same file, use the ids query parameter to specify multiple node ids.

GET /v1/images/:key?ids=1:2,1:3,1:4

Servers

Path parameters

Name Type Required Description
file_key String Yes

File to export images from. This can be a file key or branch key. Use GET /v1/files/:key with the branch_data query param to get the branch key.

Query parameters

Name Type Required Description
svg_outline_text Boolean No

Whether text elements are rendered as outlines (vector paths) or as <text> elements in SVGs.

Rendering text elements as outlines guarantees that the text looks exactly the same in the SVG as it does in the browser/inside Figma.

Exporting as <text> allows text to be selectable inside SVGs and generally makes the SVG easier to read. However, this relies on the browser's rendering engine which can vary between browsers and/or operating systems. As such, visual accuracy is not guaranteed as the result could look different than in Figma.

Default value: true

svg_include_id Boolean No

Whether to include id attributes for all SVG elements. Adds the layer name to the id attribute of an svg element.

Default value: false

format String No

A string enum for the image output format.

Valid values:

  • "pdf"
  • "jpg"
  • "svg"
  • "png"

Default value: "png"

svg_simplify_stroke Boolean No

Whether to simplify inside/outside strokes and use stroke attribute if possible instead of <mask>.

Default value: true

use_absolute_bounds Boolean No

Use the full dimensions of the node regardless of whether or not it is cropped or the space around it is empty. Use this to export text nodes without cropping.

Default value: false

version String No

A specific version ID to get. Omitting this will get the current version of the file.

contents_only Boolean No

Whether content that overlaps the node should be excluded from rendering. Passing false (i.e., rendering overlaps) may increase processing time, since more of the document must be included in rendering.

Default value: true

ids String Yes

A comma separated list of node IDs to render.

scale Number No

A number between 0.01 and 4, the image scaling factor.

svg_include_node_id Boolean No

Whether to include node id attributes for all SVG elements. Adds the node id to a data-node-id attribute of an svg element.

Default value: false

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.