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:

<base_url>/publish/resources/get
bash

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.

  • 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.
  • Extensions should meet the UX guidelines.
POST <base_url>/publish/resources/get
bash
PropertyTypeRequiredDescription
X-Canva-SignaturesstringYesA comma-separated list of request signatures. The name of this header is sometimes lowercase (e.g. x-canva-signatures).
X-Canva-TimestampstringYesThe UNIX timestamp (in seconds) of when Canva sent the request. The name of this header is sometimes lowercase (e.g. x-canva-timestamp).
PropertyTypeRequiredDescription
userstringYesThe ID of the user.
brandstringYesThe ID of the user's team.
labelstringYesThe type of extension that sent the request.
idstringYesThe ID of the selected container.
preferredThumbnailHeightintegerYesThe recommended height , in pixels of any thumbnails in the response.
preferredThumbnailWidthintegerYesThe recommended width , in pixels of any thumbnails in the response.
{
"preferredThumbnailHeight": 500,
"preferredThumbnailWidth": 500,
"user": "<user>",
"brand": "<brand>",
"label": "<label>",
"id": "<id>"
}
json

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

PropertyTypeRequiredDescription
type"SUCCESS"YesThe type of response.
resourceobjectYes
resource.idstringYesA unique ID for the resource.
resource.namestringYesA human readable name for the resource.
resource.typestringYesThe type of resource. Canva renders "CONTAINER" resources as folders and "IMAGE" resources as files. Enum: "CONTAINER", "IMAGE"
resource.thumbnailThumbnailNoA thumbnail image.
resource.isOwnerbooleanYesA value of true indicates that the user is the owner of the resource.
resource.readOnlybooleanYesA value of true indicates that the user has read-only access to the resource.
{
"resource": {
"isOwner": true,
"readOnly": true,
"id": "<id>",
"name": "<name>",
"type": "<type>"
},
"type": "SUCCESS"
}
json
PropertyTypeRequiredDescription
type"ERROR"YesThe type of response.
errorCodestringYesAn error code that describes what went wrong. Enum: "CONFIGURATION_REQUIRED", "FORBIDDEN", "INTERNAL_ERROR", "INVALID_REQUEST", "NOT_FOUND", "TIMEOUT"
{
"type": "ERROR",
"errorCode": "<error_code>"
}
json

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.

A thumbnail image.

PropertyTypeRequiredDescription
urlstringYesThe URL of the thumbnail. This URL must be HTTPS-enabled and less than 2048 characters.
heightnumberNoThe height of the thumbnail, in pixels. If you provide a height, you must provide a width.
widthnumberNoThe width of the thumbnail, in pixels. If you provide a width, you must provide a height.
{
"url": "<url>"
}
json