POST /editing/image/process
API reference for the "/editing/image/process" endpoint.
If an editing extension supports remote image processing, Canva sends a POST request to the following endpoint when the extension calls the remoteProcess method:
1
<base_url>/editing/image/process
Copied!
The purpose of this request is to send the user's image to a server for server-side processing. If the server returns the processed image before the request times out, Canva returns the image to the remoteProcess method. (The current timeout duration is 30 seconds for China and 15 seconds for the rest of the world.)
To handle longer running image processing tasks, the endpoint must initiate polling and implement the /editing/image/process/get endpoint.

Notes

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>/editing/image/process
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.
imageUrl
string
Yes
The URL of the full-resolution version of the user's image.
blobs
Array<Blob>
No
Blobs passed from the JavaScript client to process the user's image.
settings
string
No
Settings passed from the JavaScript client to process the user's image.

Example

1
{
2
"user": "<user>",
3
"brand": "<brand>",
4
"imageUrl": "<image_url>"
5
}
Copied!

Responses

200 - Success (image processing is finished)

The response an extension provides when it can immediately respond with the user's processed image. After receiving this response, Canva doesn't send any further requests. An extension can only provide this response if the image processing task takes less than 15 seconds (or less than 30 seconds if the app is released in China).

Properties

Property
Type
Required
Description
type
"SUCCESS"
Yes
The type of response.
resource
object
Yes
The processed image.
resource.type
string
Yes
The file type of the processed image. Enum: "JPG", "PNG", "SVG"
resource.url
string
Yes
The URL of the processed image.
resource.width
integer
Yes
The width of the processed image , in pixels.
resource.height
integer
Yes
The height of the processed image , in pixels.
resource.blobs
Array<Blob>
No
Any Blobs the client-side code needs to process the user's image. This array is limited to 3 items.
resource.metadata
string
No
Any metadata the client-side code needs to process the user's image.

Example

1
{
2
"resource": {
3
"width": 0,
4
"height": 0,
5
"type": "<type>",
6
"url": "<url>"
7
},
8
"type": "SUCCESS"
9
}
Copied!

200 - Success (image processing is ongoing)

The response an extension provides when it can't respond with the user's processed image in less than 15 seconds (or less than 30 seconds if the app is released in China). After receiving this response, Canva polls /editing/image/process/get until it receives the user's processed image or until the polling times out. The current timeout duration for polling is 60 seconds.

Properties

Property
Type
Required
Description
type
"SUCCESS"
Yes
The type of response.
id
string
Yes
The ID of the image being processed.

Example

1
{
2
"type": "SUCCESS",
3
"id": "<id>"
4
}
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.

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

Blob

Properties

Property
Type
Required
Description
id
string
Yes
A unique ID of the Blob.
type
string
Yes
The file type of the Blob. Enum: "BIN", "JPG", "JSON", "PNG", "SVG"
url
string
Yes
The URL of the Blob.

Example

1
{
2
"id": "<id>",
3
"type": "<type>",
4
"url": "<url>"
5
}
Copied!
Last modified 13d ago