On September 25th, 2024, we released v2 of the Apps SDK. To learn what’s new and how to upgrade, see Migration FAQ and Migration guide.

requestExport

API reference for the requestExport method.
This version of the API is deprecated. This version will soon be unsupported. You should use a stable version of the API in your app.

Exports the user's design as one or more static files.

To learn more, see Exporting designs.

Usage

import { requestExport } from "@canva/design";
const response = await requestExport({
acceptedFileTypes: ["PNG", "JPG"],
});
if (response.status === "COMPLETED") {
console.log(response); // => { status: "COMPLETED", title: "My design", exportBlobs: [{ url: "https://example.com/image.png" }] }
} else {
console.log("The user exited the export flow.");
console.log(response); // => { status: "ABORTED" }
}
TS

Rate limit

This method has a rate limit of 10 requests every 10 seconds.

Parameters

optionsobject
REQUIRED

The options for configuring the export of a design.

options.acceptedFileTypesarray
REQUIRED

The types of files the user can export their design as.

You must provide at least one file type.

The supported file types include:

  • "GIF"
  • "JPG"
  • "PDF_STANDARD"
  • "PNG"
  • "PPTX"
  • "SVG"
  • "VIDEO"

Returns

A Promise that resolves with the following object:

resultobject
REQUIRED

The result of the successful export of a design.

result.statusstring
REQUIRED

A value that identifies if the export was successful or not.

This property may contain any of the following values:

  • "COMPLETED" - The user successfully exported their design.
  • "ABORTED" - The user closed the export dialog without exporting their design.
result.titlestring
OPTIONAL

The title of the design, if it had been set by the user.

result.exportBlobsarray
REQUIRED

The exported files.

If there are multiple files, they'll be provided in a ZIP file and the array will contain one item. In the future, there'll be an option for each file to be a separate item in the array.

result.exportBlobs[0].urlstring
REQUIRED

The URL of the exported file, such as a ZIP or PNG file.

If the user's design contains multiple pages but is exported in a format that doesn't support multiple pages, the URL will point to a ZIP file that contains each page as a separate file.

The following file types support multiple pages:

  • "GIF"
  • "PDF_STANDARD"
  • "PPTX"
  • "VIDEO"

The following file types do not support multiple pages:

  • "JPG"
  • "PNG"
  • "SVG"

If a user selects the "VIDEO" option, they have the choice of exporting each page as a separate file. In this case, the URL will point to a ZIP file that contains a separate video for each page.