Template
A Template is a reusable definition of a Legalesign document. It contains roles for each participant and elements (fields) for signatures, text inputs, and other form data. Templates belong to a Group and are used to create Documents.
The link field provides a short-lease URL (expires after 60 seconds) to download the background PDF. Links are only provided when querying a single template, not in list queries.
Fields
| Field | Type | Description |
|---|---|---|
id | ID! | Unique identifier |
title | String! | Title as it appears in emails and the console |
pageCount | Int! | Total number of pages |
pageDimensions | AWSJSON | JSON array of width/height pairs per page |
fileName | String | Background PDF filename |
link | String | Short-lease URL to download the PDF (single query only) |
autoArchive | Boolean | Automatically archive after sending |
valid | Boolean | Whether fields have been confirmed as valid |
locked | Boolean | Whether the template is locked for editing |
fixSignatureScale | Boolean | Scale signatures to 1:3.88 ratio |
tags | [String] | Tags for categorisation |
groupId | ID | The owning group's ID |
canOpenSign | Boolean | Configured for direct link / agent app use |
archived | Boolean | Whether the template is archived |
createdBy | String | User who created the template |
lastSent | AWSDateTime | Last time this template was sent |
created | AWSDateTime | When the template was created |
modified | AWSDateTime | When the template was last modified |
retention | Float | Expiry datetime in epoch seconds |
documentRetentionDays | Int | Days to retain signed documents created from this template |
Relationships
| Field | Type | Description |
|---|---|---|
roles | [Role] | Roles needed to complete this template (signer, witness, approver) |
directLinks | [DirectLink] | Direct signing links for this template |
elementConnection | TemplateElementConnection | Fields, labels, and other elements on the template |
userSignatureConnection | UserSignatureElementConnection | User signature placements |
Query
query GetTemplate($id: ID!) {
template(id: $id) {
id
title
pageCount
valid
locked
link
}
}
Templates are also accessed via Group.templateConnection — see How Pagination Works.
templateConnection Arguments
When querying templates through a group:
| Argument | Type | Default | Description |
|---|---|---|---|
first | Int | — | Number of items to return |
after | ID | — | Cursor for forward pagination |
archived | Boolean | false | Include archived templates |
search | String | null | Search by template title |
status | String | null | Filter by status |
Example
A full template detail query (based on the Legalesign Console app):
query GetTemplateDetails {
template(id: "dHBsYjQ5YTg5NWQtYWRhMy0xMWYwLWIxZGMtMDY5NzZlZmU0MzIx") {
id
title
fileName
pageDimensions
pageCount
link
valid
locked
autoArchive
archived
tags
created
createdBy
lastSent
fixSignatureScale
roles {
id
name
signerIndex
}
elementConnection {
templateElements {
id
elementType
ax
ay
bx
by
page
label
optional
role
signer
validation
value
}
totalCount
}
}
}
Related
- Document — documents created from this template
- Group — the group this template belongs to
- How to Upload a PDF Template — uploading a PDF to a template
- Query Examples — basic template query
- Complex Query Examples — template with nested data
- Mutation Examples — create, update, archive templates
- Document Viewer integration — embed template editing and document sending in your app