Skip to main content

copyBuiltinDocumentTemplate

Requires permission documents:template:update.

Copy the built-in template into a new template (revision 1, not yet published).

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation CopyBuiltinDocumentTemplate($input: CopyBuiltinDocumentTemplateInput!) {
copyBuiltinDocumentTemplate(input: $input) {
id
name
createdAt
activeRevisionId
docType
handle
}
}

Variables:

{
"input": {
"docType": "string",
"handle": "string",
"name": "string"
}
}

Response:

{
"data": {
"copyBuiltinDocumentTemplate": {
"id": "id",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"activeRevisionId": "id",
"docType": "string",
"handle": "string"
}
}
}
copyBuiltinDocumentTemplate(
input: CopyBuiltinDocumentTemplateInput!
): DocumentTemplate!

Arguments​

copyBuiltinDocumentTemplate.input ● CopyBuiltinDocumentTemplateInput! non-null input​

Which built-in to copy, and the new template's handle and name.

Type​

DocumentTemplate object​

A tenant's Liquid template for one document type. Printing uses its published revision.