template_create
Create reusable signature document templates by uploading files and defining placeholders for signing roles.
Instructions
Create a SignWell template for reusable signature documents.
RECOMMENDED WORKFLOW:
file_store (provide file_path, file_url, or resource_uri) → returns file_token
file_validate_text_tags (pass file_token) → validates tags are extractable
template_create (pass file_token in files array) → creates the template
REQUIRED PARAMETERS (both are mandatory):
files: Array with at least one file object containing:
"name": Filename (e.g., "template.docx")
One content source (in order of preference):
"content_text": Plain text/Markdown to auto-convert to DOCX (RECOMMENDED for generated content)
"file_token": Token from file_store (recommended for uploaded files)
"file_base64": Base64-encoded file content
"file_url": Public URL to the file
"resource_uri": MCP resource URI
placeholders: Array with at least one placeholder object containing "id" and "name"
STEP-BY-STEP EXAMPLE (using file_token):
Call file_store with {"file_path": "/path/to/doc.pdf"} → get file_token
Call file_validate_text_tags with {"file_token": "..."} → confirm tags are valid
Call this tool with: { "name": "My Template", "files": [{"name": "doc.pdf", "file_token": ""}], "placeholders": [{"id": "1", "name": "Signer"}], "text_tags": true }
ALTERNATIVE (inline base64): { "name": "My Template", "files": [{"name": "doc.pdf", "file_base64": "JVBERi0xLjQK..."}], "placeholders": [{"id": "1", "name": "Signer"}], "text_tags": true }
TEXT TAGS (when text_tags: true): Your PDF must contain these literal text strings as SELECTABLE TEXT (not images):
{{signature:1:y}} - Signature field for placeholder id "1"
{{date:1:y}} - Date field for placeholder id "1"
{{text:1:y:Label}} - Text field with label
{{initial:1:y}} - Initials field
The number in the tag (1, 2, etc.) MUST match a placeholder "id" in your request.
CRITICAL: Text tags must be SELECTABLE/SEARCHABLE text in the PDF, not rendered as images or graphics. When generating PDFs programmatically, use text drawing methods (e.g., drawString) with standard fonts. To verify: open the PDF and try to select/copy the tag text with your mouse. If you can't select it, SignWell can't parse it.
MULTI-SIGNER EXAMPLE: { "name": "Contract", "files": [{"name": "contract.pdf", "file_base64": "JVBERi0xLjQK...actual base64 here..."}], "placeholders": [ {"id": "1", "name": "Client"}, {"id": "2", "name": "Vendor"} ], "text_tags": true }
For this example, the PDF should contain: {{signature:1:y}} for Client and {{signature:2:y}} for Vendor.
COMMON ERRORS:
Empty arguments {} = You forgot to include files and placeholders arrays
"fields": [] in response = PDF doesn't contain valid text tags, or text_tags wasn't set to true
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Template name (e.g., 'Permission Slip'). | |
| draft | No | If true, template stays editable. If false, marked Available. Default: false per API. | |
| files | No | REQUIRED. Files to upload. Each needs 'name' plus one of: 'file_url', 'file_base64', or 'resource_uri'. | |
| fields | No | 2D array of fields: one array per file. Required if draft is false. | |
| labels | No | Labels for organizing templates. | |
| message | No | Email message for signature requests (max 4000 chars). | |
| subject | No | Email subject for signature requests. | |
| language | No | Language for template (ISO 639-1). | |
| metadata | No | Key-value metadata (max 50 pairs, key max 40 chars, value max 500 chars). | |
| reminders | No | Send signing reminders on day 3, 6, and 10. | |
| text_tags | No | Set TRUE if PDF contains text tags like {{signature:1:y}}. Placeholder 'id' values must match the signer numbers in tags (e.g., id='1' for {{signature:1:y}}). | |
| expires_in | No | Days before signature request expires (max 365). | |
| placeholders | No | REQUIRED. Signing roles. Each needs 'id' and 'name'. For text tags, the 'id' must match tag IDs (e.g., id='signer1' matches [sig|req|signer1]). | |
| redirect_url | No | URL to redirect after successful signing. | |
| allow_decline | No | Allow recipients to decline signing. | |
| allow_reassign | No | Allow recipients to reassign to someone else. | |
| checkbox_groups | No | Grouped checkbox fields with validation. | |
| api_application_id | No | API Application ID for settings isolation. | |
| apply_signing_order | No | Recipients sign in order. | |
| attachment_requests | No | Attachments recipients must upload. | |
| copied_placeholders | No | Recipients who receive the final document after completion. | |
| decline_redirect_url | No | URL to redirect if document is declined. |