POST /publish/resources/get
API reference for the "/publish/resources/get" endpoint.
If a publish extension uses the Flat list or Nested list layout, the user can select a container (folder) before publishing their design. If the user selects a container, Canva sends a POST request to the following endpoint:
1
<base_url>/publish/resources/get
Copied!
Canva sends the request immediately before sending the request to the /publish/resources/upload endpoint.
The purpose of the request is to verify that:
  • The selected container still exists on the destination platform.
  • The user still has access to the selected container.
If the extension can't verify the existence of the container or the permissions of the user, Canva shows an error to the user and doesn't continue the publishing process.

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.

Request

Endpoint

1
POST <base_url>/publish/resources/get
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
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.
id
string
Yes
The ID of the selected container.
preferredThumbnailHeight
integer
Yes
The recommended height , in pixels of any thumbnails in the response.
preferredThumbnailWidth
integer
Yes
The recommended width , in pixels of any thumbnails in the response.

Example

1
{
2
"preferredThumbnailHeight": 500,
3
"preferredThumbnailWidth": 500,
4
"user": "<user>",
5
"brand": "<brand>",
6
"label": "<label>",
7
"id": "<id>"
8
}
Copied!

Responses

200 - Success

The response an extension provides when the selected container still exists on the destination platform.

Properties

Property
Type
Required
Description
type
"SUCCESS"
Yes
The type of response.
resource
object
Yes
resource.id
string
Yes
A unique ID for the resource.
resource.name
string
Yes
A human readable name for the resource.
resource.type
string
Yes
The type of resource. Canva renders "CONTAINER" resources as folders and "IMAGE" resources as files. Enum: "CONTAINER", "IMAGE"
resource.thumbnail
Thumbnail
No
A thumbnail image.
resource.isOwner
boolean
Yes
A value of true indicates that the user is the owner of the resource.
resource.readOnly
boolean
Yes
A value of true indicates that the user has read-only access to the resource.

Example

1
{
2
"resource": {
3
"isOwner": true,
4
"readOnly": true,
5
"id": "<id>",
6
"name": "<name>",
7
"type": "<type>"
8
},
9
"type": "SUCCESS"
10
}
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!
Last modified 1mo ago