Create design autofill job
Starts a new job to autofill a Canva design using a brand template and input data.
To get a list of input data fields, use the Get brand template dataset API.
Available data field types to autofill include:
- Images
- Text
- Charts
You can check the status and get the results of autofill jobs created with this API using the Get design autofill job API.
HTTP method and URL path
https://api.canva.com /rest /v1 /autofills
This operation is rate limited to 10 requests per minute for each user of your integration.
Authentication
This endpoint requires a valid access token that acts on behalf of a user. The token must have the following scopes (permissions):
design:content:write
For more information, see Scopes.
Header parameters
Indicates the media type of the information sent in the request. This must be set to application/json
.
For example: Content-Type: application/json
Body parameters
ID of the input brand template.
Data object containing the data fields and values to autofill.
Properties of data
The data field to autofill.
{"cute_pet_image_of_the_day": {"type": "image","asset_id": "Msd59349ff"},"cute_pet_witty_pet_says": {"type": "text","text": "It was like this when I got here!"},"cute_pet_sales_chart": {"type": "chart","chart_data": {"rows": [{"cells": [{"type": "string","value": "Geographic Region"},{"type": "string","value": "Sales (millions AUD)"},{"type": "string","value": "Target met?"},{"type": "string","value": "Date met"}]},{"cells": [{"type": "string","value": "Asia Pacific"},{"type": "number","value": 10.2},{"type": "boolean","value": true},{"type": "date","value": 1721944387}]},{"cells": [{"type": "string","value": "EMEA"},{"type": "number","value": 13.8},{"type": "boolean","value": false},{"type": "date"}]}]}}}
This can be one of the following:
-
image
: If the data field is an image field. -
text
: If the data field is a text field. -
chart
: If the data field is a chart.
asset_id
of the image to insert into the template element.
Text to insert into the template element.
Tabular data, structured in rows of cells.
- The first row usually contains column headers.
- Each cell must have a data type configured.
- All rows must have the same number of cells.
- Maximum of 100 rows and 20 columns.
Properties of chart_data
Rows of data.
The first row usually contains column headers. Maximum of 100 rows.
Properties of rows
Cells of data in row.
All rows must have the same number of cells. Maximum of 20 cells per row.
Properties of cells
This can be one of the following:
-
string
: A string tabular data cell. -
number
: A number tabular data cell. -
boolean
: A boolean tabular data cell. -
date
: A date tabular data cell.Specified as a Unix timestamp (in seconds since the Unix Epoch).
The value of the cell. The data type of value
depends on the type
of the cell.
- For a
string
type cell, thevalue
is a string. - For a
number
type cell, thevalue
is a number inDouble
format. - For a
boolean
type cell, thevalue
is a boolean value (true
orfalse
). - For a
date
type cell, thevalue
is an integer which is a Unix timestamp (in seconds since the Unix Epoch).
If a value
is not provided, the cell is empty.
Title to use for the autofilled design. Must be less than 256 characters.
If no design title is provided, the autofilled design will have the same title as the brand template.
Example request
Examples for using the /v1/autofills
endpoint:
curl --request POST 'https://api.canva.com/rest/v1/autofills' \--header 'Authorization: Bearer {token}' \--header 'Content-Type: application/json' \--data '{"brand_template_id": "DAFVztcvd9z","title": "string","data": {"cute_pet_image_of_the_day": {"type": "image","asset_id": "Msd59349ff"},"cute_pet_witty_pet_says": {"type": "text","text": "It was like this when I got here!"},"cute_pet_sales_chart": {"type": "chart","chart_data": {"rows": [{"cells": [{"type": "string","value": "Geographic Region"},{"type": "string","value": "Sales (millions AUD)"},{"type": "string","value": "Target met?"},{"type": "string","value": "Date met"}]},{"cells": [{"type": "string","value": "Asia Pacific"},{"type": "number","value": 10.2},{"type": "boolean","value": true},{"type": "date","value": 1721944387}]},{"cells": [{"type": "string","value": "EMEA"},{"type": "number","value": 13.8},{"type": "boolean","value": false},{"type": "date"}]}]}}}}'
Success response
If successful, the endpoint returns a 200
response with a JSON body with the following parameters:
Details about the autofill job.
Properties of job
ID of the asynchronous job that is creating the design using the provided data.
Status of the design autofill job. This can be one of the following:
in_progress
success
failed
Result of the design autofill job. Only present if job status is success
.
Properties of result
This can be one of the following:
create_design
: Design has been created and saved to user's root folder.
Basic details about the design, such as the design's ID, title, and URL.
Properties of design
The design ID.
When the design was created in Canva, as a Unix timestamp (in seconds since the Unix Epoch).
When the design was last updated in Canva, as a Unix timestamp (in seconds since the Unix Epoch).
The design title.
URL of the design.
A thumbnail image representing the object.
Properties of thumbnail
Example responses
In progress job
{"job": {"id": "450a76e7-f96f-43ae-9c37-0e1ce492ac72","status": "in_progress"}}
Successfully completed job
{"job": {"id": "450a76e7-f96f-43ae-9c37-0e1ce492ac72","status": "success","result": {"type": "create_design","design": {"id": "DAFVztcvd9z","title": "My summer holiday","url": "https://www.canva.com/design/DAFVztcvd9z/edit","thumbnail": {"width": 595,"height": 335,"url": "https://document-export.canva.com/Vczz9/zF9vzVtdADc/2/thumbnail/0001.png?<query-string>"}}}}}
Failed job
{"job": {"id": "450a76e7-f96f-43ae-9c37-0e1ce492ac72","status": "failed","error": {"code": "autofill_error","message": "Error autofilling design from brand template"}}}