Skip to main content

appPublishDocumentTemplate

Requires permission documents:template:update.

An installed app publishes its own document template: created on the first call, a new published revision on the next ones. The template must render against sample data. Needs the write_document_templates scope. It never becomes the default on its own: the organization chooses that.

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 AppPublishDocumentTemplate($input: AppPublishDocumentTemplateInput!) {
appPublishDocumentTemplate(input: $input) {
id
name
createdAt
activeRevisionId
docType
handle
}
}

Variables:

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

Response:

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

Arguments​

appPublishDocumentTemplate.input ● AppPublishDocumentTemplateInput! non-null input​

The template's type, handle, name and source.

Type​

DocumentTemplate object​

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