documentTemplate
Requires permission settings:documents:read.
One document template.
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:
- GraphQL
- cURL
query DocumentTemplate($id: ID!) {
documentTemplate(id: $id) {
id
name
createdAt
activeRevisionId
docType
handle
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query DocumentTemplate($id: ID!) {\n documentTemplate(id: $id) {\n id\n name\n createdAt\n activeRevisionId\n docType\n handle\n }\n}",
"variables": {
"id": "id"
}
}
EOF
Variables:
{
"id": "id"
}
Response:
{
"data": {
"documentTemplate": {
"id": "id",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"activeRevisionId": "id",
"docType": "string",
"handle": "string"
}
}
}
documentTemplate(
id: ID!
): DocumentTemplate!
Arguments
documentTemplate.id ● ID! non-null scalar
The template's id.
Type
DocumentTemplate object
A tenant's Liquid template for one document type. Printing uses its published revision.