Template Documents
Template documents are the PDF files pre-configured on a template. When an envelope is jumpstarted from the template, these documents are automatically copied into the envelope.
Properties
| Property | Type | Description |
|---|---|---|
id | string | Unique identifier for the document. Required when placing fields on the template. |
name | string | Display name shown to recipients during signing. |
order | number | Display order when multiple documents are present. Zero-based. |
pages | array | One entry per PDF page. The array length gives the total page count. |
context | object | Arbitrary metadata attached to this document. |
info
Template documents do not have a status field — status tracking applies only to documents within active envelopes.
Adding documents to a template
Documents are uploaded individually via a multipart/form-data request.
POST /api/v1/key/templates/{templateId}/documents
Content-Type: multipart/form-data
| Field | Type | Required | Constraints |
|---|---|---|---|
document | file | ✅ | PDF only. Maximum size: 48 MB. |
name | string | — | Max 140 characters. Defaults to the uploaded filename. |
order | number | — | Display position. Starts at 0. |
context | object | — | Arbitrary metadata. |
Response
{
"success": true,
"payload": {
"document": {
"id": "doc_07pq...",
"name": "NDA Template.pdf",
"order": 0,
"pages": [{}, {}, {}],
"context": {}
}
}
}
Save the document.id — you will need it when placing fields on the template.
Differences from envelope documents
| Template document | Envelope document | |
|---|---|---|
| Endpoint | POST /templates/{id}/documents | POST /envelopes/{id}/documents |
| Status field | ❌ Not present | ✅ voided, declined, completed |
| Modifiable after send | N/A — templates are static | ❌ Locked after envelope is sent |
| Copied to envelope | ✅ On jumpstart | — |