API reference
Intents
Intents: Asset
Intents: Content
Intents: Design
Intents: Test
Platform: Test

requestApplyPublicTemplate

API reference for the requestApplyPublicTemplate 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.

Trigger the public template selection panel and apply the selected template to the current design. The panel can either display a developer-curated list of template IDs, or a partner's published Marketplace catalogue looked up by profile name.

The selected template's ID is never returned to the app — the host applies the template directly, so use requestApplyPublicTemplate again if the user needs to pick another template.

Usage

Apply a template curated by the app

import { requestApplyPublicTemplate } from "@canva/design";
const response = await requestApplyPublicTemplate({
mode: "template_ids",
templateIds: ["EAF000000000", "EAF000000001"],
});
if (response.status === "completed") {
// Template was successfully applied
}
TYPESCRIPT

Apply a template from a partner's Marketplace catalogue

import { requestApplyPublicTemplate } from "@canva/design";
const response = await requestApplyPublicTemplate({
mode: "query",
query: { profile: "meta" },
});
if (response.status === "completed") {
// Proceed with the flow...
} else {
// Display error message, change the flow, etc.
}
TYPESCRIPT

Parameters

optsRequestPublicTemplateOptions
Required

Options for the RequestPublicTemplate operation.

Options for selecting a public template from a curated list of template IDs.

modestring
Required

The only valid value is "template_ids".

templateIdsstring[]
Required

The list of template IDs curated by the app's owner to be displayed on the overlay panel.

Options for selecting a public template from a partner's published Marketplace catalogue.

modestring
Required

The only valid value is "query".

queryobject
Required
profilestring
Required

The partner profile name (slug) used to retrieve the collection, e.g. "meta".

filterstring
Optional

Additional filter applied to the query, e.g. "Instagram".

Returns

Response object from the RequestPublicTemplate operation. This is a Promise that resolves with the following object:

statusstring

Available values:

  • "completed"
  • "aborted"