API reference
Design
addAudioTrackaddElementAtCursoraddElementAtPointaddPageapplyTemplateautofillDesignbulkCreate.launchcreateRichtextRangeeditContentgetBrandTemplateMetadatagetCurrentPageContextgetCurrentPageMetadatagetDesignColorsgetDesignMetadatagetDesignTemplateMetadatagetDesignTokeninitAppElementopenDesignoverlay.registerOnCanOpenpublish.launchrequestBrandTemplatesrequestDataFieldMatchingrequestExportselection.registerOnChangesetCurrentPageBackgroundui.startDragToCursorui.startDragToPointChangelog
Intents
Intents: Asset
Intents: Content
Intents: data
Intents: design
Platform
appProcessappProcess.broadcastMessageappProcess.currentappProcess.current.getInfoappProcess.current.requestCloseappProcess.current.setOnDisposeappProcess.requestCloseappProcess.registerOnMessageappProcess.registerOnStateChangefeatures.isSupportedfeatures.registerOnSupportChangegetPlatformInfonotification.addToastrequestOpenExternalUrlChangelog
App middleware: Express
Error
applyTemplate
API reference for the applyTemplate method.
This API is a preview. Preview APIs are unstable and may change without warning. You can't release public apps using this API until it's stable.
Apply a template to the current design given a template id.
Usage: Apply a template to the current design
import {applyTemplate,requestBrandTemplates,type BrandTemplateId,} from "@canva/design";const selection = await requestBrandTemplates();if (selection.status === "aborted") return;const templateId = selection.brandTemplates[0]?.token as BrandTemplateId | undefined;if (!templateId) return;const result = await applyTemplate({template: { id: templateId },mode: "overwrite",});if (result.status === "completed") {// Template was successfully applied}
TYPESCRIPT
Parameters
optionsApplyTemplateOptionsRequired
Options for applying a template to a design.
templateobjectRequired
idBrandTemplateIdRequired
A unique identifier that references a brand template.
modestringRequired
The only valid value is "overwrite".
Returns
Response object from the ApplyTemplate operation. This is a Promise that resolves with the following object:
statusstringAvailable values:
"completed""aborted"