POST /publish/resources/upload
API reference for the "/publish/resources/upload" endpoint.
When a user publishes their design via a publish extension, Canva sends a POST request to the following endpoint:
1
<base_url>/publish/resources/upload
Copied!
The purpose of the request is to upload the user's design to the destination platform.
The body of the request includes an array of assets. If a user publishes their design as a JPG or PNG, each page of the design is a separate asset. If the user publishes their design as a PDF or PPTX, the entire design is a single asset.
Each asset has a URL, which the extension must use to download the asset and upload it to the destination platform.

Notes

  • Extensions must respond to this request within 8 seconds.
  • When sending this request, Canva replaces <base_url> with the extension's Base URL. You can configure the Base URL via the Developer Portal.
  • If a user publishes a design that contains embedded media, such as a YouTube video or Instagram photo, Canva temporarily caches that media. If the user re-publishes their design, any changes to the underlying media (for example, a new thumbnail for a YouTube video) may not be reflected in the published design. The cache duration is approximately 24 hours.

Request

Endpoint

1
POST <base_url>/publish/resources/upload
Copied!

Headers

Property
Type
Required
Description
X-Canva-Signatures
string
Yes
A comma-separated list of request signatures. The name of this header is sometimes lowercase (e.g. x-canva-signatures).
X-Canva-Timestamp
string
Yes
The UNIX timestamp (in seconds) of when Canva sent the request. The name of this header is sometimes lowercase (e.g. x-canva-timestamp).

Body

Properties

Property
Type
Required
Description
message
string
No
A message the user provides before publishing their design. To use this feature, enable Requires custom message via the Developer Portal.
parent
string
No
The ID of the selected container.
user
string
Yes
The ID of the user.
brand
string
Yes
The ID of the user's team.
label
string
Yes
The type of extension that sent the request.
assets
Array<Asset>
Yes
The assets to upload to the destination platform.
designId
string
Yes
The ID of the user's design. This ID does not change if the user republishes their design.

Example

1
{
2
"assets": [],
3
"user": "<user>",
4
"brand": "<brand>",
5
"label": "<label>",
6
"designId": "<design_id>"
7
}
Copied!

Responses

200 - Success

The response an extension provides when it successfully uploads the published assets to the destination platform.

Properties

Property
Type
Required
Description
type
"SUCCESS"
Yes
The type of response.
url
string
No
The URL of a web page where the user can see their published assets on the destination platform.

Example

1
{
2
"type": "SUCCESS"
3
}
Copied!

200 - Error

Properties

Property
Type
Required
Description
type
"ERROR"
Yes
The type of response.
errorCode
string
Yes
An error code that describes what went wrong. Enum: "CONFIGURATION_REQUIRED", "FORBIDDEN", "INTERNAL_ERROR", "INVALID_REQUEST", "NOT_FOUND", "TIMEOUT"

Example

1
{
2
"type": "ERROR",
3
"errorCode": "<error_code>"
4
}
Copied!

401 - Invalid request signature or timestamp

An extension must verify the request signature and timestamp of all incoming requests. When an extension can't verify either of these values, it must reject the request with a 401 status code.

Schemas

Thumbnail

A thumbnail image.

Properties

Property
Type
Required
Description
url
string
Yes
The URL of the thumbnail. This URL must be HTTPS-enabled and less than 2048 characters.
height
number
No
The height of the thumbnail, in pixels. If you provide a height, you must provide a width.
width
number
No
The width of the thumbnail, in pixels. If you provide a width, you must provide a height.

Example

1
{
2
"url": "<url>"
3
}
Copied!

Asset

Properties

Property
Type
Required
Description
name
string
Yes
The file name of the asset (including the file extension).
type
string
Yes
The file type of the asset. Enum: "JPG", "PNG", "PDF", "PPTX"
url
string
Yes
The URL of the asset.

Example

1
{
2
"name": "<name>",
3
"type": "<type>",
4
"url": "<url>"
5
}
Copied!
Last modified 1mo ago