# TemplateDocs Documentation > The easy way to automate business documents. Collect data, generate Word and PDF documents from templates, and deliver the results automatically. This file contains the complete TemplateDocs documentation (https://templatedocs.io/docs) as plain Markdown. Each page starts with its title and URL, followed by its sections. --- # Credits URL: https://templatedocs.io/docs/account/credits Credits are used to measure and bill workflow usage in a simple, predictable way. ## Cost model URL: https://templatedocs.io/docs/account/credits#cost-model Every workflow run follows the same pricing rules: The trigger costs 1 credit - so every workflow run costs at least 1 credit. Most executed steps cost 1 credit each - see the step credit table for details. The first 3 credits after the trigger are included - they are free in every run. This means that most small workflows cost just 1 credit, even if they include a few steps. Workflow run Credits used Trigger only 1 Trigger + 1 step 1 Trigger + 2 steps 1 Trigger + 3 steps 1 Trigger + 4 steps 2 Trigger + 5 steps 3 Trigger + 6 steps 4 And so on... Credits are only charged for steps that actually execute during a run. ## Examples URL: https://templatedocs.io/docs/account/credits#examples Generate a document, send it by email and upload it to Google Drive: Trigger = 1 credit After the trigger = 1 (document generation) + 1 (send email) + 1 (upload to Google Drive) = 3 Included free credits = 3 Final cost = 1 (1 + 3 - 3 = 1) Generate a document, send it by email and send it via HTTP: Trigger = 1 credit After the trigger = 1 (document generation) + 1 (send email) + 1 (HTTP request) = 3 Included free credits = 3 Final cost = 1 (1 + 3 - 3 = 1) Generate 2 documents, send each to a different recipient by email and upload both to Google Drive: Trigger = 1 credit After the trigger = 2 (document generation) + 2 (send email) + 2 (upload to Google Drive) = 6 Included free credits = 3 Final cost = 4 (1 + 6 - 3 = 4) ## Step credit table URL: https://templatedocs.io/docs/account/credits#step-credit-table ## Next Steps URL: https://templatedocs.io/docs/account/credits#next-steps Read the workflow overview to understand how workflows work Learn how to generate and manage workflow documents Explore formulas to generate different documents based on conditions and calculations --- # Email Delivery URL: https://templatedocs.io/docs/account/emails TemplateDocs allows you to automatically email generated documents to recipients, making it easy to distribute documents without manual intervention. You can also brand these emails with your own logo and sender name. ## Email Providers URL: https://templatedocs.io/docs/account/emails#email-providers TemplateDocs offers two ways to send emails: ## System Default URL: https://templatedocs.io/docs/account/emails#system-default No configuration required - works out of the box Basic customization of sender name Built-in protection against spam and abuse Perfect for most users who want reliable email delivery ## Custom SMTP URL: https://templatedocs.io/docs/account/emails#custom-smtp Use your own email server for maximum control Full customization of sender addresses and domains No sending limits for higher volume sending Configure SMTP settings in your organization settings For more details about branding and customization, see the Email Branding section below. ## Delivery Policy URL: https://templatedocs.io/docs/account/emails#delivery-policy When using the System Default provider, TemplateDocs has some guidelines in place to ensure reliable email delivery: Up to 5 recipients per email (including TO, CC, and BCC) Up to 1,000 emails per day per account on paid plans Free accounts can only send to organization members All emails are automatically checked to ensure they don't contain spam or malicious content These limits don't apply when using Custom SMTP, giving you the flexibility to set your own sending policies when doing so. ## Custom SMTP Settings URL: https://templatedocs.io/docs/account/emails#custom-smtp-settings To opt in to use custom SMTP settings, navigate to your organization settings: Then select the SMTP configuration option: Need help finding your SMTP settings? Here are the official guides from popular email providers: Google Workspace SMTP settings Microsoft Outlook.com SMTP settings Amazon SES SMTP credentials SendGrid SMTP configuration Resend SMTP credentials Zoho Mail SMTP settings Each provider has specific server addresses, ports, and authentication requirements. Make sure to enable SMTP authentication and use the correct security settings (usually TLS and port 587, note that TLS may also appear as STARTTLS). ![Organization menu with the Manage option highlighted](https://templatedocs.io/docs/account/emails/manage-organization.png) ![Organization page header with an arrow pointing to the settings button next to Invite Member](https://templatedocs.io/docs/account/emails/organization-settings.png) ![Email Settings panel with the SMTP provider selected and fields for host, port, encryption, username, password and from address](https://templatedocs.io/docs/account/emails/smtp-settings.png) ## Email Branding URL: https://templatedocs.io/docs/account/emails#email-branding Email branding lets you make the emails TemplateDocs sends on your behalf look like they come from your business. Branding is available on paid plans and applies to your whole organization. Branding is applied to all emails sent to your recipients: Workflow Email steps Generated documents delivered by email (for example, via the REST API) Form invitations The settings dialog shows a live preview as you edit. Use Send Test Email to send a sample email to yourself through your configured email provider, so you see exactly what your recipients will get. ![Email branding preview showing a branded sender name, logo and header text, with Send Test Email and Save buttons](https://templatedocs.io/docs/account/emails/email-branding-preview.png) ## Branding Settings URL: https://templatedocs.io/docs/account/emails#branding-settings To configure branding, open your organization settings and under Email Settings --> Branding, click Customize. You can also open the settings from any workflow Email step, using the "email branding" link below the email body input field. Setting Description Enable branding Turns branding on or off without losing your settings. Sender name The name recipients see as the email sender (part of the "From" address). Defaults to your organization name. Logo An image shown in the email header (JPEG, PNG, GIF or BMP). Header text A short title shown at the top of the email, next to your logo. Defaults to your organization name. Show "Powered by" footer Controls whether the "Powered by TemplateDocs" footer is shown. Some settings behave differently depending on the provider you use - the System Default provider or Custom SMTP: The "Powered by TemplateDocs" footer can only be removed when using custom SMTP. Emails sent with the system default provider always include a minimal attribution footer. With the system default provider, emails are sent as "Your Sender Name via TemplateDocs". With custom SMTP, the sender address comes from the "From" address in your SMTP settings and is fully customizable by you. ## Next Steps URL: https://templatedocs.io/docs/account/emails#next-steps Learn how to use email delivery with our REST API Read about our built-in Workflows solution to easily automate your work Understand how to connect TemplateDocs with external automation tools such as Zapier and Make --- # Member Management URL: https://templatedocs.io/docs/account/members Organization Owners and Admins can manage organization members. Managing organization members allows you to control who has access to your organization's templates and resources. This guide covers inviting members, managing roles, and handling member lifecycle. ## Inviting Members URL: https://templatedocs.io/docs/account/members#inviting-members ## Step 1: Access Member Management URL: https://templatedocs.io/docs/account/members#step-1-access-member-management Click the organization switcher button at the bottom of the sidebar Under the Organizations section, click Manage Click the Invite Member button at the top of the page ## Step 2: Fill Invitation Details URL: https://templatedocs.io/docs/account/members#step-2-fill-invitation-details Email Address: The email of the person you want to invite Role: Choose the appropriate role for the new member (you can change this later) ## Step 3: Send Invitation URL: https://templatedocs.io/docs/account/members#step-3-send-invitation Review the invitation details Click "Send Invite" The invitation will be sent via email ## What Happens Next URL: https://templatedocs.io/docs/account/members#what-happens-next Email Sent: The invitee receives an email with invitation details Invitation Link: The email contains a secure link to accept the invitation User Login: The invitee logs in to TemplateDocs and accepts the invitation Acceptance: Once accepted, they become a member of your organization ## Managing Existing Members URL: https://templatedocs.io/docs/account/members#managing-existing-members ## Changing Member Roles URL: https://templatedocs.io/docs/account/members#changing-member-roles Click the organization switcher button at the bottom of the sidebar Under the Organizations section, click Manage Find the member you want to update Click the "Edit" button next to their name and select the new role Confirm the change ## Removing Members URL: https://templatedocs.io/docs/account/members#removing-members Click the organization switcher button at the bottom of the sidebar Under the Organizations section, click Manage Find the member you want to remove Click the "Remove" button next to their name Confirm the removal When you remove a member, they immediately lose access to your organization's templates and resources. This action cannot be undone. ## Next Steps URL: https://templatedocs.io/docs/account/members#next-steps Learn more about roles and permissions Set up API keys for programmatic access --- # Organizations URL: https://templatedocs.io/docs/account/organizations Organizations in TemplateDocs allow teams to collaborate on templates and workflows, share resources, and manage access with role-based permissions. This feature enables multiple users to work together within a single organization while maintaining proper security and access control. ## Key Benefits URL: https://templatedocs.io/docs/account/organizations#key-benefits Team Collaboration: Share resources across your organization Role-Based Access: Control what each team member can do with granular permissions Centralized Billing: Single billing account for the entire organization Organization Statistics: Track usage and performance with detailed analytics ## Organization Boundaries URL: https://templatedocs.io/docs/account/organizations#organization-boundaries Each organization is a separate entity with its own set of workflows, templates, team members, settings, and API keys. When you switch organizations, the following will change: Workflows: You'll see only the workflows belonging to the selected organization Templates: You'll see only the templates belonging to the selected organization Team Members: The team members list will show people from the current organization Settings: Organization-specific settings and configurations API Keys: Any API keys you create will be scoped to the current organization ## Roles & Permissions URL: https://templatedocs.io/docs/account/organizations#roles--permissions TemplateDocs supports four distinct roles within an organization: Role Description Key Permissions Owner Full control of the organization All permissions + billing management Admin Organization management Member management + API keys + statistics + workflow and template management Editor Workflow and template management Create, edit, delete workflows and templates, generate documents and run workflows Member Basic usage View workflows and templates, generate documents and run workflows For detailed information about what each role can do, see the Roles & Permissions documentation. ## Billing URL: https://templatedocs.io/docs/account/organizations#billing Organization billing is managed through the organization owner's personal account, ensuring a single payment method and billing cycle for the entire organization. The owner can view and configure usage quotas and payment details through the settings page, while all team members benefit from the organization's subscription limits. If the owner has multiple organizations, they all share the same subscription quota and billing, meaning usage across all organizations counts toward the owner's single subscription plan. ## Organization Limits URL: https://templatedocs.io/docs/account/organizations#organization-limits ## Per-User Limits URL: https://templatedocs.io/docs/account/organizations#per-user-limits Membership: No limit on organizations you can be a member of Ownership: 10 organizations per user account ## Per-Organization Limits URL: https://templatedocs.io/docs/account/organizations#per-organization-limits Workflows & Templates: No limit on workflows and templates per organization* Workflow Runs & Document Generation: Limited by your subscription plan Members: Limited by your subscription plan API Keys: 10 API keys per organization * Subject to fair-use limits. See our terms of service for details. If you need higher limits, contact support for an increase. ## Next Steps URL: https://templatedocs.io/docs/account/organizations#next-steps Explore member management Learn more about roles and permissions Set up API keys for programmatic access --- # Organization Roles & Permissions URL: https://templatedocs.io/docs/account/roles TemplateDocs uses a role-based access control system to manage what each organization member can do. This ensures proper security while allowing flexible collaboration within your team. ## Role Overview URL: https://templatedocs.io/docs/account/roles#role-overview Organizations support four distinct roles, each with specific permissions: Role Description Key Permissions Owner Full control of the organization All permissions + billing management Admin Organization management Member management + API keys + statistics + template and workflow management Editor Template, document, and workflow management Create, edit, delete templates and workflows + generate documents Member Basic usage View templates and workflows + generate documents ## Detailed Permissions URL: https://templatedocs.io/docs/account/roles#detailed-permissions The following table shows what each role can do: Action Owner Admin Editor Member Document Generation Generate documents Yes Yes Yes Yes Workflow Execution Execute workflows Yes Yes Yes Yes Template Management View templates Yes Yes Yes Yes Create templates Yes Yes Yes No Edit templates Yes Yes Yes No Delete templates Yes Yes Yes No Workflow Management View workflows Yes Yes Yes Yes Create workflows Yes Yes Yes No Edit workflows Yes Yes Yes No Delete workflows Yes Yes Yes No Statistics & Analytics View own statistics Yes Yes Yes Yes View organization statistics Yes Yes No No API Management View API keys Yes Yes No No Manage API keys Yes Yes No No Member Management Invite new members Yes Yes No No Remove members Yes Yes No No Change member roles Yes Yes No No Organization Management Update organization details Yes Yes No No Manage organization billing Yes No No No Delete organization Yes No No No ## Changing Roles URL: https://templatedocs.io/docs/account/roles#changing-roles To change a member's role: Go to the organization settings Navigate to the Members section Find the member you want to update Click the edit button next to their name Select the new role Confirm the change Role changes take effect immediately. The member will see their new permissions the next time they refresh the page. --- # Authentication URL: https://templatedocs.io/docs/api/auth All API requests require authentication using an API key: To create an API key, go to the API Keys page. Then, include the API key in the Authorization header of your requests. You should prefix the API key with Bearer. For example, if your API key is YzA0ODQwNTAtZTI1NC00MDY1, you can use it as follows: curl -X GET https://templatedocs.io/api/v1/templates \ -H "Authorization: Bearer YzA0ODQwNTAtZTI1NC00MDY1" const response = await fetch("https://templatedocs.io/api/v1/templates", { headers: { "Authorization": "Bearer YzA0ODQwNTAtZTI1NC00MDY1" } }) const data = await response.json() console.log(data) import requests response = requests.get("https://templatedocs.io/api/v1/templates", headers={ "Authorization": "Bearer YzA0ODQwNTAtZTI1NC00MDY1" }) print(response.json()) import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; public class Main { public static void main(String[] args) { try { HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://templatedocs.io/api/v1/templates")) .header("Authorization", "Bearer YzA0ODQwNTAtZTI1NC00MDY1") .GET() .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } catch (Exception e) { e.printStackTrace(); } } } using System.Net.Http; using System.Net.Http.Headers; var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YzA0ODQwNTAtZTI1NC00MDY1"); HttpResponseMessage response = await client.GetAsync("https://templatedocs.io/api/v1/templates"); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); ## API Key Scoping and Roles URL: https://templatedocs.io/docs/api/auth#api-key-scoping-and-roles API keys are scoped to organizations and have roles assigned to them to limit their access: Organization Scoping: Each API key belongs to the organization it was created in and can only access resources within that organization Role-Based Access: API keys support three roles (Admin, Editor, Member) with different permission levels Security: This ensures API keys can only perform actions appropriate to their assigned role For detailed information about role permissions, see the Organization Roles & Permissions documentation. --- # API Overview URL: https://templatedocs.io/docs/api/overview The TemplateDocs API enables you to programmatically manage templates and generate documents. This RESTful API uses standard HTTP methods and returns responses in JSON format. ## Service endpoint URL: https://templatedocs.io/docs/api/overview#service-endpoint All API requests should be made to the following base URL: https://templatedocs.io/api ## Authentication URL: https://templatedocs.io/docs/api/overview#authentication For step-by-step authentication instructions, see the authentication documentation page. ## Resources URL: https://templatedocs.io/docs/api/overview#resources ## Templates URL: https://templatedocs.io/docs/api/overview#templates Operation URL Description List Templates GET /v1/templates Retrieve a list of all available templates Get Template GET /v1/templates/{id} Get detailed information about a specific template Download Template GET /v1/templates/{id}/content Download the template file Upload Template POST /v1/templates Upload and create a new template Re-Upload Template PUT /v1/templates/{id}/content Upload a new version of an existing template Update Template Metadata PUT /v1/templates/{id} Update the metadata of a specific template Delete Template DELETE /v1/templates/{id} Remove a specific template Generate Document POST /v1/templates/{id}/generate Create a document using a template and provided data ## Response Format URL: https://templatedocs.io/docs/api/overview#response-format ## Success URL: https://templatedocs.io/docs/api/overview#success Successful responses have a 2xx status code and their body contains the response data. ## Error URL: https://templatedocs.io/docs/api/overview#error Error responses have a 4xx or 5xx status code and return a JSON object with the following structure: { error: { status: number, message: string, details: [] } } Field Type Description error.status number The HTTP status code of the error (e.g. 400, 401, 404, etc) error.message string A human-readable description of what went wrong error.details array Optional. Array containing additional error details. The structure varies by endpoint ## Common Error Codes URL: https://templatedocs.io/docs/api/overview#common-error-codes 400 - Bad request 401 - Invalid or missing API key 402 - Quota exceeded 404 - Resource not found 429 - Rate limit exceeded 500 - Internal server error --- # Delete Template URL: https://templatedocs.io/docs/api/templates/delete The delete template endpoint allows you to permanently delete a specific template. ## Request URL: https://templatedocs.io/docs/api/templates/delete#request DELETE /v1/templates/{template_id} ## Path Parameters URL: https://templatedocs.io/docs/api/templates/delete#path-parameters Parameter Type Description template_id string The unique identifier of the template to delete ## Response URL: https://templatedocs.io/docs/api/templates/delete#response A successful request returns an empty response with a 200 status code. ## Examples URL: https://templatedocs.io/docs/api/templates/delete#examples API_KEY="Your_API_Key" TEMPLATE_ID="template_123" curl -X DELETE https://templatedocs.io/api/v1/templates/$TEMPLATE_ID \ -H "Authorization: Bearer $API_KEY" const apiKey = "Your_API_Key"; const templateId = "template_123"; const response = await fetch(`https://templatedocs.io/api/v1/templates/${templateId}`, { method: 'DELETE', headers: { "Authorization": `Bearer ${apiKey}` } }); import requests api_key = "Your_API_Key" template_id = "template_123" response = requests.delete(f"https://templatedocs.io/api/v1/templates/{template_id}", headers={ "Authorization": f"Bearer {api_key}" }) import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; public class Main { public static void main(String[] args) { try { String apiKey = "Your_API_Key"; String templateId = "template_123"; HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://templatedocs.io/api/v1/templates/" + templateId)) .header("Authorization", "Bearer " + apiKey) .DELETE() .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); } catch (Exception e) { e.printStackTrace(); } } } using System.Net.Http; using System.Net.Http.Headers; string apiKey = "Your_API_Key"; string templateId = "template_123"; var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey); HttpResponseMessage response = await client.DeleteAsync($"https://templatedocs.io/api/v1/templates/{templateId}"); --- # Download Template URL: https://templatedocs.io/docs/api/templates/download The download template endpoint allows you to download the actual template file. ## Request URL: https://templatedocs.io/docs/api/templates/download#request GET /v1/templates/{template_id}/content ## Path Parameters URL: https://templatedocs.io/docs/api/templates/download#path-parameters Parameter Type Description template_id string The unique identifier of the template to download ## Response URL: https://templatedocs.io/docs/api/templates/download#response The response will be the template file in its original format (a Word document) with the appropriate Content-Type header. The response is a binary file stream, not a JSON response. Make sure to handle the response accordingly in your code. ## Examples URL: https://templatedocs.io/docs/api/templates/download#examples API_KEY="Your_API_Key" TEMPLATE_ID="template_123" curl -X GET https://templatedocs.io/api/v1/templates/$TEMPLATE_ID/content \ -H "Authorization: Bearer $API_KEY" \ --output template.docx const apiKey = "Your_API_Key"; const templateId = "template_123"; const response = await fetch(`https://templatedocs.io/api/v1/templates/${templateId}/content`, { headers: { "Authorization": `Bearer ${apiKey}` } }); const blob = await response.blob(); import requests api_key = "Your_API_Key" template_id = "template_123" response = requests.get(f"https://templatedocs.io/api/v1/templates/{template_id}/content", headers={ "Authorization": f"Bearer {api_key}" }) with open("template.docx", "wb") as f: f.write(response.content) import java.io.FileOutputStream; import java.io.InputStream; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; public class Main { public static void main(String[] args) { try { String apiKey = "Your_API_Key"; String templateId = "template_123"; HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://templatedocs.io/api/v1/templates/" + templateId + "/content")) .header("Authorization", "Bearer " + apiKey) .GET() .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofInputStream()); try (FileOutputStream outputStream = new FileOutputStream("template.docx")) { response.body().transferTo(outputStream); } } catch (Exception e) { e.printStackTrace(); } } } using System.Net.Http; using System.Net.Http.Headers; using System.IO; string apiKey = "Your_API_Key"; string templateId = "template_123"; var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey); var response = await client.GetAsync($"https://templatedocs.io/api/v1/templates/{templateId}/content"); byte[] documentBytes = await response.Content.ReadAsByteArrayAsync(); await File.WriteAllBytesAsync("template.docx", documentBytes); --- # Generate Document URL: https://templatedocs.io/docs/api/templates/generate The generate document endpoint allows you to create a document by filling a template with your data. ## Request URL: https://templatedocs.io/docs/api/templates/generate#request POST /v1/templates/{template_id}/generate ## Path Parameters URL: https://templatedocs.io/docs/api/templates/generate#path-parameters Parameter Type Description template_id string The unique identifier of the template to use ## Request Body URL: https://templatedocs.io/docs/api/templates/generate#request-body { "data": object, "output": { "format": "docx" | "pdf", "filename": string, "email": EmailOptions } } ## Request Fields URL: https://templatedocs.io/docs/api/templates/generate#request-fields Field Type Description data object Key-value pairs where keys match template placeholders output object Optional. Output options output.format string Optional. The desired output format: "docx" (default) or "pdf" output.filename string Optional. The desired output filename. If not provided, the filename will be generated based on the template name. output.email EmailOptions Optional. See details below. Each document generation consumes one credit. ## Email Options URL: https://templatedocs.io/docs/api/templates/generate#email-options To send the document via email, use the following object structure: { "output": { "email": { "to": string[], "cc": string[], "bcc": string[], "subject": string, "body": string } } } ## Email Options Fields URL: https://templatedocs.io/docs/api/templates/generate#email-options-fields Field Type Description to string[] Primary recipients cc string[] Optional. CC recipients bcc string[] Optional. BCC recipients subject string Optional. Email subject line to replace the default one body string Optional. Text or HTML email body content to replace the default one Read more about our email delivery options in our email delivery documentation. ## Response URL: https://templatedocs.io/docs/api/templates/generate#response A successful request returns the generated document with the appropriate Content-Type header: application/vnd.openxmlformats-officedocument.wordprocessingml.document for DOCX application/pdf for PDF The response is a binary file stream, not a JSON response. Make sure to handle the response accordingly in your code. ## Examples URL: https://templatedocs.io/docs/api/templates/generate#examples ## Next Steps URL: https://templatedocs.io/docs/api/templates/generate#next-steps Set up your API key to start generating documents Explore different template features: Create tables and lists with loop tags Include conditional content with conditions Insert images, links, QR codes and charts Check out example templates for inspiration --- # Get Template URL: https://templatedocs.io/docs/api/templates/get The get template endpoint allows you to retrieve information about a specific template. ## Request URL: https://templatedocs.io/docs/api/templates/get#request GET /v1/templates/{template_id} ## Path Parameters URL: https://templatedocs.io/docs/api/templates/get#path-parameters Parameter Type Description template_id string The unique identifier of the template to retrieve ## Response URL: https://templatedocs.io/docs/api/templates/get#response { "id": string, "name": string, "createdAt": string, "fileSize": number, "sha256": string, "tags": TagMeta[], } The TagMeta type is defined as follows: { name: string; shape: "standalone" | "container"; children?: TagMeta[]; } ## Response Fields URL: https://templatedocs.io/docs/api/templates/get#response-fields Field Type Description id string Unique identifier of the template name string Name of the template createdAt string ISO 8601 timestamp of when the template was created (e.g. "2024-01-01T12:00:00Z") fileSize number Size of the template file in bytes sha256 string SHA-256 hash of the template file tags array Array of tag objects containing placeholder information ## Examples URL: https://templatedocs.io/docs/api/templates/get#examples API_KEY="Your_API_Key" TEMPLATE_ID="template_123" curl -X GET https://templatedocs.io/api/v1/templates/$TEMPLATE_ID \ -H "Authorization: Bearer $API_KEY" const apiKey = "Your_API_Key"; const templateId = "template_123"; const response = await fetch(`https://templatedocs.io/api/v1/templates/${templateId}`, { headers: { "Authorization": `Bearer ${apiKey}` } }); const template = await response.json(); console.log(template); import requests api_key = "Your_API_Key" template_id = "template_123" response = requests.get(f"https://templatedocs.io/api/v1/templates/{template_id}", headers={ "Authorization": f"Bearer {api_key}" }) template = response.json() print(template) import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; public class Main { public static void main(String[] args) { try { String apiKey = "Your_API_Key"; String templateId = "template_123"; HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://templatedocs.io/api/v1/templates/" + templateId)) .header("Authorization", "Bearer " + apiKey) .GET() .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } catch (Exception e) { e.printStackTrace(); } } } using System.Net.Http; using System.Net.Http.Headers; string apiKey = "Your_API_Key"; string templateId = "template_123"; var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey); HttpResponseMessage response = await client.GetAsync($"https://templatedocs.io/api/v1/templates/{templateId}"); string template = await response.Content.ReadAsStringAsync(); Console.WriteLine(template); --- # List Templates URL: https://templatedocs.io/docs/api/templates/list The list templates endpoint allows you to retrieve a list of all your templates. ## Request URL: https://templatedocs.io/docs/api/templates/list#request GET /v1/templates ## Query Parameters URL: https://templatedocs.io/docs/api/templates/list#query-parameters Parameter Type Description pageIndex number Optional. The 1-based page index to retrieve. Defaults to 1. ## Response URL: https://templatedocs.io/docs/api/templates/list#response { "pageSize": number, "pageIndex": number, "templates": TemplateMetadata[] } See the GET Template endpoint response description for more information on the TemplateMetadata type. ## Response Fields URL: https://templatedocs.io/docs/api/templates/list#response-fields Field Type Description pageSize number The maximum number of templates to return per page. Always 100. pageIndex number 1-based index of the current page templates array Array of template objects ## Examples URL: https://templatedocs.io/docs/api/templates/list#examples API_KEY="Your_API_Key" curl -X GET https://templatedocs.io/api/v1/templates \ -H "Authorization: Bearer $API_KEY" const apiKey = "Your_API_Key"; const response = await fetch("https://templatedocs.io/api/v1/templates", { headers: { "Authorization": `Bearer ${apiKey}` } }); const templates = await response.json(); console.log(templates); import requests api_key = "Your_API_Key" response = requests.get("https://templatedocs.io/api/v1/templates", headers={ "Authorization": f"Bearer {api_key}" }) templates = response.json() print(templates) import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; public class Main { public static void main(String[] args) { try { String apiKey = "Your_API_Key"; HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://templatedocs.io/api/v1/templates")) .header("Authorization", "Bearer " + apiKey) .GET() .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } catch (Exception e) { e.printStackTrace(); } } } using System.Net.Http; using System.Net.Http.Headers; string apiKey = "Your_API_Key"; var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey); HttpResponseMessage response = await client.GetAsync("https://templatedocs.io/api/v1/templates"); string templates = await response.Content.ReadAsStringAsync(); Console.WriteLine(templates); --- # Re-Upload Template URL: https://templatedocs.io/docs/api/templates/re-upload The re-upload template endpoint allows you to upload a new version of an existing template. ## Request URL: https://templatedocs.io/docs/api/templates/re-upload#request PUT /v1/templates/{template_id}/content ## Path Parameters URL: https://templatedocs.io/docs/api/templates/re-upload#path-parameters Parameter Type Description template_id string The unique identifier of the template to update ## Request Body URL: https://templatedocs.io/docs/api/templates/re-upload#request-body The request must be sent as multipart/form-data with the following fields: Field Type Description name string The name of the template file (must end with .docx) file file The Word document template file (max 10MB) The template will be validated for proper tag format and content before being accepted. ## Response URL: https://templatedocs.io/docs/api/templates/re-upload#response On success, the endpoint returns the updated template metadata. See the GET Template endpoint response description for more information on the TemplateMetadata type. ## Examples URL: https://templatedocs.io/docs/api/templates/re-upload#examples API_KEY="Your_API_Key" TEMPLATE_ID="your_template_id" curl -X PUT https://templatedocs.io/api/v1/templates/$TEMPLATE_ID/content \ -H "Authorization: Bearer $API_KEY" \ -F "name=template.docx" \ -F "file=@template.docx" import { readFileSync } from 'fs'; const apiKey = "Your_API_Key"; const templateId = "your_template_id"; const file = readFileSync('template.docx'); const blob = new Blob([file]); const formData = new FormData(); formData.append('name', 'template.docx'); formData.append('file', blob); const response = await fetch(`https://templatedocs.io/api/v1/templates/${templateId}/content`, { method: 'PUT', headers: { "Authorization": `Bearer ${apiKey}` }, body: formData }); import requests api_key = "Your_API_Key" template_id = "your_template_id" response = requests.put( f"https://templatedocs.io/api/v1/templates/{template_id}/content", headers={ "Authorization": f"Bearer {api_key}" }, files={ 'name': (None, 'template.docx'), 'file': ('template.docx', open('/temp/test.docx', 'rb')) } ) import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.file.Files; import java.nio.file.Path; import java.io.ByteArrayOutputStream; import java.io.IOException; import com.google.gson.JsonObject; import com.google.gson.JsonParser; public class Main { public static void main(String[] args) { try { String apiKey = "Your_API_Key"; String templateId = "your_template_id"; byte[] file = Files.readAllBytes(Path.of("template.docx")); String fileName = "template.docx"; // Sending the file as a multipart form data. // See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST#multipart_form_submission String boundary = "----FormBoundary" + System.currentTimeMillis(); ByteArrayOutputStream outputStream = createMultipartFormData(fileName, file, boundary); HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://templatedocs.io/api/v1/templates/" + templateId + "/content")) .header("Authorization", "Bearer " + apiKey) .header("Content-Type", "multipart/form-data; boundary=" + boundary) .PUT(HttpRequest.BodyPublishers.ofByteArray(outputStream.toByteArray())) .build(); client.send(request, HttpResponse.BodyHandlers.ofString()); } catch (Exception e) { e.printStackTrace(); } } private static ByteArrayOutputStream createMultipartFormData(String fileName, byte[] file, String boundary) throws IOException { String formData = "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"name\"\r\n\r\n" + fileName + "\r\n" + "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"file\"; filename=\"" + fileName + "\"\r\n\r\n"; byte[] endBoundaryBytes = ("\r\n--" + boundary + "--\r\n").getBytes(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); outputStream.write(formData.getBytes()); outputStream.write(file); outputStream.write(endBoundaryBytes); return outputStream; } } using System.Net.Http; using System.Net.Http.Headers; using System.Net.Http.Json; using System.Text.Json; string apiKey = "Your_API_Key"; string templateId = "your_template_id"; var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey); using var formData = new MultipartFormDataContent(); using var fileStream = File.OpenRead("template.docx"); var fileName = "template.docx"; formData.Add(new StringContent(fileName), "name"); formData.Add(new StreamContent(fileStream), "file", fileName); var response = await client.PutAsync($"https://templatedocs.io/api/v1/templates/{templateId}/content", formData); ## Error Responses URL: https://templatedocs.io/docs/api/templates/re-upload#error-responses The endpoint returns errors in the standard error format with optional details: { error: { status: number, message: string, details?: { type: "Message", message: string }[] } } ## Example Error Response URL: https://templatedocs.io/docs/api/templates/re-upload#example-error-response { "error": { "status": 400, "message": "Template validation errors", "details": [ { "type": "Message", "message": "Template contains no tags" } ] } } --- # Update Template URL: https://templatedocs.io/docs/api/templates/update The update template endpoint allows you to modify a specific template's metadata. ## Request URL: https://templatedocs.io/docs/api/templates/update#request PATCH /v1/templates/{template_id} ## Path Parameters URL: https://templatedocs.io/docs/api/templates/update#path-parameters Parameter Type Description template_id string The unique identifier of the template to update ## Request Body URL: https://templatedocs.io/docs/api/templates/update#request-body { "name"?: string, "options"?: { "allowGenerationWithWarnings": boolean } } ## Request Fields URL: https://templatedocs.io/docs/api/templates/update#request-fields Field Type Description name string Optional. New name for the template. Must end with ".docx". The name must be unique within your templates. options object Optional. Template options to update. options.allowGenerationWithWarnings boolean Whether to allow document generation even when the template has warnings. You can update the template name, options, or both in a single request. ## Response URL: https://templatedocs.io/docs/api/templates/update#response A successful request returns an empty response with a 200 status code. ## Examples URL: https://templatedocs.io/docs/api/templates/update#examples API_KEY="Your_API_Key" TEMPLATE_ID="template_123" curl -X PATCH https://templatedocs.io/api/v1/templates/$TEMPLATE_ID \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "new-template-name.docx" }' const apiKey = "Your_API_Key"; const templateId = "template_123"; const response = await fetch(`https://templatedocs.io/api/v1/templates/${templateId}`, { method: 'PATCH', headers: { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json" }, body: JSON.stringify({ name: "new-template-name.docx" }) }); import requests api_key = "Your_API_Key" template_id = "template_123" response = requests.patch( f"https://templatedocs.io/api/v1/templates/{template_id}", headers={ "Authorization": f"Bearer {api_key}" }, json={ "name": "new-template-name.docx" } ) import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; public class Main { public static void main(String[] args) { try { String apiKey = "Your_API_Key"; String templateId = "template_123"; String requestBody = "{\"name\": \"new-template-name.docx\"}"; HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://templatedocs.io/api/v1/templates/" + templateId)) .header("Authorization", "Bearer " + apiKey) .header("Content-Type", "application/json") .method("PATCH", HttpRequest.BodyPublishers.ofString(requestBody)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); } catch (Exception e) { e.printStackTrace(); } } } using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Text.Json; string apiKey = "Your_API_Key"; string templateId = "template_123"; var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey); var content = new StringContent( JsonSerializer.Serialize(new { name = "new-template-name.docx" }), Encoding.UTF8, "application/json" ); HttpResponseMessage response = await client.PatchAsync($"https://templatedocs.io/api/v1/templates/{templateId}", content); --- # Upload Template URL: https://templatedocs.io/docs/api/templates/upload The upload template endpoint allows you to upload a Word document template that can be used to generate documents. ## Request URL: https://templatedocs.io/docs/api/templates/upload#request POST /v1/templates ## Request Body URL: https://templatedocs.io/docs/api/templates/upload#request-body The request must be sent as multipart/form-data with the following fields: Field Type Description name string The name of the template file (must end with .docx) file file The Word document template file (max 10MB) Each stored template consumes one template quota unit. ## Response URL: https://templatedocs.io/docs/api/templates/upload#response On success, the endpoint returns the uploaded template metadata. See the GET Template endpoint response description for more information on the TemplateMetadata type. ## Examples URL: https://templatedocs.io/docs/api/templates/upload#examples API_KEY="Your_API_Key" curl -X POST https://templatedocs.io/api/v1/templates \ -H "Authorization: Bearer $API_KEY" \ -F "name=template.docx" \ -F "file=@template.docx" import { readFileSync } from 'fs'; const apiKey = "Your_API_Key"; const file = readFileSync('template.docx'); const blob = new Blob([file]); const formData = new FormData(); formData.append('name', 'template.docx'); formData.append('file', blob); const response = await fetch('https://templatedocs.io/api/v1/templates', { method: 'POST', headers: { "Authorization": `Bearer ${apiKey}` }, body: formData }); const data = await response.json(); console.log('Template ID:', data.id); import requests api_key = "Your_API_Key" response = requests.post( "https://templatedocs.io/api/v1/templates", headers={ "Authorization": f"Bearer {api_key}" }, files={ 'name': (None, 'template.docx'), 'file': ('template.docx', open('/temp/test.docx', 'rb')) } ) data = response.json() print('Template ID:', data['id']) import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.file.Files; import java.nio.file.Path; import java.io.ByteArrayOutputStream; import java.io.IOException; import com.google.gson.JsonObject; import com.google.gson.JsonParser; public class Main { public static void main(String[] args) { try { String apiKey = "Your_API_Key"; byte[] file = Files.readAllBytes(Path.of("template.docx")); String fileName = "template.docx"; // Sending the file as a multipart form data. // See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST#multipart_form_submission String boundary = "----FormBoundary" + System.currentTimeMillis(); ByteArrayOutputStream outputStream = createMultipartFormData(fileName, file, boundary); HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://templatedocs.io/api/v1/templates")) .header("Authorization", "Bearer " + apiKey) .header("Content-Type", "multipart/form-data; boundary=" + boundary) .POST(HttpRequest.BodyPublishers.ofByteArray(outputStream.toByteArray())) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); JsonObject jsonResponse = JsonParser.parseString(response.body()).getAsJsonObject(); System.out.println("Template ID: " + jsonResponse.get("id").getAsString()); } catch (Exception e) { e.printStackTrace(); } } private static ByteArrayOutputStream createMultipartFormData(String fileName, byte[] file, String boundary) throws IOException { String formData = "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"name\"\r\n\r\n" + fileName + "\r\n" + "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"file\"; filename=\"" + fileName + "\"\r\n\r\n"; byte[] endBoundaryBytes = ("\r\n--" + boundary + "--\r\n").getBytes(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); outputStream.write(formData.getBytes()); outputStream.write(file); outputStream.write(endBoundaryBytes); return outputStream; } } using System.Net.Http; using System.Net.Http.Headers; using System.Net.Http.Json; using System.Text.Json; string apiKey = "Your_API_Key"; var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey); using var formData = new MultipartFormDataContent(); using var fileStream = File.OpenRead("template.docx"); var fileName = "template.docx"; formData.Add(new StringContent(fileName), "name"); formData.Add(new StreamContent(fileStream), "file", fileName); var response = await client.PostAsync("https://templatedocs.io/api/v1/templates", formData); var result = await response.Content.ReadFromJsonAsync(); Console.WriteLine($"Template ID: {result.GetProperty("id").GetString()}"); ## Error Responses URL: https://templatedocs.io/docs/api/templates/upload#error-responses The endpoint returns errors in the standard error format with optional details: { error: { status: number, message: string, details?: { type: "Message", message: string }[] } } ## Example Error Response URL: https://templatedocs.io/docs/api/templates/upload#example-error-response { "error": { "status": 400, "message": "Template validation errors", "details": [ { "type": "Message", "message": "Template contains no tags" } ] } } --- # Bulk Generation URL: https://templatedocs.io/docs/bulk-generation Generate many documents at once from a spreadsheet. Upload a CSV file, map its columns to your fields, and TemplateDocs processes one row at a time - no mail-merge sessions, no copy-paste. There are two ways to generate in bulk: Bulk Start a workflow - one workflow run per CSV row, with everything the workflow does: logic, document generation, email delivery, storage, and integrations. Bulk Quick Document - one document per CSV row, straight from a template, downloaded together as a zip file. Video: Generate documents in bulk with CSV files ## Bulk Start a Workflow URL: https://templatedocs.io/docs/bulk-generation#bulk-start-a-workflow Bulk Start runs a workflow once per CSV data row. It works with both form and webhook triggers. You'll find Bulk Start in the workflow's context menu in the Workflows list, and in the menu of the workflow designer. Here's how it works: Upload a CSV file. The first row must contain column headers. A batch can have up to 100 data rows. You can download a ready-made CSV template with one column per field. Map the columns. Columns are matched to fields automatically by name, and you can adjust the mapping manually. A preview shows the first rows exactly as they will be submitted. Review and start. Each row starts its own workflow run. A progress screen tracks the batch live - and you can close it at any time; the runs continue in the background. ## Form-Triggered Workflows URL: https://templatedocs.io/docs/bulk-generation#form-triggered-workflows CSV columns map to the form's fields, and every row is validated with the same rules as a regular form submission. Invalid rows are listed with their errors and skipped - valid rows still run. Note that bulk generation supports flat CSV data only. Since table form fields contain multiple rows, they can't be filled from CSV and won't appear in the mapping. ## Webhook-Triggered Workflows URL: https://templatedocs.io/docs/bulk-generation#webhook-triggered-workflows CSV columns map to the fields of the webhook's detected data structure, including nested fields (shown as dotted paths like customer.name). Rows that do not match the structure still run, with warnings reported in the run history - the same behavior as a regular webhook call. Note that bulk generation supports flat CSV data only. Since array fields can contain multiple values, they can't be filled from CSV and won't appear in the mapping. ## Testing with Drafts URL: https://templatedocs.io/docs/bulk-generation#testing-with-drafts When the workflow is not published yet (or has unpublished changes), Bulk Start runs the current draft. This lets you verify a batch end-to-end before publishing. Keep in mind that these runs still consume credits like any other run. ## Bulk Quick Document URL: https://templatedocs.io/docs/bulk-generation#bulk-quick-document For generating documents without a workflow, use the Bulk button in the template's Quick Document tab. Upload a CSV file with up to 25 data rows, map the columns to your template's tags, and one document is generated per row - downloaded together as a single zip file. Text tags are filled with the cell value as-is. Condition tags accept true/false, yes/no, or 1/0. Limitations: Loop tags cannot be filled from a flat CSV file. For media tags (images, links, QR codes, barcodes), use a workflow with Bulk Start. ## Cancelling Runs URL: https://templatedocs.io/docs/bulk-generation#cancelling-runs Runs can be cancelled while they are in progress: A single run - hover over the run in the workflow's history view and click the cancel button. A whole batch - click Cancel batch on the Bulk Start progress screen to cancel all still-running runs of the batch. When a run is cancelled, steps that are waiting to execute stop immediately, while steps that are already executing finish their work. The run is then marked as Cancelled in the history. ## Credits URL: https://templatedocs.io/docs/bulk-generation#credits Each run in a batch is billed like a regular workflow run, and each Quick Document is billed like a regular document generation. Cancelled runs only consume credits for the steps that actually executed. See Credits for the full cost model. ## Next Steps URL: https://templatedocs.io/docs/bulk-generation#next-steps Learn how to design Forms to collect data Set up Webhooks to trigger workflows from other systems Generate files with Document steps --- # Workflow Forms URL: https://templatedocs.io/docs/forms/overview Forms let you collect data from users and start a workflow when a form is submitted. Build forms using a visual editor, then use the submitted data throughout your workflow to generate documents, apply logic, send emails, and more. ## Designing Forms URL: https://templatedocs.io/docs/forms/overview#designing-forms Forms are created using a drag-and-drop, visual editor. You can: Add text, number, date, and choice fields Add table fields to collect multiple rows of data Reorder fields visually Configure labels, helper text, and validation Preview the form as users will see it No code or technical knowledge is required. ![Visual form designer with a heading, welcome text, an image, text and choice fields, and the dropdown settings panel open](https://templatedocs.io/docs/forms/form_designer_view.png) ## Using Form Data in Workflows URL: https://templatedocs.io/docs/forms/overview#using-form-data-in-workflows A form can start a workflow, or be sent in the middle of a workflow. Either way, the submitted answers are available to every step that follows, and you can use them to: Generate documents from templates Apply conditions and calculations Personalize emails Send data to other systems ## Trigger Forms URL: https://templatedocs.io/docs/forms/overview#trigger-forms A Form Trigger starts a new workflow run each time it's submitted. For example, a form can collect customer and order details, generate an order confirmation document, and email it to the customer automatically. ![Example workflow with a form trigger, a set variables step, a document step, and an email step](https://templatedocs.io/docs/forms/workflow_preview_horizontal.png) ![Example workflow with a form trigger, a set variables step, a document step, and an email step](https://templatedocs.io/docs/forms/workflow_preview_vertical.png) ## Mid-Workflow Forms URL: https://templatedocs.io/docs/forms/overview#mid-workflow-forms A Form Step sends a form in the middle of a workflow - it emails a form link to one or more recipients and pauses the run until the form is submitted, which is useful for approvals, sign-offs, or collecting missing details from a client or a teammate. With a Form Step, you can: Prefill the form with values from earlier steps, so recipients only review or complete what's missing Set how many days recipients have to submit (7 days by default, up to 90) Choose what happens if the form expires: stop the workflow (the default), or continue and handle it in later steps ## Styling Forms URL: https://templatedocs.io/docs/forms/overview#styling-forms Forms are fully customizable: pick a theme, adjust colors and fonts, add your logo and a background image, and remove the TemplateDocs branding - so the form looks like a natural part of your brand. See Styling & Branding for details. ## Sharing and Embedding Forms URL: https://templatedocs.io/docs/forms/overview#sharing-and-embedding-forms Published forms are available at a public URL that anyone can use - no TemplateDocs account needed. You can share the link directly, or embed the form in your own website with a small HTML snippet. See Sharing & Embedding for details. ## Next Steps URL: https://templatedocs.io/docs/forms/overview#next-steps Style forms to match your brand with Styling & Branding Put forms in front of users with Sharing & Embedding Learn how to generate workflow documents Start a workflow for every spreadsheet row with Bulk Generation Explore formulas for calculations and transformations --- # Sharing and Embedding Forms URL: https://templatedocs.io/docs/forms/sharing Published forms can be shared with a public link or embedded directly in your own website. Visitors don't need a TemplateDocs account to fill in and submit a form. ## Sharing Forms URL: https://templatedocs.io/docs/forms/sharing#sharing-forms When a workflow with a form trigger is published, its form becomes available at a public URL that you can share with anyone. The URL is shown when publishing the workflow: https://templatedocs.io/forms/ ## Embedding Forms in Your Website URL: https://templatedocs.io/docs/forms/sharing#embedding-forms-in-your-website Published forms can also be embedded directly in your own website. Copy the embed code from the publish or Share dialog, or use the following snippet with your form's ID:
Embedded forms always show the published version of the form. Publish the workflow again to make new changes live. ## Embed Options URL: https://templatedocs.io/docs/forms/sharing#embed-options The container element accepts the following attributes: Attribute Description data-templatedocs-form The form ID. Required. data-templatedocs-dynamic-height By default, the form resizes to fit its content. Set to false to keep the form at the container's height instead of resizing it to fit the content. data-templatedocs-header Set to true to show the form's name and logo above the fields. Off by default. data-templatedocs-title The accessible name of the embedded frame, announced by screen readers. Defaults to TemplateDocs form. ## Reacting to Submissions URL: https://templatedocs.io/docs/forms/sharing#reacting-to-submissions When a visitor submits an embedded form, a templatedocs:submitted event is emitted on the embedding container element and bubbles up the page. You can use it to show your own confirmation, redirect the visitor, or trigger other actions: document.addEventListener("templatedocs:submitted", (event) => { console.log("Form submitted:", event.detail.formId); }); ## Next Steps URL: https://templatedocs.io/docs/forms/sharing#next-steps Make forms match your brand with Styling & Branding Learn the basics in the Forms overview Learn how to generate workflow documents Start a workflow for every spreadsheet row with Bulk Generation --- # Form Styling and Branding URL: https://templatedocs.io/docs/forms/styling Customize your forms to match your brand. Change colors, fonts, backgrounds, and logos, so every shared or embedded form feels like a natural part of your website. To style a form, open it in the form designer and click Design. Changes are shown live on the form canvas as you make them. ![A product feedback form with teal geometric shapes, its fields sitting directly on the page background](https://templatedocs.io/docs/forms/styling/example_main.png) ![A dark-themed job application form with an abstract navy background and an electric blue button](https://templatedocs.io/docs/forms/styling/example_dark.png) ![A law firm consultation form with a serif font, a photo above the fields, and concentric arc shapes on a warm cream background](https://templatedocs.io/docs/forms/styling/example_consultation.png) ![A conference registration form with modern violet glass shapes and an amber accent line](https://templatedocs.io/docs/forms/styling/example_violet.png) ![Form designer with the Design panel open, showing a form in the default style before any customization](https://templatedocs.io/docs/forms/styling/designer_view.png) ## Themes URL: https://templatedocs.io/docs/forms/styling#themes Themes provide a quick starting point for your form's design. Pick one to instantly apply a coordinated color palette and font, then customize it to match your brand. Selecting a theme resets your color and font overrides, while uploaded images and are kept. ![Clicking through the Sunset, Forest, Midnight, and Ocean themes restyles the whole form instantly](https://templatedocs.io/docs/forms/styling/theme_presets.gif) ## Colors and Fonts URL: https://templatedocs.io/docs/forms/styling#colors-and-fonts Beyond themes, every color used by the form can be customized individually: Background - the page behind the form Header - the area above the form fields Form - the form card itself Button - the submit button and accents Text - labels and content Input - the field backgrounds Most colors support transparency, and setting the Form color to fully transparent removes the card look entirely, so fields sit directly on the page background. You can also choose the form's font from a set of popular web fonts, including Inter, Roboto, Open Sans, Lato, Montserrat, Poppins, Merriweather, and Playfair Display. ![The color picker open on the Button color, with a palette of presets and a More option for custom hex values](https://templatedocs.io/docs/forms/styling/color_picker_custom.png) ![Changing the font on a conference registration form restyles the form text live](https://templatedocs.io/docs/forms/styling/font.gif) ## Logo and Background Image URL: https://templatedocs.io/docs/forms/styling#logo-and-background-image You can upload two images to complete the form's look: Logo - displayed above the form title Background image - displayed behind the form, covering the page Supported formats are JPEG, PNG, GIF, and BMP. Here is a form with a custom logo, background image, colors, and font: ![A fully branded public form with a company logo above the title, a photo inside the form, and a soft background image behind it](https://templatedocs.io/docs/forms/styling/branded_retreat.png) ## Removing TemplateDocs Branding URL: https://templatedocs.io/docs/forms/styling#removing-templatedocs-branding By default, public forms show a small "Powered by TemplateDocs" footer. You can turn it off in the Design panel to make the form fully white-label. Basic styling - themes, colors, and fonts - is available on all plans. Custom images and branding removal require a paid plan. ## Publishing Style Changes URL: https://templatedocs.io/docs/forms/styling#publishing-style-changes Like any form change, style changes are saved to the workflow draft and go live when the workflow is published. Publish the workflow again to update the form your visitors see. ## Next Steps URL: https://templatedocs.io/docs/forms/styling#next-steps Put your styled form in front of users with Sharing & Embedding Learn the basics in the Forms overview Learn how to generate workflow documents --- # Arrays URL: https://templatedocs.io/docs/formulas/arrays Arrays are used to store and manipulate lists of items - for example, a list of contacts, invoice line items, or a list of numbers. ## Filtering with WHERE URL: https://templatedocs.io/docs/formulas/arrays#filtering-with-where Use WHERE to keep only the items you need. Inside the query, names like price and name refer to fields on the current item. Given a list of invoice line items where each row has price, quantity, name, and category: Filter by a value: @lineItems WHERE price > 10 Combine conditions: @lineItems WHERE price > 10 AND quantity > 2 Compare to another variable: @lineItems WHERE price > @minimumPrice ## Picking fields with SELECT URL: https://templatedocs.io/docs/formulas/arrays#picking-fields-with-select By default, the query returns the full matching items. Using SELECT, you can get a specific field from each item. Imagine a contact list where each item has name and status: Select a specific field: @contacts SELECT name Combine with WHERE: @contacts WHERE status = "active" SELECT name If a field does not exist on an item, the result is empty for that item. ## Sorting with ORDER BY URL: https://templatedocs.io/docs/formulas/arrays#sorting-with-order-by Use ORDER BY to sort the results. By default, sorting goes from lowest to highest (ascending order, ASC). Use DESC for highest to lowest (descending order). Given a list of line items with price, quantity, name, and category: Lowest to highest: @lineItems ORDER BY price Highest to lowest: @lineItems ORDER BY price DESC Combine with WHERE: @lineItems WHERE price > 10 ORDER BY price DESC Sort by multiple fields: @lineItems ORDER BY category ASC, price DESC ## Using with functions URL: https://templatedocs.io/docs/formulas/arrays#using-with-functions Given the examples above, array queries work anywhere a formula expects a list. Total of matching prices: SUM(@lineItems WHERE price > 10 SELECT price) First matching contact: FIRST(@contacts WHERE status = "active" ORDER BY name ASC) Last matching contact: LAST(@contacts WHERE status = "active" ORDER BY name ASC) Count matching rows: LEN(@contacts WHERE status = "active") Name from the most expensive line item: GET(FIRST(@lineItems WHERE price > 10 ORDER BY price DESC), "name") ## Referring to the current item URL: https://templatedocs.io/docs/formulas/arrays#referring-to-the-current-item Inside a query, there are a few ways to refer to the item being processed. Imagine the following list of contacts with name, department, and status: ## Direct field names URL: https://templatedocs.io/docs/formulas/arrays#direct-field-names The simplest approach - use the field name directly: @contacts WHERE department = "Sales" SELECT name Field names are case-sensitive (Price and price are different). ## Special @item variable URL: https://templatedocs.io/docs/formulas/arrays#special-item-variable Every query has an automatic special variable called @item that refers to the current item. You can use this variable when you want to refer to the whole item explicitly. For simple lists, like a list of numbers or text values, @item is the value itself. For items with multiple fields, @item works the same as a field name when followed by a dot: @contacts WHERE @item.department = "Sales" SELECT @item.name ## Custom alias with AS URL: https://templatedocs.io/docs/formulas/arrays#custom-alias-with-as You can choose to give each item a short name (alias) to make it easier to read: @contacts AS person WHERE person.status = "active" SELECT person.name ## Related Pages URL: https://templatedocs.io/docs/formulas/arrays#related-pages Formulas overview Array and General functions Math functions --- # Date Functions URL: https://templatedocs.io/docs/formulas/functions/date Date functions accept date and datetime inputs as variables or text literals. Supported formats are date values (YYYY-MM-DD) and datetime values (YYYY-MM-DD HH:mm:ss). Datetime extraction and boundary operations use the workflow timezone. Date-only values are timezone agnostic. Function Description Examples TODAY Current date in the workflow timezone NOW Current date and time in the workflow timezone DATE Create a date from year, month, and day DATE(2026, 7, 12) → 2026-07-12 YEAR Extract year from date or datetime YEAR("2017-11-07") → 2017 MONTH Extract month (1-12) from date or datetime MONTH("1996-02-18") → 2 DAY Extract day of month (1-31) from date or datetime DAY("1985-06-30 14:22:10") → 30 DAY("2024-03-07") → 7 WEEKDAY Weekday number (Sunday = 1, Saturday = 7). Optional second argument controls numbering: "1" - Sunday = 1 (default) "2" - Monday = 1 "3" - Monday = 0 HOUR Extract hour (0-23) from date or datetime HOUR("2019-08-03 14:22:10") → 14 HOUR("1995-12-01") → 0 MINUTE Extract minute (0-59) from date or datetime MINUTE("2003-11-25 07:05:33") → 5 MINUTE("1988-04-12") → 0 SECOND Extract second (0-59) from date or datetime SECOND("1992-01-07 23:58:41") → 41 SECOND("2010-09-30") → 0 QUARTER Extract quarter of year (1-4) from date or datetime QUARTER("2013-02-18") → 1 QUARTER("2013-08-21") → 3 ISOWEEK ISO week number (1-53). Week starts on Monday; week 1 is the week containing January 4. ISOWEEK("2021-01-04") → 1 ISOWEEK("2020-12-31") → 53 DATE_ADD Add a number of units to a date or datetime DATE_ADD("2021-01-15", 30, "days") → 2021-02-14 DATE_ADD("2012-07-10 09:30:00", 2, "hours") → 2012-07-10 11:30:00 DATE_ADD("1999-12-21", 11, "days") → 2000-01-01 Unit options: "days" "weeks" "months" "years" "hours" "minutes" "seconds" DATE_DIFF Difference between two dates in whole units (a - b) DATE_DIFF("2028-02-15", "2028-02-18", "days") → -3 DATE_DIFF("2008-02-18", "2008-02-15", "days") → 3 DATE_DIFF("1990-03-01", "1990-02-18", "days") → 11 Unit options: "days" "weeks" "months" "years" "hours" "minutes" "seconds" START_OF Start of a unit START_OF("2023-07-18", "month") → 2023-07-01 START_OF("2018-11-09 16:45:20", "day") → 2018-11-09 00:00:00 Unit options: "year" "quarter" "month" "day" "hour" "minute" "second" END_OF End of a unit END_OF("2024-04-15", "month") → 2024-04-30 END_OF("1983-11-09 16:45:20", "day") → 1983-11-09 23:59:59 Unit options: "year" "quarter" "month" "day" "hour" "minute" "second" FORMAT_DATE Format date or datetime text using pattern tokens FORMAT_DATE("2019-03-25", "DD/MM/YYYY") → "25/03/2019" FORMAT_DATE("2014-11-07", "YYYY-MM-DD") → "2014-11-07" FORMAT_DATE("2005-03-14 16:05:09", "MM-DD-YY HH:mm:ss") → "03-14-05 16:05:09" FORMAT_DATE("2022-03-14 16:05:09", "M/D/YYYY h:m:s A") → "3/14/2022 4:5:9 PM" FORMAT_DATE("1991-09-01", "DD/MM/YYYY") → "01/09/1991" Supported tokens: YYYY: 4-digit year (e.g. 2026). YY: 2-digit year (e.g. 26). MM: Month with leading zero (01-12). M: Month without leading zero (1-12). DD: Day of month with leading zero (01-31). D: Day of month without leading zero (1-31). HH: 24-hour value with leading zero (00-23). H: 24-hour value without leading zero (0-23). hh: 12-hour value with leading zero (01-12). h: 12-hour value without leading zero (1-12). mm: Minutes with leading zero (00-59). m: Minutes without leading zero (0-59). ss: Seconds with leading zero (00-59). s: Seconds without leading zero (0-59). A: AM/PM marker in uppercase. PARSE_DATE Parse text into a date or datetime value PARSE_DATE("2015-07-04") → 2015-07-04 PARSE_DATE("03/12/1998", "DD/MM/YYYY") → 1998-12-03 PARSE_DATE("2011-06-22 08:15:30", "YYYY-MM-DD HH:mm:ss") → 2011-06-22 08:15:30 PARSE_DATE("2017-09-05 3:07:11 PM", "YYYY-MM-DD h:mm:ss A") → 2017-09-05 15:07:11 Without a pattern, accepts YYYY-MM-DD and ISO-8601 datetime strings. With a pattern, uses the same tokens as FORMAT_DATE. DateTime parsing uses the workflow timezone unless the input or pattern ends with Z. Patterns using h or hh require an A token for AM/PM. ## Related Pages URL: https://templatedocs.io/docs/formulas/functions/date#related-pages Formulas overview Arrays Math functions Text functions General functions --- # General Functions URL: https://templatedocs.io/docs/formulas/functions/general General functions support common checks and utility operations. Function Description Examples IS_EMPTY Check if value is empty IS_EMPTY("") → true IS_EMPTY([]) → true IS_EMPTY({}) → true IS_EMPTY(NULL) → true IS_EMPTY(0) → false IS_EMPTY(" ") → false IS_EMPTY(FALSE) → false LEN Length of text or array LEN("hello") → 5 LEN("") → 0 LEN([1, 2, 3]) → 3 FIRST Returns the first element of an array. Returns null when the array is empty. Accepts array query expressions. FIRST([1, 2, 3]) → 1 FIRST([]) → NULL FIRST(@items WHERE price > 10 ORDER BY price ASC) LAST Returns the last element of an array. Returns null when the array is empty. Accepts array query expressions. LAST([1, 2, 3]) → 3 LAST([]) → NULL LAST(@items ORDER BY createdAt ASC) GET Returns the value at path of an object or array. Use dot notation for nested access. Array indices start at 1. GET({"name": "John"}, "name") -> "John" GET([10, 20, 30], "1") -> 10 GET({"user": {"name": "Jane"}}, "user.name") -> "Jane" TO_BOOLEAN Convert a value to a boolean TO_BOOLEAN("true") → TRUE TO_BOOLEAN("false") → FALSE TO_BOOLEAN(1) → TRUE TO_BOOLEAN(0) → FALSE TO_BOOLEAN("") → FALSE TO_NUMBER Convert a value to a number TO_NUMBER("42") → 42 TO_NUMBER(TRUE) → 1 TO_NUMBER(FALSE) → 0 TO_NUMBER(NULL) → 0 TO_TEXT Convert a value to text TO_TEXT(42) → "42" TO_TEXT(TRUE) → "TRUE" TO_TEXT(NULL) → "" ## Related Pages URL: https://templatedocs.io/docs/formulas/functions/general#related-pages Formulas overview Arrays Math functions Text functions Date functions --- # Math Functions URL: https://templatedocs.io/docs/formulas/functions/math Math functions help you aggregate, compare, and round numeric values. Function Description Examples SUM Sum of the arguments SUM(1, 2, 3) → 6 AVERAGE Average of the arguments AVERAGE(1, 2, 3, 4) → 2.5 COUNT Count numbers COUNT(1, 2, 3) → 3 MAX Maximum value MAX(1, 5, 3) → 5 MAX(-5, -1, -10) → -1 MIN Minimum value MIN(1, 5, 3) → 1 MIN(-5, -1, -10) → -10 ROUND Round to specified decimal places ROUND(3.14159, 2) → 3.14 ROUND(2.5) → 3 ROUND(2.4) → 2 ROUNDUP Round up to specified decimal places ROUNDUP(3.14159, 2) → 3.15 ROUNDUP(2.1) → 3 ROUNDDOWN Round down to specified decimal places ROUNDDOWN(3.14159, 2) → 3.14 ROUNDDOWN(2.9) → 2 ABS Absolute value ABS(-5) → 5 ABS(5) → 5 ## Related Pages URL: https://templatedocs.io/docs/formulas/functions/math#related-pages Formulas overview Arrays Text functions Date functions General functions --- # Text Functions URL: https://templatedocs.io/docs/formulas/functions/text Text functions help you normalize, slice, and inspect strings. The terms text and string are used interchangeably and they both mean the same thing. Function Description Examples UPPER Convert to uppercase UPPER("Hello World") → "HELLO WORLD" LOWER Convert to lowercase LOWER("Hello World") → "hello world" TRIM Remove leading and trailing whitespace TRIM(" hello ") → "hello" LEFT Left substring LEFT("Hello World", 5) → "Hello" LEFT("Test", 10) → "Test" RIGHT Right substring RIGHT("Hello World", 5) → "World" RIGHT("Test", 10) → "Test" MID Middle substring MID("Test", 1, 4) → "Test" MID("Hello World", 7, 5) → "World" PAD_START Pad the start of text until it reaches the specified length. Padding defaults to a space. Text that is already long enough is returned unchanged. PAD_START(42, 5, "0") → "00042" PAD_START("7", 6, "ab") → "ababa7" PAD_END Pad the end of text until it reaches the specified length. Padding defaults to a space. Text that is already long enough is returned unchanged. PAD_END("INV", 6, "-") → "INV---" PAD_END("Hello", 3, "0") → "Hello" CONTAINS Check if string contains text CONTAINS("Hello World", "World") → true CONTAINS("Hello World", "Universe") → false STARTS_WITH Check if string starts with text STARTS_WITH("Hello World", "Hello") → true STARTS_WITH("Hello World", "Universe") → false ENDS_WITH Check if string ends with text ENDS_WITH("Hello World", "World") → true ENDS_WITH("Hello World", "Universe") → false SUBSTITUTE Replace text in string. Replace all instances of the old text with the new text. Optionally, limit the number of replacements to the specified number. SUBSTITUTE("code c", "c", "m") → "mode m" SUBSTITUTE("A B A B", "A", "-", 1) → "- B A B" REPLACE Replace text in string. Starting at the specified position, replace the specified number of characters with the new text. REPLACE("Hello World", 1, 5, "Hi") → "Hi World" JOIN Join array elements into a single text value, separated by the specified separator. Non-text elements are converted to text. JOIN(["a", "b", "c"], ", ") → "a, b, c" JOIN([1, 2, 3], "-") → "1-2-3" ## Related Pages URL: https://templatedocs.io/docs/formulas/functions/text#related-pages Formulas overview Arrays Math functions Date functions General functions --- # Formulas URL: https://templatedocs.io/docs/formulas/overview Formulas let you calculate values, transform data, and make decisions in your workflows. They combine form data, variables, and built-in functions to create dynamic content that adapts to each workflow run. Formulas can be used anywhere you need computed values - in document tag mapping, email content, HTTP request bodies, and conditional logic. ## Using Formulas URL: https://templatedocs.io/docs/formulas/overview#using-formulas Formulas are entered using a formula editor that provides autocomplete and validation. Type @ to insert variables, or start typing a function name to see available options. Formulas can be used in: Document tag mapping - Calculate values to populate document templates Conditional logic - Evaluate conditions in split and condition nodes Email content - Create dynamic subject lines and body text HTTP requests - Build request URLs, headers, and body content And more... ![Variable picker opened by typing @ in a text field, with Insert Formula at the top and the workflow variables below](https://templatedocs.io/docs/formulas/formula_dropdown.png) ## Expression Types URL: https://templatedocs.io/docs/formulas/overview#expression-types ## Math Operations URL: https://templatedocs.io/docs/formulas/overview#math-operations Formulas support standard mathematical operations: Basic arithmetic: @price * 1.1 Grouping: (@quantity * @price) - @discount Functions: SUM(1, 2, 3), AVERAGE(@math_score, @english_score), ROUND(@total, 2) See all Math functions. ## Text Operations URL: https://templatedocs.io/docs/formulas/overview#text-operations Transform and combine text values: Concatenation: "Hello " + @firstName + " " + @lastName Functions: UPPER(@name), TRIM(@address), STARTS_WITH(@text, "start") See all Text functions. ## Date Expressions URL: https://templatedocs.io/docs/formulas/overview#date-expressions Compare, manipulate, and format date values: Comparison: IF @dueDate >= "2026-01-01" THEN "Current Year" ELSE "Previous Year" Functions: DATE_ADD(@startDate, 30, "days"), DATE_DIFF(@submittedAt, "2026-01-01", "days") Formatting: FORMAT_DATE(@endTime, "DD/MM/YYYY") See all Date functions. ## Conditional Logic URL: https://templatedocs.io/docs/formulas/overview#conditional-logic Use IF-THEN-ELSE expressions along with comparison and logical operators such as =, !=, >, <, AND, OR, and NOT to create dynamic values based on conditions: Simple condition: IF @age >= 18 THEN "Adult" ELSE "Minor" Complex logic: IF (@status = "urgent" AND @priority > 5) THEN "High" ELSE "Normal" Nested conditions: IF @score > 90 THEN "A" ELSE IF @score > 80 THEN "B" ELSE "C" ## Arrays URL: https://templatedocs.io/docs/formulas/overview#arrays Work with lists of values - filter, pick specific fields, or sort the results: Filter list items: @items WHERE price > 10 Select a specific field: @items SELECT quantity Sort results: @items ORDER BY price DESC Add up values: SUM(@items WHERE price > 10 SELECT price * quantity) See the full Arrays reference. ## Function Reference URL: https://templatedocs.io/docs/formulas/overview#function-reference Built-in functions are organized by category: Arrays General functions Math functions Text functions Date functions ## Next Steps URL: https://templatedocs.io/docs/formulas/overview#next-steps Understand how workflows work and how to create them Learn how to create Forms to collect data from users Read more about Documents and Templates --- # Generate documents in bulk URL: https://templatedocs.io/docs/guides/bulk-generation Upload a CSV file and generate one document, or one workflow run, per row. Need a certificate for every attendee, a letter for every employee or an invoice for every customer? Put the data in a spreadsheet, export it as a CSV file, and let TemplateDocs process one row at a time. There are two ways to do it: Generate in bulk from Quick Document - one document per row, straight from a template, downloaded together as a zip file. Best for a quick batch you'll handle yourself. Bulk Start a workflow - one workflow run per row, with everything the workflow does: logic, document generation, email delivery, storage and integrations. Best when each document needs to go somewhere. ## Prepare the CSV file URL: https://templatedocs.io/docs/guides/bulk-generation#prepare-the-csv-file Whichever way you choose, the CSV file looks the same: The first row contains the column headers. Every following row is one document (or one workflow run). For Quick Document, name columns after the template tags. For a workflow, use the form field labels or webhook body-field paths. Matching names are connected automatically. Both bulk dialogs offer a ready-made CSV template with one column per supported tag or mappable field. Download it, fill it in with your spreadsheet application, and export it as CSV. ## Generate in bulk from Quick Document URL: https://templatedocs.io/docs/guides/bulk-generation#generate-in-bulk-from-quick-document Open the template page and switch to the Quick Document tab. Choose DOCX or PDF, then click Bulk... Upload your CSV file. Map the columns to the template's tags. Columns with the same name as a tag are matched automatically. Check the preview lines, then click Generate N Documents. One document is generated per row, and all of them are downloaded as a single zip file. Keep the browser tab open until generation finishes. Closing it early stops the batch. When the batch completes, the zip file downloads automatically. Text tags are filled with the cell value as-is. Condition tags accept true/false, yes/no or 1/0. Loop tags and media tags (images, links, QR codes, barcodes) can't be filled from a flat CSV file - use a workflow for those. ![Bulk Generate Documents dialog with CSV columns mapped to template tags and a two-row preview](https://templatedocs.io/docs/guides/bulk-generation/quick-document-mapping-v1.png) ## Bulk Start a workflow URL: https://templatedocs.io/docs/guides/bulk-generation#bulk-start-a-workflow Open the Workflows page and choose Bulk Start (or Bulk Test if the workflow is not published yet) from the workflow's context menu. It is also available from the menu of the workflow designer. Upload your CSV file. Map the columns to the form fields, or to the webhook's data fields if the workflow is triggered by a webhook. A preview shows the first rows as they will be submitted. Click Continue, review any validation results, then click Start N runs. Each accepted row starts its own workflow run. A progress screen tracks the batch live. You can close it at any time - the runs continue in the background. The batch can be stopped and the remaining runs can be cancelled through the Cancel batch button or via the workflow's Run History page. ![Workflow context menu with the Bulk Test action](https://templatedocs.io/docs/guides/bulk-generation/workflow-menu-v1.png) ![Bulk Start Workflow dialog with CSV columns mapped to form fields and a two-row preview](https://templatedocs.io/docs/guides/bulk-generation/workflow-mapping-v1.png) ## Find workflow results URL: https://templatedocs.io/docs/guides/bulk-generation#find-workflow-results Open the workflow's Run History after starting the batch. Use Runs to inspect each execution, Submissions to review its input data, and Documents to preview or download the generated files. ## Credits URL: https://templatedocs.io/docs/guides/bulk-generation#credits Each workflow run in a batch is billed like a regular run, and each Quick Document like a regular document generation. See Credits for the details. ## Limits URL: https://templatedocs.io/docs/guides/bulk-generation#limits Quick Document: up to 25 data rows in a single batch. Workflow: up to 100 data rows in a single batch. ## Next Steps URL: https://templatedocs.io/docs/guides/bulk-generation#next-steps Automate document delivery with your first workflow. Learn how to create a template. Send data from another app using webhook triggers. --- # Create a template with AI URL: https://templatedocs.io/docs/guides/create-template-with-ai Turn an existing document into a template, or describe the document you need and let AI draft it. Adding tags by hand works well for short documents, but for a long contract or a report with dozens of fields it takes time. Create with AI does the work for you in one of two ways: Start from a document - upload an existing Word document to trun it into a reusable template. The AI replaces the variable parts, such as names, dates, amounts and addresses, with tags. Create from scratch - explain in plain language what the document should contain and AI drafts a complete template, tags included. Open the Templates page to begin. If your library is empty, click Create with AI. Otherwise, click New Template then choose Create with AI. ## Start from an existing document URL: https://templatedocs.io/docs/guides/create-template-with-ai#start-from-an-existing-document Keep Start from a document selected. Drop a .docx file into the dialog, or click to choose one. Optionally, add guidance in the text box. For example: "Only the client details and the payment terms should change. Keep the company details fixed." Click Create with AI. AI reads the document, decides which parts should become tags and creates the template. The original layout and formatting are kept. Without guidance, AI makes its own call about what is variable. If it tags too much or too little, add a sentence of guidance and try again, or fix the result in the editor. ![Create with AI dialog with Start from a document selected, a Word document upload area and optional instructions](https://templatedocs.io/docs/guides/create-template-with-ai/start-from-document-v1.png) ## Create from scratch URL: https://templatedocs.io/docs/guides/create-template-with-ai#create-from-scratch Select Create from scratch. Describe the document in a few sentences: what it is, which sections it has, and which information changes for every document. For example: "A one-page quote for landscaping services with our company header, the client's name and address, a table of line items with quantity and price, a total, and a validity date." Click Create with AI. AI drafts the whole document - text, structure and tags - so you get a starting point you can refine instead of a blank page. ![Create with AI dialog with Create from scratch selected and a field for describing the document](https://templatedocs.io/docs/guides/create-template-with-ai/create-from-scratch-v1.png) ## Review the result URL: https://templatedocs.io/docs/guides/create-template-with-ai#review-the-result The new template opens like any other template. Take a moment to: Check that the expected fields are present, their names make sense, and the document looks right. If anything needs attention, open the Edit tab to rename, add or remove tags. If you prefer to edit the template back in Word, choose Template Actions > Download, then Re-upload it from the same menu when you're done. When you are happy with the template, generate a test document from the Quick Document tab to see the result. ## Next Steps URL: https://templatedocs.io/docs/guides/create-template-with-ai#next-steps Learn how to refine and edit your template. Explore additional template features like loops, links, QR codes and images. Automate document generation with your first workflow. --- # Create your first document URL: https://templatedocs.io/docs/guides/create-template Learn the basics of TemplateDocs by creating your first document. A template is a regular Microsoft Word document (.docx) in which the parts that change from one document to the next are marked with tags - placeholders written in double curly braces, like {{ CustomerName }}. When you generate a document, every tag is replaced with the value you provide. This guide takes you from a Word document template to your first generated document in four steps. ## 1. Prepare your Word document URL: https://templatedocs.io/docs/guides/create-template#1-prepare-your-word-document Open the document you want to automate in Word and replace each piece of variable content with a tag. Keep the rest of the document as it is - the formatting, images, tables and styles are preserved when documents are generated. For example, a simple order confirmation may contain: {{ Name }} - the name of the customer {{ CompanyName }} - the name of their company {{ Total }} - the order total {{ CompanyWebsite }} - your website address The downloadable example also uses an Items loop for the rows of the order table. You can start with standard tags and add loops when you need repeating content. A few rules for tag names: Tags are surrounded by double curly braces: {{ and }}. Tag names must start with an English letter and can contain English letters, numbers and underscores. No spaces or dashes. Tag names are case-sensitive: {{ Name }} and {{ name }} are two different tags. Spaces before or after the tag name are ignored. So {{ Name }} and {{Name}} are the same tag. Don't have a document handy? Download our order confirmation example and use it to follow along. ## 2. Upload the template URL: https://templatedocs.io/docs/guides/create-template#2-upload-the-template Sign in to TemplateDocs and open the Templates page. If this is your first template, click Upload Template. If your library already contains templates, click New Template and choose Upload Templates. Choose your .docx file. TemplateDocs scans the uploaded file for tags and checks for common problems. If it finds an issue, the upload summary explains it and offers the relevant next steps, such as reviewing suggested fixes, editing online or re-uploading a corrected file. Prefer to start from nothing? Click Blank Template to create an empty template and add content in the online editor instead. ![Templates page with the New Template menu open, showing Upload Templates, Create with AI and Blank Template](https://templatedocs.io/docs/guides/create-template/new-template-menu-v1.png) ## 3. Review the template URL: https://templatedocs.io/docs/guides/create-template#3-review-the-template After a clean upload, the template opens in the Quick Document editor. The input panel is built from the tags TemplateDocs detected, and the refreshable preview shows where their values will appear. Check that the expected fields are present and that the preview still looks right. If you wish to make changes, open the Edit tab to edit the template in your browser. See Edit a template for a walkthrough and more options. ![Quick Document with detected template fields on the left and a live order confirmation preview on the right](https://templatedocs.io/docs/guides/create-template/quick-document-v1.png) ## 4. Generate your first document URL: https://templatedocs.io/docs/guides/create-template#4-generate-your-first-document You are now ready to try the template: Fill in a value for each tag, or click Auto-fill to create sample values for you. Optionally, click the Preview button to see how the document will look with the values you filled in. Choose the output format - DOCX or PDF. Click Generate. The finished document is downloaded to your computer. That's it - you have generated your first document. Every document you generate from now on uses the same template, so the layout stays consistent while the content changes. ## Next Steps URL: https://templatedocs.io/docs/guides/create-template#next-steps Learn how to convert an existing document to a template using AI. Customize and edit your template. Automate document generation with your first workflow. Repeat content, like table rows or list items, with loop tags. --- # Build your first workflow URL: https://templatedocs.io/docs/guides/create-workflow Collect data with a form, generate a document and deliver it automatically. A workflow is a series of steps that run automatically when something happens, such as a client submitting a form. Instead of collecting data by email and filling in documents by hand, the workflow collects the data, generates the documents and delivers them - the same way, every time. In this guide you'll build one of the most common workflows - a form that generates a document and sends it by email. You will need a template before you begin. If you do not have one yet, you can download our workshop confirmation template which we use in this guide. Alternatively, you can follow the steps in our guide to Create your first template or Create a template with AI. ## 1. Create the workflow URL: https://templatedocs.io/docs/guides/create-workflow#1-create-the-workflow Open the Workflows page and click New Workflow. Give the workflow a name, for example "Workshop Registration", and confirm. The workflow designer opens with a trigger picker. A trigger is what starts the workflow, followed by the steps that run afterwards. Not sure where to start? The Workflows page also offers sample workflows, such as an employee welcome letter, a lease agreement and an invoice. Pick one and adjust it instead of starting from scratch. ![Workflows page with the Create Workflow dialog open](https://templatedocs.io/docs/guides/create-workflow/create-workflow-dialog.png) ## 2. Set up the form trigger URL: https://templatedocs.io/docs/guides/create-workflow#2-set-up-the-form-trigger A form is the easiest way to collect the data your document needs: Select the form trigger and open the form designer. Add a field for every piece of information you need - text, numbers, dates, choices, and so on. Each input creates a workflow variable you can use in later steps. Configure labels, required fields and validation. Click the Design button to adjust the form's look and feel if you like. Click Preview to check the form as a respondent will see it. When you are done, return to the workflow. Workflows can also be triggered by a webhook from another system, which is useful when the data already lives in a CRM or a spreadsheet. ![Form designer with form elements, intake fields and design controls](https://templatedocs.io/docs/guides/create-workflow/form-designer.png) ## 3. Generate a document URL: https://templatedocs.io/docs/guides/create-workflow#3-generate-a-document Add a Document step after the trigger. Choose the template to use. Adjust the generated document's name if needed, then choose the output format (PDF or DOCX). Edit the Document Tag Mapping, they control how values are inserted into the document template. You can drag-and-drop form values and workflow variables onto the mapping fields, type them manually or use the variable picker. You can also click the Get suggestions button to let TemplateDocs suggest mappings for you. Values don't have to come straight from the form. Formulas let you calculate totals, format dates or combine fields before they land in the document. ![Document Mapping dialog with workflow variables mapped to the template's Date, ClientName, Company and Service tags](https://templatedocs.io/docs/guides/create-workflow/document-mapping.png) ## 4. Deliver the document URL: https://templatedocs.io/docs/guides/create-workflow#4-deliver-the-document Add an Email step after the Document step: Enter a fixed recipient, such as your sales inbox, or a value from the form, such as the client's email. Write the subject and message. Type @ in the recipient, subject or message fields to insert values from the form or earlier workflow steps. Click Add Attachment and select the file created by the Document step. The built-in email provider works without additional setup. See Email Delivery for provider options and limits. Documents can also be saved to cloud storage, sent to other tools through integrations, or returned to your own systems - see the full list of steps here. ## 5. Test and publish URL: https://templatedocs.io/docs/guides/create-workflow#5-test-and-publish Changes in the workflow designer are saved automatically as a draft. Before publishing, test your workflow to make sure everything works as expected: Click Test in the top bar. Enter sample form values, or choose Auto-fill with AI, and submit the form. Note: Test runs consume credits like any other run. Confirm that the run succeeds, the document looks right, the email arrives, and the run appears in Run History. When everything looks good, click Publish. Your form is now live, and you'll get a link to share it with others, and an embed snippet to add it to your website if you want. Every run is recorded in the workflow's Run History, where you can see which steps executed, how long they took, and additional details about the run. Changes you make after publishing are saved as a draft and don't affect the live form until you publish again. ## Next Steps URL: https://templatedocs.io/docs/guides/create-workflow#next-steps Learn how to create a template. Send data from another app using webhook triggers. See how to generate documents in bulk with CSV files. --- # Edit a template URL: https://templatedocs.io/docs/guides/edit-template Customize your template's content, layout and style using Word or our online editor. As your template evolves, you can update it in whichever way works best for you. Make changes directly in the online editor, or edit the document in Word and upload the updated version - whether you're renaming tags, adding placeholders, making sections conditional, or changing the document itself. ## Using the online editor URL: https://templatedocs.io/docs/guides/edit-template#using-the-online-editor Open the Templates page and click the template you want to change. Switch to the Edit tab. The document opens in an online Word editor. You can edit text and formatting directly, just like in Word. ![Template editor with Insert tag controls, an editable document and the detected tag list](https://templatedocs.io/docs/guides/edit-template/template-editor.png) ## Insert a tag URL: https://templatedocs.io/docs/guides/edit-template#insert-a-tag Tags can be typed by hand, but the Insert tag bar at the top of the editor is an convenient way to insert tags quickly. Place the cursor where the tag should go. Choose the tag type: Standard - replaced with a single value, such as {{CustomerName}}. Loop - repeats the content between {{ >> Items }} and {{ << }} once per item. Use it for table rows and lists. Condition - shows the content between the opening and closing tags only when the value is true. Type the tag name and click Insert (or press Enter). For a loop or condition, the editor inserts an opening and closing marker with placeholder content between them. Replace that content with what should repeat or appear. A loop normally contains standard tags for the values on each item. For example, an Items loop may contain {{Name}} and {{Price}}. If the name is not valid, the editor tells you what to fix. Valid names start with an English letter and contain only English letters, numbers and underscores - for example TagName, tag_name or Tag_Name. ![Insert tag bar with Standard, Loop and Condition options](https://templatedocs.io/docs/guides/edit-template/insert-tag.png) ## Rename or remove a tag URL: https://templatedocs.io/docs/guides/edit-template#rename-or-remove-a-tag Select the tag text in the document and edit it like any other text. A tag is just text in double curly braces, so renaming {{Name}} to {{FullName}} is a matter of typing. Make sure to keep both the opening {{ and the closing }}. ## Save your changes URL: https://templatedocs.io/docs/guides/edit-template#save-your-changes The editor tracks unsaved changes. Click Save to store the new version of the template, or Cancel to discard the edits and return to the last saved version. After saving, the tag list on the Overview tab updates and the new tags appear in the Quick Document form and in your workflows. If a workflow uses this template, check its document step after adding or renaming tags - new tags need a value, and renamed tags need to be mapped again. ## Editing in Word URL: https://templatedocs.io/docs/guides/edit-template#editing-in-word If you prefer to work in Word, you can download the template, make your changes, and re-upload it when you're done: In the template page, choose Template Actions > Download. Make your changes in Word. Choose Template Actions > Re-upload and select the updated file. Re-uploading replaces the file without creating a new template, so workflows and API integrations continue to reference it. If you added or renamed tags, update the workflow mappings or API input data that supplies their values. ![Template Actions menu showing Download and Re-upload options](https://templatedocs.io/docs/guides/edit-template/template-actions.png) ## Test your changes URL: https://templatedocs.io/docs/guides/edit-template#test-your-changes Open the Quick Document tab, enter tag values or click Auto-fill. Click the Preview button to see a preview directly in the browser. Click the Generate button to create and download a full document. Review the finished document to make sure everything looks the way you want. ## Next Steps URL: https://templatedocs.io/docs/guides/edit-template#next-steps Learn how to convert an existing document to a template using AI. Explore additional template features like loops, links, QR codes and images. Automate document generation with your first workflow. --- # Getting Started Guides URL: https://templatedocs.io/docs/guides Short videos and walkthroughs to get you up and running in no time. --- # Trigger a workflow with a webhook URL: https://templatedocs.io/docs/guides/use-webhooks Send data from another app to generate personalized documents and deliver them automatically. When the data you need already lives in another app, a webhook saves you from entering it again. That app sends the data to a unique URL in TemplateDocs, and your workflow takes it from there. In this guide, we'll receive client details, generate a bookkeeping confirmation and email it to the client. The video uses Make to send the data, but any app or code that can send an HTTP request can do the same. You will need a template before you begin. If you do not have one yet, you can download our service confirmation template which we use in this guide. It includes client and service details, plus an optional payroll section controlled by a condition. Alternatively, you can follow the steps in our guide to Create your first template or use AI to Convert an existing document. ## 1. Create a webhook-triggered workflow URL: https://templatedocs.io/docs/guides/use-webhooks#1-create-a-webhook-triggered-workflow Open Workflows, then choose New Workflow > Create Workflow. Give it a name, such as "Bookkeeping Confirmation", and click Create. Click Choose a trigger and select Webhook. In the trigger settings, click Start Listening and copy the Webhook URL. Keep TemplateDocs open while you send the sample in the next step. You don't need to publish this new workflow to capture sample data. The video leaves Require API Key off for simplicity. Without it, anyone who has the URL can run your published workflow, so keep the URL private. For additional protection, enable Require API Key and send an organization API key in the Authorization header as Bearer . See API Authentication for setup instructions. ![Webhook settings listening for sample data, with the private webhook URL blurred](https://templatedocs.io/docs/guides/use-webhooks/webhook-listening-v1.png) ## 2. Send a sample from your other app URL: https://templatedocs.io/docs/guides/use-webhooks#2-send-a-sample-from-your-other-app In Make, add an HTTP module and choose Make a request. Configure it as follows: Setting Value URL The webhook URL you copied from TemplateDocs Authentication No authentication, if Require API Key is off Method POST Body content type application/json Body input method JSON string If you enabled Require API Key, include the authorization header described above. Use a representative sample containing the fields your workflow will need. Here is the bookkeeping example from the video, with a placeholder email address: { "clientName": "Jordan Lee", "company": "Cedar & Pine Studio", "email": "jordan@example.com", "service": "Monthly bookkeeping", "fee": 450, "includePayroll": true, "startDate": "2026-09-01" } NOTE: Replace the email with an address you control before testing delivery. Keep numbers and booleans unquoted: 450 is a number and true is a boolean. Here, includePayroll will determine whether the payroll section appears. Save the module and click Run once to send the sample. ## 3. Confirm the data structure URL: https://templatedocs.io/docs/guides/use-webhooks#3-confirm-the-data-structure Back in TemplateDocs: Under Captured requests, select the request that just arrived. Review the detected fields and their types. Expand Sample if you want to inspect the original JSON. Click Use this Data Structure. The fields are now available as workflow variables for later steps. Capturing the sample defines the structure, not fixed values: future requests supply their own client name, fee and other details. If you add fields or change the shape of your data later, use Detect again to capture a new sample, then review your mappings. Note that on an already published workflow, sample requests will also start live runs. ![Captured webhook request with seven detected fields, including the numeric fee and boolean includePayroll, and the Use this Data Structure button](https://templatedocs.io/docs/guides/use-webhooks/captured-request-v1.png) ## 4. Generate the document URL: https://templatedocs.io/docs/guides/use-webhooks#4-generate-the-document Add a Document step after the webhook trigger. Select your template and open Document Tag Mapping. Click Get suggestions, apply the suggestions and review each match. You can also drag webhook variables into the mapping fields or use the variable picker. Close the mapping dialog, adjust the output name if needed and choose PDF or DOCX. For the template shown in the video, the mappings are: Template tag Webhook field ClientName clientName CompanyName company Service service StartDate startDate MonthlyFee fee IncludePayroll (condition) includePayroll Your template may use different tag names. They don't have to match the JSON field names, as long as you map them to the right values. With includePayroll mapped to the condition, true includes the payroll section and false leaves it out. The email field doesn't need a document tag: we'll use it for delivery instead. ## 5. Email the document URL: https://templatedocs.io/docs/guides/use-webhooks#5-email-the-document Add an Email step after the Document step: In the recipient field, use the variable picker to select the webhook's email field. Write your subject and message. Type @ to insert webhook values, such as the client's name or service, to personalize them. Under Attachments, click Add Attachment and select the file created by the Document step. The built-in email provider works without additional setup. See Email Delivery for provider options and limits. ## 6. Test and publish URL: https://templatedocs.io/docs/guides/use-webhooks#6-test-and-publish Before going live, you can test the current draft directly in TemplateDocs: Click Test in the workflow designer. Review the sample JSON, use your own email address and start the test run. Open Run History to check that each step succeeded. Check your inbox and open the attachment to review the generated document. If you use the payroll condition, you can try both true and false and see how the section appears only when it should. Test runs execute the workflow's steps, including sending emails, and consume credits like live runs. Use sample data and a recipient you control. When you're happy with the result, click Publish. Return to Make and click Run once again to check the full connection. This time, the external request runs the published workflow and delivers the document. ## 7. Use your workflow URL: https://templatedocs.io/docs/guides/use-webhooks#7-use-your-workflow To automate future requests, replace the fixed sample values in your sending app with data from the real event, such as a new client in your CRM. Each request then generates a document using that client's details. Changes you make later are saved as a draft and are only visible to you. The webhook URL continues to use the published version until you click Publish again. ## Next Steps URL: https://templatedocs.io/docs/guides/use-webhooks#next-steps Read the full Webhooks documentation. Learn how to create a template. See how to generate documents in bulk from spreadsheet data. --- # Generate Documents from Make URL: https://templatedocs.io/docs/integrations/make/generate-documents TemplateDocs integrates seamlessly with Make.com (formerly Integromat) to create powerful document automation scenarios. This page includes a step by step guide to walk you through the process. If you want the opposite direction (TemplateDocs → Make), see Trigger Make from TemplateDocs Workflows. ## Overview URL: https://templatedocs.io/docs/integrations/make/generate-documents#overview To illustrate this process, we will use a "Member Onboarding" scenario: New member's information is added to a Google Sheet Make.com automatically triggers TemplateDocs to generate a customized welcome document TemplateDocs creates the document in PDF format and emails it directly to the member See how it works: Video: TemplateDocs Make.com integration ## Step 1: Add the Member Onboarding template URL: https://templatedocs.io/docs/integrations/make/generate-documents#step-1-add-the-member-onboarding-template Download the Member Onboarding template and upload it to your TemplateDocs account. ![Preview of the member onboarding template](https://templatedocs.io/shared-templates/member_onboarding_template_thumb.png) ## Step 2: Set up your Google Sheet URL: https://templatedocs.io/docs/integrations/make/generate-documents#step-2-set-up-your-google-sheet Create a Google Sheet to store new member information. Include columns that correspond to the placeholders in the template: Member Full Name Member Email Address Membership Level Contact Person Contact Email Make sure to include headers in the first row of your sheet. Your sheet might look something like this: ![Google Sheet with columns for member name, email, membership level, contact person and contact email](https://templatedocs.io/docs/integrations/make/google_sheet_example.png) ## Step 3: Create your Scenario in Make.com URL: https://templatedocs.io/docs/integrations/make/generate-documents#step-3-create-your-scenario-in-makecom ## A. Create a new Scenario URL: https://templatedocs.io/docs/integrations/make/generate-documents#a-create-a-new-scenario Log in to Make.com, click the + Create a new scenario button ## B. Set up your Trigger URL: https://templatedocs.io/docs/integrations/make/generate-documents#b-set-up-your-trigger Choose Google Sheets as your trigger module Select Watch New Rows as the trigger event Connect your Google account if not already connected Select your Google Sheet and the specific worksheet When "Choose where to start" is asked, select "All" and hit "Save" ## C. Set up your Action URL: https://templatedocs.io/docs/integrations/make/generate-documents#c-set-up-your-action Add a new module and choose TemplateDocs Select Generate a Document as the action Connect your TemplateDocs account if not already connected You will be asked to provide your TemplateDocs API key. You can find it in the API Keys page. ## D. Configure the Action URL: https://templatedocs.io/docs/integrations/make/generate-documents#d-configure-the-action General settings: Template: Select your Member Onboarding template Output Format: PDF / DOCX Email fields (optional): Send Email: Enable this option to automatically email the generated document To: Map to the Member Email Address column from your Google Sheet Subject: Customize the email subject (e.g., "Welcome to our organization!") Body: Customize the default email message (optional) Template Data fields: MemberName: Map to the Member Full Name column from your Google Sheet MembershipLevel: Map to the Membership Level column from your Google Sheet ContactPerson: Map to the Contact Person column from your Google Sheet ContactEmail: Map to the Contact Email column from your Google Sheet ## Step 4: Test and activate your Scenario URL: https://templatedocs.io/docs/integrations/make/generate-documents#step-4-test-and-activate-your-scenario Add a test row to your Google Sheet Click Run Once to test your scenario Review the generated welcome document and email delivery Once satisfied, turn on the scenario scheduling ## The Final Result URL: https://templatedocs.io/docs/integrations/make/generate-documents#the-final-result When a new member's information is added to the Google Sheet, a personalized welcome document is automatically created and emailed directly to them. The document includes: Their name and membership details Information about their membership benefits Contact information for support This automation saves your team time, ensures consistency in your onboarding process, and provides new members with immediate confirmation of their membership. The built-in email delivery means you don't need to set up additional email services - TemplateDocs handles everything for you. ## Additional Tips URL: https://templatedocs.io/docs/integrations/make/generate-documents#additional-tips Add your organization's branding, colors, and logos to the template Include links to important resources or next steps for new members Set up additional Make modules to integrate with your CRM or marketing platform For configuring custom SMTP settings, check out our email delivery documentation + --- # Make Integration URL: https://templatedocs.io/docs/integrations/make/overview TemplateDocs integrates with Make.com to automate document generation and trigger actions in other apps. You can connect the two platforms in either direction: ## Make → TemplateDocs URL: https://templatedocs.io/docs/integrations/make/overview#make--templatedocs Use the TemplateDocs module in a Make scenario to generate documents when something happens in another app (Google Sheets, HubSpot, Airtable, etc.). Guide: Generate documents from Make ## TemplateDocs → Make URL: https://templatedocs.io/docs/integrations/make/overview#templatedocs--make Trigger a Make scenario from a TemplateDocs workflow when a specific event occurs (form submitted, document generated, workflow completed, etc.). Then use Make to automate actions in other apps (Slack, HubSpot, Airtable, etc.). Guide: Trigger Make from TemplateDocs Workflows ## Related URL: https://templatedocs.io/docs/integrations/make/overview#related Zapier integration overview TemplateDocs workflows --- # Trigger Make from TemplateDocs Workflows URL: https://templatedocs.io/docs/integrations/make/trigger-scenarios TemplateDocs can trigger Make automations as part of a workflow. This allows you to send data to other apps immediately after a document is generated or a form is submitted. This page includes a step by step guide to walk you through the process. If you want the opposite direction (Make → TemplateDocs), see Generate Documents from Make. ## Overview URL: https://templatedocs.io/docs/integrations/make/trigger-scenarios#overview To illustrate this process, we will use a "Quote Request" scenario: A client submits a TemplateDocs Form to request a quote. TemplateDocs generates the quote document and immediately triggers a Make scenario. Make creates a new Google Drive folder and stores the quote document file there. See how it works: Video: TemplateDocs Make integration ## Step 1: Add the Quote Request template URL: https://templatedocs.io/docs/integrations/make/trigger-scenarios#step-1-add-the-quote-request-template Download the Quote Request template and upload it to your TemplateDocs account. ![Preview of the quote request template](https://templatedocs.io/shared-templates/quote_request_template_thumb.png) ## Step 2: Create a Workflow in TemplateDocs URL: https://templatedocs.io/docs/integrations/make/trigger-scenarios#step-2-create-a-workflow-in-templatedocs Open your TemplateDocs account and create a new workflow. Choose Add Document Templates and select the Quote Request template. TemplateDocs will create two default steps: Trigger - Quote Request Form Email - Send Email Edit the form in the Trigger step to match the appearance you want for your quote request form. Remove the Email step. We will send the document to Make instead. ![Public Quote Request Form with company, contact, project, due date, items and notes fields](https://templatedocs.io/docs/integrations/zapier/quote-request-form.png) ## Step 3: Create a Make webhook trigger URL: https://templatedocs.io/docs/integrations/make/trigger-scenarios#step-3-create-a-make-webhook-trigger Log in to Make Click + Create scenario (If prompted, select Build from scratch) Add the Webhooks module as your first module Select Custom webhook Click Create a webhook Name your webhook and click Save (no need to specify any other settings) Copy the webhook address. You will need this address in the next step. You should see a red spinner and a message saying "Make is now listening for the data..." Leave the scenario builder open and go back to the TemplateDocs workflow editor in a new tab ## Step 4: Add a Make step in your TemplateDocs workflow URL: https://templatedocs.io/docs/integrations/make/trigger-scenarios#step-4-add-a-make-step-in-your-templatedocs-workflow In TemplateDocs, open your workflow and add a Make step: URL: paste the Make webhook address Document: select the document you want to send ("Quote Request" in this example) Additional Form Data Fields: add any extra fields you want to send to Make. As an example, we will add the following field (use the @ symbol to reference form fields and variables): Company: Map to the Company Name form field ## Step 5: Send a test request URL: https://templatedocs.io/docs/integrations/make/trigger-scenarios#step-5-send-a-test-request Click the Trigger Form button in the upper right corner of the workflow editor. Fill in the form and click Submit. ## Step 6: Capture the webhook payload in Make URL: https://templatedocs.io/docs/integrations/make/trigger-scenarios#step-6-capture-the-webhook-payload-in-make Back in Make, you should see Successfuly determined in the webhook module output. Click Save to save the webhook configuration. ## Step 7: Add a module to Make to create a new folder in Google Drive URL: https://templatedocs.io/docs/integrations/make/trigger-scenarios#step-7-add-a-module-to-make-to-create-a-new-folder-in-google-drive Add a Google Drive module Select Create a folder Connect your Google Drive account if not already connected Configure the module: New Folder Location: Choose a parent folder New Folder Name: Map to the Company variable from the Webhook module ## Step 8: Add a module to Make to upload the document to the new folder URL: https://templatedocs.io/docs/integrations/make/trigger-scenarios#step-8-add-a-module-to-make-to-upload-the-document-to-the-new-folder Add a Google Drive module Select Upload a file Configure the module: Enter a Folder ID: Select "Enter Manually" Folder ID: Select the Folder ID variable from the module created in the previous step File Name: Map to the file name variable from the Webhook module Data: Map to the file data variable from the Webhook module ## Step 9: Activate your automation URL: https://templatedocs.io/docs/integrations/make/trigger-scenarios#step-9-activate-your-automation In Make, save the scenario then toggle "Immediately as data arrives" on so it runs automatically. If you wish your TemplateDocs form to be public, you can publish it by clicking the Publish button in the TemplateDocs workflow editor. Otherwise, it will remain private and only accessible to you and your team through the private trigger form. ## The Final Result URL: https://templatedocs.io/docs/integrations/make/trigger-scenarios#the-final-result When a new quote request is submitted, TemplateDocs sends the generated document and form data to Make, and a new folder is automatically created in your Google Drive with the quote document file inside. + ![Google Drive folder named Acme holding the generated Quote Request.docx](https://templatedocs.io/docs/integrations/make/google_drive_example_output.png) --- # Generate Documents from viaSocket URL: https://templatedocs.io/docs/integrations/viasocket TemplateDocs can be used together with viaSocket to automate document generation. This page includes a step by step guide to walk you through the process. ## Overview URL: https://templatedocs.io/docs/integrations/viasocket#overview To illustrate this process, we will use a "Member Onboarding" scenario: New member's information is added to a Google Sheet viaSocket automatically triggers TemplateDocs to generate a customized welcome document TemplateDocs creates the document in DOCX or PDF format and emails it directly to the member See how it works: Video: TemplateDocs viaSocket integration ## Step 1: Add the Member Onboarding template URL: https://templatedocs.io/docs/integrations/viasocket#step-1-add-the-member-onboarding-template Download the Member Onboarding template and upload it to your TemplateDocs account. ![Preview of the member onboarding template](https://templatedocs.io/shared-templates/member_onboarding_template_thumb.png) ## Step 2: Set up your Google Sheet URL: https://templatedocs.io/docs/integrations/viasocket#step-2-set-up-your-google-sheet Create a Google Sheet to store new member information. Include columns that correspond to the placeholders in the template: Member Full Name Member Email Address Membership Level Contact Person Contact Email Make sure to include headers in the first row of your sheet. ![Google Sheet with columns for member name, email, membership level, contact person and contact email](https://templatedocs.io/docs/integrations/viasocket/google_sheet_example.png) ## Step 3: Create your flow in viaSocket URL: https://templatedocs.io/docs/integrations/viasocket#step-3-create-your-flow-in-viasocket ## A. Create a new flow URL: https://templatedocs.io/docs/integrations/viasocket#a-create-a-new-flow Log in to viaSocket, click the + Create new flow button ## B. Set up your Trigger URL: https://templatedocs.io/docs/integrations/viasocket#b-set-up-your-trigger Click Select Trigger and search for Google Sheets Select Google Sheets and then New or Updated Spreadsheet Row Connect your Google account if not already connected Select your Google Sheet and the specific worksheet ## C. Set up your Step URL: https://templatedocs.io/docs/integrations/viasocket#c-set-up-your-step Click Add Step and search for TemplateDocs Select TemplateDocs and then Generate Document From Template Connect your TemplateDocs account You will be asked to provide your TemplateDocs API key. You can find it in the API Keys page. ## D. Configure the Step URL: https://templatedocs.io/docs/integrations/viasocket#d-configure-the-step General settings: Select your Member Onboarding template Click on Template Data, Output Format and ... and expand the section Template Data fields: MemberName: Map to the Member Full Name column from your Google Sheet MembershipLevel: Map to the Membership Level column from your Google Sheet ContactPerson: Map to the Contact Person column from your Google Sheet ContactEmail: Map to the Contact Email column from your Google Sheet Output Format: Set the desired output format (PDF / DOCX) Email fields (optional): Send via Email: Check this option to automatically email the generated document Email To: Map to the Member Email Address column from your Google Sheet ## Step 4: Publish your flow URL: https://templatedocs.io/docs/integrations/viasocket#step-4-publish-your-flow Click on Go Live to publish your flow Add a test row to your Google Sheet (it might take a few minutes for viaSocket to detect the new row) Review the generated welcome document ## The Final Result URL: https://templatedocs.io/docs/integrations/viasocket#the-final-result When a new member's information is added to the Google Sheet, a personalized welcome document is automatically created and emailed directly to them. The document includes: Their name and membership details Information about their membership benefits Contact information for support This automation saves your team time, ensures consistency in your onboarding process, and provides new members with immediate confirmation of their membership. The built-in email delivery means you don't need to set up additional email services - TemplateDocs handles everything for you. ## Additional Tips URL: https://templatedocs.io/docs/integrations/viasocket#additional-tips Add your organization's branding, colors, and logos to the template Include links to important resources or next steps for new members Add more viaSocket steps to update your CRM or marketing tools For configuring custom SMTP settings, check out our email delivery documentation + --- # Generate Documents from Zapier URL: https://templatedocs.io/docs/integrations/zapier/generate-documents TemplateDocs can be used together with Zapier to automate document generation. This page includes a step by step guide to walk you through the process. If you want the opposite direction (TemplateDocs → Zapier), see Trigger Zapier from TemplateDocs Workflows. ## Overview URL: https://templatedocs.io/docs/integrations/zapier/generate-documents#overview To illustrate this process, we will use a "Member Onboarding" scenario: New member submits their information through a Google Form Zapier automatically triggers TemplateDocs to generate a customized welcome document TemplateDocs creates the document in PDF format and emails it directly to the new member See how it works: Video: TemplateDocs Zapier integration ## Step 1: Add the Member Onboarding template URL: https://templatedocs.io/docs/integrations/zapier/generate-documents#step-1-add-the-member-onboarding-template Download the Member Onboarding template and upload it to your TemplateDocs account. ![Preview of the member onboarding template](https://templatedocs.io/shared-templates/member_onboarding_template_thumb.png) ## Step 2: Set up your Google Form URL: https://templatedocs.io/docs/integrations/zapier/generate-documents#step-2-set-up-your-google-form Create a Google Form to collect new member information. Include fields that correspond to the placeholders in the template: Email Address Full Name Membership Level (dropdown with your membership tiers) Make sure to enable the option to collect email addresses if you plan to send the welcome document directly to new members: ![Google Form titled New Member with email, full name and membership level questions](https://templatedocs.io/docs/integrations/zapier/google_form_example.png) ![Google Form settings with the Collect email addresses option set to Verified highlighted](https://templatedocs.io/docs/integrations/zapier/google_form_collect_email_highlighted.png) ## Step 3: Create your Zap in Zapier URL: https://templatedocs.io/docs/integrations/zapier/generate-documents#step-3-create-your-zap-in-zapier ## A. Create a new Zap URL: https://templatedocs.io/docs/integrations/zapier/generate-documents#a-create-a-new-zap Log in to Zapier, click the + Create button and select Zaps ## B. Set up your Trigger URL: https://templatedocs.io/docs/integrations/zapier/generate-documents#b-set-up-your-trigger Choose Google Forms as your trigger app Select New Form Response as the trigger event Connect your Google account if not already connected Select the Google Form that's collecting your form responses ## C. Set up your Action URL: https://templatedocs.io/docs/integrations/zapier/generate-documents#c-set-up-your-action Choose TemplateDocs as your action app Select Generate Document as the action event Connect your TemplateDocs account if not already connected You will be asked to provide your TemplateDocs API key. You can find it in the API Keys page. ## D. Configure the Action URL: https://templatedocs.io/docs/integrations/zapier/generate-documents#d-configure-the-action General fields: Template: Select your Member Onboarding template Output Format: PDF / DOCX Email fields (optional): Send Email: Check this option to automatically email the generated document To: Connect to the Respondent Email field from your Google Form Subject: Customize the email subject (e.g., "Welcome to our organization!") Body: Customize the default email message (optional) Template Data fields: MemberName: Connect to the Full Name field from your Google Form MembershipLevel: Connect to the Membership Level field from your Google Form ContactPerson: Type in a name of a contact person in your organization ContactEmail: Type in an email address for the contact person ## Step 4: Test and activate your Zap URL: https://templatedocs.io/docs/integrations/zapier/generate-documents#step-4-test-and-activate-your-zap Send a test submission through your Google Form Review the generated welcome document ## The Final Result URL: https://templatedocs.io/docs/integrations/zapier/generate-documents#the-final-result When a new member submits the Google Form, a personalized welcome document is automatically created and emailed directly to them. The document includes: Their name and membership details Information about their membership benefits Contact information for support This automation saves your team time, ensures consistency in your onboarding process, and provides new members with immediate confirmation of their membership. The built-in email delivery means you don't need to set up additional email services - TemplateDocs handles everything for you. ## Additional Tips URL: https://templatedocs.io/docs/integrations/zapier/generate-documents#additional-tips Add your organization's branding, colors, and logos to the template Include links to important resources or next steps for new members Set up additional Zap steps to add the member to your CRM or marketing platform For configuring custom SMTP settings, check out our email delivery documentation ## Try next URL: https://templatedocs.io/docs/integrations/zapier/generate-documents#try-next Zapier connects TemplateDocs to thousands of apps. Here are some popular workflows to try next: + --- # Zapier Integration URL: https://templatedocs.io/docs/integrations/zapier/overview TemplateDocs integrates with Zapier to automate document generation and trigger actions in other apps. You can connect the two platforms in either direction: ## Zapier → TemplateDocs URL: https://templatedocs.io/docs/integrations/zapier/overview#zapier--templatedocs Use the TemplateDocs action as part of a Zap to generate documents when something happens in another app (Google Forms, HubSpot, Airtable, etc.). Guide: Generate documents from Zapier ## TemplateDocs → Zapier URL: https://templatedocs.io/docs/integrations/zapier/overview#templatedocs--zapier Trigger a Zap from a TemplateDocs workflow when a specific event occurs (form submitted, document generated, workflow completed, etc.). Then use Zapier to automate actions in other apps (Slack, HubSpot, Airtable, etc.). Guide: Trigger a Zap from TemplateDocs Workflows ## Related URL: https://templatedocs.io/docs/integrations/zapier/overview#related Make.com integration overview TemplateDocs workflows --- # Trigger Zapier from TemplateDocs Workflows URL: https://templatedocs.io/docs/integrations/zapier/trigger-zaps TemplateDocs can trigger Zapier automations as part of a workflow. This allows you to send data to thousands of other apps immediately after a document is generated or a form is submitted. This page includes a step by step guide to walk you through the process. If you want the opposite direction (Zapier → TemplateDocs), see Generate Documents from Zapier. ## Overview URL: https://templatedocs.io/docs/integrations/zapier/trigger-zaps#overview To illustrate this process, we will use a "Quote Request" scenario: A client submits a TemplateDocs Form to request a quote. TemplateDocs generates the quote document and immediately triggers a Zap. Zapier updates your CRM (Notion in this example) with the quote details and the document link. See how it works: Video: TemplateDocs Zapier integration ## Step 1: Add the Quote Request template URL: https://templatedocs.io/docs/integrations/zapier/trigger-zaps#step-1-add-the-quote-request-template Download the Quote Request template and upload it to your TemplateDocs account. ![Preview of the quote request template](https://templatedocs.io/shared-templates/quote_request_template_thumb.png) ## Step 2: Create a Workflow in TemplateDocs URL: https://templatedocs.io/docs/integrations/zapier/trigger-zaps#step-2-create-a-workflow-in-templatedocs Open your TemplateDocs account and create a new workflow. Choose Add Document Templates and select the Quote Request template. TemplateDocs will create two default steps: Trigger - Quote Request Form Email - Send Email Edit the form in the Trigger step to match the appearance you want for your quote request form. Remove the Email step. We will send the document to Zapier instead. ![Public Quote Request Form with company, contact, project, due date, items and notes fields](https://templatedocs.io/docs/integrations/zapier/quote-request-form.png) ## Step 3: Create a Zapier webhook trigger URL: https://templatedocs.io/docs/integrations/zapier/trigger-zaps#step-3-create-a-zapier-webhook-trigger Log in to Zapier Click the + Create button and select Zaps Choose Webhooks by Zapier as your Zap's trigger app Select Catch Hook as the Event and click Continue Zapier will provide a Webhook URL. Copy this URL - you will need it in the next step. ## Step 4: Add a Zapier step in your TemplateDocs workflow URL: https://templatedocs.io/docs/integrations/zapier/trigger-zaps#step-4-add-a-zapier-step-in-your-templatedocs-workflow In TemplateDocs, open your workflow and add a Zapier step: Webhook URL: paste the Zapier webhook URL Document: select the document you want to send ("Quote Request" in this example) Additional Form Data Fields: add any extra fields you want to send to Zapier. As an example, we will add the following fields (use the @ symbol to reference form fields and variables): Date: Map to the Current Date & Time workflow variable Company: Map to the Company Name form field Contact: Map to the Contact Email form field ## Step 5: Send a test request URL: https://templatedocs.io/docs/integrations/zapier/trigger-zaps#step-5-send-a-test-request Click the Trigger Form button in the upper right corner of the workflow editor. Fill in the form and click Submit. ## Step 6: Map the fields in your Zap URL: https://templatedocs.io/docs/integrations/zapier/trigger-zaps#step-6-map-the-fields-in-your-zap Back in Zapier, click the Webhooks by Zapier task and click Test Trigger. You should see the request we've just sent in the Requests tab. Click the request and then click Continue with selected record. You can now map the fields in your Zap and add whatever Zapier actions you need. Lets continue with our Notion example. ## Step 7: Create a new Notion database URL: https://templatedocs.io/docs/integrations/zapier/trigger-zaps#step-7-create-a-new-notion-database Log in to Notion. In the left sidebar, under Private click + Add new and select Empty database. Add the following fields to the database: Date: Date Company: Text Contact: Email Request Doc: Files & Media ## Step 8: Connect your Notion database to your Zap URL: https://templatedocs.io/docs/integrations/zapier/trigger-zaps#step-8-connect-your-notion-database-to-your-zap Back in Zapier, add a Notion task. For Action Event, select Create Data Source Item. Link your Notion account and click Continue. For Data Source, select the database you created in the previous step. Map the trigger fields to the Notion database fields: Company: Map to the Company field Request Doc: Map to the File field (this field was automatically added by TemplateDocs) Contact: Map to the Contact field Date: Map to the Date field Click Continue and then click Test Step. Go back to your Notion database and you should see the new database item. ## Step 9: Publish your workflow URL: https://templatedocs.io/docs/integrations/zapier/trigger-zaps#step-9-publish-your-workflow In Zapier, publish your workflow by clicking the Publish button. If you wish your TemplateDocs form to be public, you can publish it by clicking the Publish button in the TemplateDocs workflow editor. Otherwise, it will remain private and only accessible to you and your team through the private trigger form. ## The Final Result URL: https://templatedocs.io/docs/integrations/zapier/trigger-zaps#the-final-result When a new quote request is submitted, a personalized quote request document is automatically created and added to your Notion database. In this demo, generated documents are accessible through Zapier default storage for a limited time. To keep them long-term, add a storage step in your Zap (such as Google Drive, Dropbox, or S3). + ![Notion Quote Requests table with a row holding the date, company, contact and the generated document link](https://templatedocs.io/docs/integrations/zapier/quote-request-notion-database.png) --- # Welcome to TemplateDocs URL: https://templatedocs.io/docs TemplateDocs is an all-in-one document automation platform that helps you automate document workflows from start to finish - from capturing data to generating DOCX and PDF documents and delivering them where they need to go. ## Create your first document URL: https://templatedocs.io/docs#create-your-first-document Learn the basics of TemplateDocs by watching this short video and creating your first document: Video: Create your first document ## Build your first workflow URL: https://templatedocs.io/docs#build-your-first-workflow Go beyond the basics and automate a complete document workflow. Watch this 2 minute video to learn how: Video: Build your first document ## More getting started guides URL: https://templatedocs.io/docs#more-getting-started-guides ## Explore the documentation by topic URL: https://templatedocs.io/docs#explore-the-documentation-by-topic ## Need help? URL: https://templatedocs.io/docs#need-help Can't find what you're looking for? Send us a message, we'll be happy to help. Contact support For AI tools: llms.txt · llms-full.txt --- # Barcodes URL: https://templatedocs.io/docs/templates/barcodes It's easy to add barcodes to your documents with TemplateDocs. The barcode tag syntax is the same as a simple text tag: {{ MyBarcode }} Provide the barcode details in your JSON data using the barcode object structure shown below: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: MyBarcode (Barcode). The same data as JSON, for the Generate Document API: { "MyBarcode": { "_type": "barcode", "data": "123456789012" } } This will create a barcode that encodes "123456789012" with default settings (CODE128 format, black on white, auto-sized). ![Generated CODE128 barcode encoding 123456789012 with the default black on white style](https://templatedocs.io/docs/templates/barcode/example-barcode.png) ## Using Image Placeholders URL: https://templatedocs.io/docs/templates/barcodes#using-image-placeholders Barcodes can also be inserted using image placeholders. This allows you to replace existing images in your template with generated barcodes. To mark an image as a placeholder, insert a tag in its alt text. Then use the same JSON data as you would for a regular barcode tag. For example: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: MyPlaceholder (Barcode). The same data as JSON, for the Generate Document API: { "MyPlaceholder": { "_type": "barcode", "data": "123456789012" } } ## Barcode Properties URL: https://templatedocs.io/docs/templates/barcodes#barcode-properties Properties: _type (string): Must be set to "barcode" data (string, required): Text to encode in the barcode format (string): Barcode format (e.g. "CODE128", "EAN13", "UPC"). Default is "CODE128" color (string): Foreground color in hex format (e.g. "#000000"). Default is black background (string): Background color in hex format (e.g. "#ffffff"). Default is white barWidth (number): Width of the barcode bars in pixels. Default is 2 barHeight (number): Height of the barcode bars in pixels. Default is 100 margin (number): Margin around the barcode in pixels. Default is 10 showText (boolean): Whether to display the data text below the barcode. Default is true textDistance (number): Distance between barcode and text. Default is 1 fontSize (number): Font size for the display text. Default is 23 ## Examples URL: https://templatedocs.io/docs/templates/barcodes#examples ## Simple Barcode URL: https://templatedocs.io/docs/templates/barcodes#simple-barcode In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: ProductCode (Barcode). The same data as JSON, for the Generate Document API: { "ProductCode": { "_type": "barcode", "data": "123456789012" } } This creates a barcode with default settings (CODE128 format, black on white, auto-sized). ![Generated CODE128 barcode encoding 123456789012 with default settings](https://templatedocs.io/docs/templates/barcode/simple-barcode.png) ## Custom Styled Barcode URL: https://templatedocs.io/docs/templates/barcodes#custom-styled-barcode In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: CustomBarcode (Barcode). The same data as JSON, for the Generate Document API: { "CustomBarcode": { "_type": "barcode", "data": "123456789012", "format": "EAN13", "color": "#2563eb", "background": "#e2e8f0", "barWidth": 3, "barHeight": 120, "margin": 15, "showText": true, "fontSize": 16, "textDistance": 15 } } This creates a blue barcode on a light gray background with custom bar dimensions and styling. ![Generated blue EAN13 barcode on a light gray background with wider bars, a larger margin and the text shown below](https://templatedocs.io/docs/templates/barcode/styled-barcode.png) ## Supported Barcode Formats URL: https://templatedocs.io/docs/templates/barcodes#supported-barcode-formats Barcode Type Format Code Typical Use Case Charset Popularity Different barcode formats have different requirements for the data length and character set. Make sure you use the correct format for your data. The format property accepts both display names (like "Code 128 A") and format codes (like "CODE128A"). --- # Charts URL: https://templatedocs.io/docs/templates/charts Generate dynamic charts in your documents by adding a placeholder chart to your template and placing a tag in its title. When the document is generated, the placeholder chart is populated with the input data you provide. The placeholder chart determines the chart type and visual style, while the input data you provide determines its content. ## Simple Example URL: https://templatedocs.io/docs/templates/charts#simple-example Lets see how to use the chart syntax to create a simple sales performance report: Add a placeholder chart to the template. Place a tag in the chart's title. In this example we've added the {{ SalesChart }} tag in the placeholder chart's title: Sales Performance Report This report provides an overview of our monthly sales performance across all product categories. The chart below shows our sales trends over the past 6 months. As we can see, there has been consistent growth in our overall revenue. We've set the chart input data for this example to: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: SalesChart (Chart). The same data as JSON, for the Generate Document API: { "SalesChart": { "_type": "chart", "title": "Sales Overview", "categories": [ "Jan", "Feb", "Mar", "Apr", "May", "Jun" ], "series": [ { "name": "Sales", "color": "#34d399", "values": [ 65, 59, 80, 84, 82, 90 ] } ] } } The resulting document contains the populated "Sales Overview" chart: Sales Performance Report This report provides an overview of our monthly sales performance across all product categories. The chart below shows our sales trends over the past 6 months. As we can see, there has been consistent growth in our overall revenue. ![Placeholder bar chart in the Word template with {{ SalesChart }} as its title and dummy category data](https://templatedocs.io/docs/templates/charts/bar-chart-placeholder.png) ![Generated Sales Overview bar chart with monthly sales from January to June](https://templatedocs.io/docs/templates/charts/sales-bar-chart.png) ## Chart Properties URL: https://templatedocs.io/docs/templates/charts#chart-properties Chart data format varies depending on the chart type. The common properties are: Properties: _type (string): Must be set to "chart" for all chart types title (string): The title to use instead of the tag name. If not provided the tag will be replaced with an empty string. ## Chart Styling URL: https://templatedocs.io/docs/templates/charts#chart-styling Charts preserve their original styling and settings from the placeholder chart in your template, including: Font styles and sizes Axis formatting Grid lines Legend position and style Chart dimensions and layout You can customize the following through the input JSON data: Chart title Series colors (using hex color codes) Series names for the legend Data values and labels The input data doesn't need to match the placeholder chart. Your generated chart can have more or fewer series, data points, bars, or slices than the original. TemplateDocs automatically adjusts the chart to match the data you provide. The chart's visual style (fonts, grid, dimensions, etc.) is determined by the placeholder chart in your template. Remember to set up the placeholder with your desired styling before generating documents. ## Chart Types URL: https://templatedocs.io/docs/templates/charts#chart-types ## Bar Chart URL: https://templatedocs.io/docs/templates/charts#bar-chart ## Example URL: https://templatedocs.io/docs/templates/charts#example In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: MyChart (Chart). The same data as JSON, for the Generate Document API: { "MyChart": { "_type": "chart", "title": "Monthly Sales", "categories": [ "Jan", "Feb", "Mar", "Apr", "May", "Jun" ], "series": [ { "name": "Revenue", "color": "#34d399", "values": [ 65, 59, 80, 81, 56, 55 ] }, { "name": "Expenses", "color": "#f87171", "values": [ 45, 49, 60, 71, 46, 45 ] } ] } } ![Generated Monthly Sales bar chart comparing revenue and expenses per month](https://templatedocs.io/docs/templates/charts/bar-chart-example-out.png) ## Bar Chart Properties URL: https://templatedocs.io/docs/templates/charts#bar-chart-properties Properties: _type (string): Must be set to "chart" title (string): The title to use instead of the tag name categories (string[]): Array of labels for the x-axis series (object[]): Array of data series objects series[].name (string): Legend label for the series series[].color (string): Hex color code for the bars series[].values (number[]): Array of numeric values matching categories ## Line Chart URL: https://templatedocs.io/docs/templates/charts#line-chart ## Example URL: https://templatedocs.io/docs/templates/charts#example-1 In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: LineChart (Chart). The same data as JSON, for the Generate Document API: { "LineChart": { "_type": "chart", "title": "Temperature Trends", "categories": [ "05/01", "05/07", "05/14", "05/25", "05/31" ], "series": [ { "name": "May", "values": [ 20, 22, 25, 23, 27 ] } ] } } ![Generated Temperature Trends line chart with one series for May](https://templatedocs.io/docs/templates/charts/line-chart-example-out.png) ## Line Chart Properties URL: https://templatedocs.io/docs/templates/charts#line-chart-properties Properties: _type (string): Must be set to "chart" title (string): The title to use instead of the tag name categories (string[]): Array of labels for the x-axis series (object[]): Array of data series objects series[].name (string): Legend label for the series series[].color (string): Hex color code for the bars series[].values (number[]): Array of numeric values matching categories ## Pie Chart URL: https://templatedocs.io/docs/templates/charts#pie-chart Both pie and doughnut charts are supported. They have the same properties. ## Example URL: https://templatedocs.io/docs/templates/charts#example-2 In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: PieChart (Chart). The same data as JSON, for the Generate Document API: { "PieChart": { "_type": "chart", "title": "Revenue Distribution", "series": [ { "name": "Electronics", "value": 300 }, { "name": "Books", "value": 50 }, { "name": "Clothing", "value": 100 } ] } } ![Generated Revenue Distribution pie chart with Electronics, Books and Clothing slices](https://templatedocs.io/docs/templates/charts/pie-chart-example-out.png) ## Pie Chart Properties URL: https://templatedocs.io/docs/templates/charts#pie-chart-properties Properties: _type (string): Must be set to "chart" title (string): The title to use instead of the tag name series (object[]): Array of value objects series[].name (string): Label for the value series[].value (number): Numeric value Notice that pie and doughnut charts have a single series ## Scatter Chart URL: https://templatedocs.io/docs/templates/charts#scatter-chart ## Example URL: https://templatedocs.io/docs/templates/charts#example-3 In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: ScatterChart (Chart). The same data as JSON, for the Generate Document API: { "ScatterChart": { "_type": "chart", "title": "Height vs Weight", "series": [ { "name": "Males", "color": "#10b981", "values": [ { "x": 165, "y": 65 }, { "x": 168, "y": 70 }, { "x": 170, "y": 68 }, { "x": 172, "y": 75 }, { "x": 175, "y": 73 }, { "x": 178, "y": 78 }, { "x": 180, "y": 82 }, { "x": 182, "y": 85 } ] }, { "name": "Females", "color": "#8b5cf6", "values": [ { "x": 160, "y": 55 }, { "x": 165, "y": 58 }, { "x": 168, "y": 73 }, { "x": 170, "y": 63 }, { "x": 172, "y": 77 }, { "x": 175, "y": 68 }, { "x": 178, "y": 70 }, { "x": 165, "y": 61 } ] } ] } } ![Generated Height vs Weight scatter chart with Males and Females series](https://templatedocs.io/docs/templates/charts/scatter-chart-example-out.png) ## Scatter Chart Properties URL: https://templatedocs.io/docs/templates/charts#scatter-chart-properties Properties: _type (string): Must be set to "chart" title (string): The title to use instead of the tag name series (object[]): Array of data series objects series[].name (string): Legend label for the series series[].color (string): Hex color code for the series series[].values (object[]): Array of value objects series[].values[].x (number): X-axis value series[].values[].y (number): Y-axis value ## Bubble Chart URL: https://templatedocs.io/docs/templates/charts#bubble-chart ## Example URL: https://templatedocs.io/docs/templates/charts#example-4 In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: BubbleChart (Chart). The same data as JSON, for the Generate Document API: { "BubbleChart": { "_type": "chart", "title": "Sales vs Marketing", "series": [ { "name": "Marketing Effort", "color": "#fbbf24", "values": [ { "x": 1, "y": 10, "size": 10 }, { "x": 2, "y": 15, "size": 20 }, { "x": 3, "y": 8, "size": 40 }, { "x": 4, "y": 12, "size": 30 } ] } ] } } ![Generated Sales vs Marketing bubble chart where the bubble size shows the marketing effort](https://templatedocs.io/docs/templates/charts/bubble-chart-example-out.png) ## Bubble Chart Properties URL: https://templatedocs.io/docs/templates/charts#bubble-chart-properties Properties: _type (string): Must be set to "chart" title (string): The title to use instead of the tag name series (object[]): Array of data series objects series[].name (string): Legend label for the series series[].color (string): Hex color code for the series series[].values (object[]): Array of value objects series[].values[].x (number): X-axis value series[].values[].y (number): Y-axis value series[].values[].size (number): Size of the bubble --- # Conditions URL: https://templatedocs.io/docs/templates/conditions To conditionally include content in your template, use a condition structure. Conditions syntax is similar to loops, start with {{>>tag}} and end with {{<<}}, where "tag" refers to a boolean value in your data: {{>> IsPremium }} {{ PremiumContent }} {{<< }} Provide a boolean value in your data to control the condition: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: IsPremium (Condition), PremiumContent (Text). The same data as JSON, for the Generate Document API: { "IsPremium": true, "PremiumContent": "This is a premium content!" } The content between the condition tags will only be included if the condition evaluates to true (the checkbox is checked). ## Simple Example URL: https://templatedocs.io/docs/templates/conditions#simple-example Given this template: Welcome{{>> IsRegistered }}, {{ Username }}{{<<}}! The following data will be used to conditionally include the content: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: IsRegistered (Condition), Username (Text). The same data as JSON, for the Generate Document API: { "IsRegistered": true, "Username": "John" } And the output document will be: Welcome, John! Alternatively, if the condition evaluates to false (the checkbox is unchecked): In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: IsRegistered (Condition). The same data as JSON, for the Generate Document API: { "IsRegistered": false } The output document will be: Welcome! ## Advanced Example URL: https://templatedocs.io/docs/templates/conditions#advanced-example This example demonstrates conditions within a table loop. The template shows a sales report where we display additional status information for pending orders: Order ID Status {{>> Orders}}{{ID}} {{Status}} {{>> IsPending}}(Estimated: {{DeliveryDate}}){{<<}}{{<<}} Remember to close both the condition tag and the loop tag with {{<<}} for each. The data for this template: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: Orders (Loop) containing ID (Text), Status (Text), IsPending (Condition), DeliveryDate (Text). The same data as JSON, for the Generate Document API: { "Orders": [ { "ID": "ORD-01", "Status": "Completed", "IsPending": false }, { "ID": "ORD-02", "Status": "Pending", "IsPending": true, "DeliveryDate": "2024-03-15" }, { "ID": "ORD-03", "Status": "Completed", "IsPending": false } ] } The output document will look like this: Order ID Status ORD-01 Completed ORD-02 Pending (Estimated: 2024-03-15) ORD-03 Completed --- # Example Templates URL: https://templatedocs.io/docs/templates/examples Here are some example templates to help you get started with TemplateDocs. Click on any template to download it. ## Invoice URL: https://templatedocs.io/docs/templates/examples#invoice A professional invoice template with detailed line items, tax and total amounts. Features demonstrated: Professional document layout Text and number tags Dynamic table rows Complex table formatting ![Preview of the invoice template](https://templatedocs.io/shared-templates/invoice_template_thumb.png) ## Report URL: https://templatedocs.io/docs/templates/examples#report A detailed performance analysis template with monthly sales overview, expense tracking, and dynamic charts. Try it with this demo data. Features demonstrated: Custom header and footer Dynamic bar, line and pie charts Dynamic table rows ![Preview of the sales report template](https://templatedocs.io/shared-templates/sales_report_template_thumb.png) ## Certificate URL: https://templatedocs.io/docs/templates/examples#certificate A professional certificate template for courses, achievements, or awards. Features demonstrated: Decorative document design Custom fonts and styling Arbitrary positioning ![Preview of the certificate template](https://templatedocs.io/shared-templates/certificate_template_thumb.png) ## Contract URL: https://templatedocs.io/docs/templates/examples#contract A basic contract template showing how to handle legal documents. Features demonstrated: Legal document formatting Custom header and footer Numbered sections ![Preview of the contract template](https://templatedocs.io/shared-templates/contract_template_thumb.png) --- # Images URL: https://templatedocs.io/docs/templates/images To insert images in your template, you have two options: Use an image placeholder. Use an image text tag. ## Image Placeholder URL: https://templatedocs.io/docs/templates/images#image-placeholder Image placeholders allow you to replace existing images in your template while preserving their size, position, and styling. Consider the following template: {{ FullName }} {{ JobTitle }} To let TemplateDocs know you want to replace the placeholder image, insert a tag in its alt text: Right-click the placeholder image. Select "View Alt Text...". Insert the tag in the alt text ({{ProfilePicture}} in this example). Provide the image details using the image data structure shown below: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: ProfilePicture (Image), FullName (Text), JobTitle (Text). The same data as JSON, for the Generate Document API: { "ProfilePicture": { "_type": "image", "format": "image/png", "source": "https://example.com/john.png" }, "FullName": "John Smith", "JobTitle": "Real Estate Agent" } The resulting document will look like this: John Smith Real Estate Agent ![A generic gray profile picture placeholder in the Word template](https://templatedocs.io/docs/templates/images/profile-placeholder.png) ![Word's right-click menu on an image with View Alt Text highlighted](https://templatedocs.io/docs/templates/images/alt-text-context-menu.png) ![Word's Alt Text panel with the {{ProfilePicture}} tag entered in the description field](https://templatedocs.io/docs/templates/images/alt-text-panel-with-arrow.png) ![The generated document with the placeholder replaced by a real profile photo, keeping its circular crop](https://templatedocs.io/docs/templates/images/almost-real-person.png) ## Image Text Tag URL: https://templatedocs.io/docs/templates/images#image-text-tag If you prefer, you can still use standard template tags to insert images into the document. Simply place the tag where you want the image to appear. For example: {{ ProductImage }} When you generate a document from the template, the tag will be replaced with the actual image. Consider the following data for the tag: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: ProductImage (Image). The same data as JSON, for the Generate Document API: { "ProductImage": { "_type": "image", "source": "https://example.com/shoes.jpg", "format": "image/jpeg", "width": 230, "height": 230 } } The resulting document will look like this: ![A product photo of blue running shoes inserted in the document by an image tag](https://templatedocs.io/docs/templates/images/shoes.png) ## Image Properties URL: https://templatedocs.io/docs/templates/images#image-properties Properties: _type (string): Must be set to "image" source (string, required): URL or Base64 encoded image data format (string, required): One of: image/png, image/jpeg, image/bmp, or image/gif width (number): Image width in pixels. Required when using text tags, optional when using image placeholders height (number): Image height in pixels. Required when using text tags, optional when using image placeholders altText (string): Alternative text for accessibility transparencyPercent (number): Transparency level from 0 (opaque) to 100 (transparent) Image files are limited to 4MB in size ## Examples URL: https://templatedocs.io/docs/templates/images#examples ## URL Image Source URL: https://templatedocs.io/docs/templates/images#url-image-source In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: MyImage (Image). The same data as JSON, for the Generate Document API: { "MyImage": { "_type": "image", "source": "https://example.com/image.png", "format": "image/png", "width": 200, "height": 200 } } ## Base64 Image Source URL: https://templatedocs.io/docs/templates/images#base64-image-source In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: MyImage (Image). The same data as JSON, for the Generate Document API: { "MyImage": { "_type": "image", "source": "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAYAAAB...", "format": "image/jpeg", "width": 300, "height": 300 } } ## Transparency and Alt Text URL: https://templatedocs.io/docs/templates/images#transparency-and-alt-text In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: MyImage (Image). The same data as JSON, for the Generate Document API: { "MyImage": { "_type": "image", "source": "https://example.com/image.jpg", "format": "image/jpeg", "width": 250, "height": 250, "transparencyPercent": 30, "altText": "My Image" } } --- # Links URL: https://templatedocs.io/docs/templates/links To insert hyperlinks in your documents, use a link tag. Link tag syntax is the same as a simple text tag: {{ MyLink }} Links are filled in using the link structure shown below: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: MyLink (Link). The same data as JSON, for the Generate Document API: { "MyLink": { "_type": "link", "target": "https://example.com", "text": "Visit Our Website", "tooltip": "Learn more about our services" } } This will create a link to "https://example.com" with the text "Visit Our Website" and a tooltip that appears when hovering over the link. Links maintain the formatting of the link tag when generated (bold, underline, font size, color, etc.). They are not underlined by default. To underline a link, underline the link tag in the template. ![A Visit Our Website hyperlink in the generated document, showing its Learn more about our services tooltip on hover](https://templatedocs.io/docs/templates/links/link-hover.png) ## Link Properties URL: https://templatedocs.io/docs/templates/links#link-properties Properties: _type (string): Must be set to "link" target (string, required): The URL for the link text (string): Display text for the link. If not provided, the target URL will be used tooltip (string): Tooltip text that appears when hovering over the link ## Examples URL: https://templatedocs.io/docs/templates/links#examples ## Simple Example URL: https://templatedocs.io/docs/templates/links#simple-example In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: MyLink (Link). The same data as JSON, for the Generate Document API: { "MyLink": { "_type": "link", "target": "https://example.com" } } Since text is not provided here, the target URL will be used as the link text. This will create a link with the text "https://example.com" https://example.com ## Custom Text and Tooltip URL: https://templatedocs.io/docs/templates/links#custom-text-and-tooltip In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: MyLink (Link). The same data as JSON, for the Generate Document API: { "MyLink": { "_type": "link", "target": "https://www.company.com", "text": "Visit Our Website", "tooltip": "Learn more about our services" } } The resulting document will look like this: Visit Our Website --- # Loops URL: https://templatedocs.io/docs/templates/loops Loop tags allow you to dynamically repeat content in your documents. You can use them to repeat paragraphs, table rows, table columns, and list items based on your data. To get started, follow the examples below. ## Simple example URL: https://templatedocs.io/docs/templates/loops#simple-example To repeat content, simply wrap it with a loop tag. The content can include constant parts as well as other tags to be replaced with data: {{>> HealthyFood }} {{ FruitName }} is healthy for you! {{<<}} Provide an array in your data to populate the loop: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: HealthyFood (Loop) containing FruitName (Text). The same data as JSON, for the Generate Document API: { "HealthyFood": [ { "FruitName": "Apple" }, { "FruitName": "Banana" }, { "FruitName": "Orange" } ] } The resulting document will contain the list of fruits: Apple is healthy for you! Banana is healthy for you! Orange is healthy for you! ## List items URL: https://templatedocs.io/docs/templates/loops#list-items Repeating list items is a common use case. Place the loop tag inside a list item, and the service will automatically generate a new list item for each element in your data array: {{>> Pets }}{{ Name }} {{ Type }}{{<<}} Consider the following data: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: Pets (Loop) containing Name (Text), Type (Text). The same data as JSON, for the Generate Document API: { "Pets": [ { "Name": "Max", "Type": "Dog" }, { "Name": "Jack", "Type": "Parrot" }, { "Name": "Wendy", "Type": "Cat" } ] } The resulting document will contain the list of pets: Max Dog Jack Parrot Wendy Cat The same approach works for numbered lists: {{>> Pets }}{{ Name }} {{ Type }}{{<<}} And the resulting document will contain the list of pets: Max Dog Jack Parrot Wendy Cat ## Table rows URL: https://templatedocs.io/docs/templates/loops#table-rows To repeat table rows, place the opening tag at the beginning of the row and the closing tag in the last cell. The service will create a new row for each item in your data array: Name Type {{>> Pets }}{{ Name }} {{ Type }}{{<<}} We'll use the same data as in the previous example: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: Pets (Loop) containing Name (Text), Type (Text). The same data as JSON, for the Generate Document API: { "Pets": [ { "Name": "Max", "Type": "Dog" }, { "Name": "Jack", "Type": "Parrot" }, { "Name": "Wendy", "Type": "Cat" } ] } And the resulting document will now be: Name Type Max Dog Jack Parrot Wendy Cat ## Table columns URL: https://templatedocs.io/docs/templates/loops#table-columns You can also repeat table columns. Place the opening tag in the first cell of the column and the closing tag in the last cell. The service will create a new column for each item in your data array: Student {{ >> Students }}{{ Name }} Math {{ Math }} Science {{ Science }} History {{ History }}{{<<}} Consider the following data: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: Students (Loop) containing Name (Text), Math (Text), Science (Text), History (Text). The same data as JSON, for the Generate Document API: { "Students": [ { "Name": "John Doe", "Math": "A", "Science": "B+", "History": "A-" }, { "Name": "Jane Smith", "Math": "B", "Science": "A", "History": "A" } ] } The resulting document will show the student's grades across subjects: Student John Doe Jane Smith Math A B Science B+ A History A- A ## Tips and Tricks URL: https://templatedocs.io/docs/templates/loops#tips-and-tricks ## Repeat multiple list items in one loop iteration URL: https://templatedocs.io/docs/templates/loops#repeat-multiple-list-items-in-one-loop-iteration You can wrap more than one list item with the same loop, so each data item produces a group of list items: {{>> Pets }}Name: {{ Name }} Type: {{ Type }}{{<<}} With the same Pets data from above, the output becomes: Name: Max Type: Dog Name: Jack Type: Parrot Name: Wendy Type: Cat ## Repeat multiple rows in one loop iteration URL: https://templatedocs.io/docs/templates/loops#repeat-multiple-rows-in-one-loop-iteration The same pattern works in tables: place the opening tag in the first row of the group and the closing tag in the last row of that same group. Pet Value {{>> Pets }}Name {{ Name }} Type {{ Type }}{{<<}} The resulting document will be: Pet Value Name Max Type Dog Name Jack Type Parrot Name Wendy Type Cat ## Override loop behavior with loopOver URL: https://templatedocs.io/docs/templates/loops#override-loop-behavior-with-loopover ## Default loop behavior URL: https://templatedocs.io/docs/templates/loops#default-loop-behavior When the engine detects a loop, it picks what to repeat based on built-in heuristics: If both loop tags are inside the same table cell, it repeats the cell content. If both loop tags are in the same table column, it repeats the column. If both loop tags are inside a table (but not the same cell or column), it repeats the relevant table rows. If both loop tags are inside a list, it repeats list items. Otherwise, it repeats the content between the opening and closing tags. ## Overriding the default URL: https://templatedocs.io/docs/templates/loops#overriding-the-default If you need to force a specific behavior, set the loopOver option on the opening loop tag. Options are written in square brackets after the tag name, for example {{ >> Students [loopOver: "row"] }}. There are four possible values: row - Repeat one or more rows column - Repeat a column content - Repeat only the content between tags paragraph - Repeat one or more paragraphs ## Example URL: https://templatedocs.io/docs/templates/loops#example Assume we have the following data: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: Students (Loop) containing Name (Text). The same data as JSON, for the Generate Document API: { "Students": [ { "Name": "Alice" }, { "Name": "Bob" } ] } Notice how each option produces a different output: ## loopOver: "row" URL: https://templatedocs.io/docs/templates/loops#loopover-row Template: Student {{ >> Students [loopOver: "row"] }}{{ Name }}{{ << }} Resulting document: Student Alice Bob ## loopOver: "column" URL: https://templatedocs.io/docs/templates/loops#loopover-column Template: Student {{ >> Students [loopOver: "column"] }}{{ Name }}{{ << }} Resulting document: Student Student Alice Bob ## loopOver: "content" URL: https://templatedocs.io/docs/templates/loops#loopover-content Template: Students {{ >> Students [loopOver: "content"] }}{{ Name }} {{ << }} Resulting document: Students Alice Bob ## loopOver: "paragraph" URL: https://templatedocs.io/docs/templates/loops#loopover-paragraph Template: Students {{ >> Students [loopOver: "paragraph"] }}{{ Name }}{{ << }} Resulting document: Students Alice Bob loopOver works for conditions too, not only loops, and you can use it to control what content the condition hides or shows. --- # Templates Overview URL: https://templatedocs.io/docs/templates/overview In TemplateDocs, templates are Microsoft Word documents (.docx files) that have been uploaded to the service. ## Upload a Template URL: https://templatedocs.io/docs/templates/overview#upload-a-template To get started, let's create our first template - a simple order confirmation document that we will use to fill in the data. Notice the {{Name}}, {{CompanyName}}, and {{Items}} placeholders in the template. In TemplateDocs, these are called Tags. ## Create a Document URL: https://templatedocs.io/docs/templates/overview#create-a-document After uploading the template, we can use the service to fill in the template with custom data. The data can be provided in three ways, depending on your use case: Creating a Quick Document through the automatic form (see below). Creating a Workflow and using the Tags Mapping dialog. Through the API, as a JSON object. Regardless of the method you choose, the result will be a new document with the data filled in: ## Quick Document URL: https://templatedocs.io/docs/templates/overview#quick-document The fastest way to try a new template is through the Quick Document tab. Here's how it works: Video: Quick Document ## Bulk Generation URL: https://templatedocs.io/docs/templates/overview#bulk-generation The Quick Document tab can also generate many documents at once. Click Bulk, upload a CSV file, and map the columns to your template's tags - one document is generated per row, and all of them are downloaded together as a single zip file. For larger batches, or to deliver the documents by email or to cloud storage automatically, use a workflow with Bulk Start. ## Next Steps URL: https://templatedocs.io/docs/templates/overview#next-steps Browse more Getting started guides View example templates Read about our powerful built-in Workflows solution to easily automate your work Learn how to programmatically generate documents using our Generate Document API --- # QR Codes URL: https://templatedocs.io/docs/templates/qrcodes It's easy to add QR codes to your documents with TemplateDocs. The QR code tag syntax is the same as a simple text tag: {{ MyQRCode }} Provide the QR code details in your JSON data using the QR code object structure shown below: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: MyQRCode (QR Code). The same data as JSON, for the Generate Document API: { "MyQRCode": { "_type": "qrcode", "data": "https://templatedocs.io" } } This will create a QR code that encodes "https://templatedocs.io" with default settings (black on white, 4px margin, auto-sized). ![Generated QR code encoding https://templatedocs.io with the default black on white style](https://templatedocs.io/docs/templates/qrcode/example-qr.png) ## Using Image Placeholders URL: https://templatedocs.io/docs/templates/qrcodes#using-image-placeholders QR codes can also be inserted using image placeholders. This allows you to replace existing images in your template with generated QR codes. To mark an image as a placeholder, insert a tag in its alt text. Then use the same JSON data as you would for a regular QR code tag. For example: In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: MyPlaceholder (QR Code). The same data as JSON, for the Generate Document API: { "MyPlaceholder": { "_type": "qrcode", "data": "https://templatedocs.io" } } ## QR Code Properties URL: https://templatedocs.io/docs/templates/qrcodes#qr-code-properties Properties: _type (string): Must be set to "qrcode" data (string, required): Text to encode in the QR code size (number): Width and height of the QR code in pixels (QR codes are always square) color (string): Foreground color in hex format (e.g. "#000000"). Default is black background (string): Background color in hex format (e.g. "#ffffff"). Default is white margin (number): Margin around the QR code in pixels. Default is 4 QR codes are square - the size property sets both width and height ## Examples URL: https://templatedocs.io/docs/templates/qrcodes#examples ## Simple QR Code URL: https://templatedocs.io/docs/templates/qrcodes#simple-qr-code In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: WebsiteQR (QR Code). The same data as JSON, for the Generate Document API: { "WebsiteQR": { "_type": "qrcode", "data": "https://templatedocs.io/docs" } } This creates a QR code with default settings (black on white, 4px margin, auto-sized). ![Generated QR code encoding https://templatedocs.io/docs with default settings](https://templatedocs.io/docs/templates/qrcode/simple-qr.png) ## Custom Styled QR Code URL: https://templatedocs.io/docs/templates/qrcodes#custom-styled-qr-code In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: ContactQR (QR Code). The same data as JSON, for the Generate Document API: { "ContactQR": { "_type": "qrcode", "data": "https://templatedocs.io/docs/templates/qrcodes", "size": 200, "color": "#2563eb", "background": "#e2e8f0", "margin": 8 } } This creates a blue QR code on a light gray background with custom size and margin. ![Generated blue QR code on a light gray background with a wider margin](https://templatedocs.io/docs/templates/qrcode/styled-qr.png) ## Common Use Cases URL: https://templatedocs.io/docs/templates/qrcodes#common-use-cases ## Email links URL: https://templatedocs.io/docs/templates/qrcodes#email-links In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: EmailQR (QR Code). The same data as JSON, for the Generate Document API: { "EmailQR": { "_type": "qrcode", "data": "mailto:hello@templatedocs.io" } } This creates a QR code that allows users to send an email when scanned. ![Generated QR code that opens a new email to hello@templatedocs.io when scanned](https://templatedocs.io/docs/templates/qrcode/email-qr.png) ## Phone Numbers URL: https://templatedocs.io/docs/templates/qrcodes#phone-numbers In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: PhoneQR (QR Code). The same data as JSON, for the Generate Document API: { "PhoneQR": { "_type": "qrcode", "data": "tel:+1234567890" } } This creates a QR code that allows users to call the number when scanned. ![Generated QR code that dials a phone number when scanned](https://templatedocs.io/docs/templates/qrcode/phone-qr.png) ## SMS links URL: https://templatedocs.io/docs/templates/qrcodes#sms-links In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: SMSQR (QR Code). The same data as JSON, for the Generate Document API: { "SMSQR": { "_type": "qrcode", "data": "sms:+1234567890" } } This creates a QR code that allows users to send an SMS message when scanned. ![Generated QR code that opens a new SMS to a phone number when scanned](https://templatedocs.io/docs/templates/qrcode/sms-qr.png) ## WiFi credentials URL: https://templatedocs.io/docs/templates/qrcodes#wifi-credentials In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: WiFiQR (QR Code). The same data as JSON, for the Generate Document API: { "WiFiQR": { "_type": "qrcode", "data": "WIFI:T:WPA;S:MyNetwork;P:password123;H:false;;" } } This creates a QR code that allows users to automatically connect to a WiFi network when scanned. ![Generated QR code that connects to the MyNetwork WiFi network when scanned](https://templatedocs.io/docs/templates/qrcode/wifi-qr.png) ## Google Maps URL: https://templatedocs.io/docs/templates/qrcodes#google-maps In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: GoogleMapsQR (QR Code). The same data as JSON, for the Generate Document API: { "GoogleMapsQR": { "_type": "qrcode", "data": "https://maps.google.com/?q=Eiffel+Tower" } } This creates a QR code that allows users to view a Google Maps location when scanned. ![Generated QR code that opens the Eiffel Tower in Google Maps when scanned](https://templatedocs.io/docs/templates/qrcode/google-maps-qr.png) ## Contact information URL: https://templatedocs.io/docs/templates/qrcodes#contact-information In the TemplateDocs app (the Quick Document form or a workflow's tag mapping), set the tag type and fill in the tag fields: ContactQR (QR Code). The same data as JSON, for the Generate Document API: { "ContactQR": { "_type": "qrcode", "data": "MECARD:N:John Doe;EMAIL:john.doe@example.com;TEL:+1234567890;URL:https://example.com;;" } } This creates a QR code that allows users to save contact information when scanned. ![Generated QR code that adds John Doe as a contact (MECARD) when scanned](https://templatedocs.io/docs/templates/qrcode/contact-qr.png) --- # Template Tags URL: https://templatedocs.io/docs/templates/tags TemplateDocs uses a simple and powerful template syntax that allows you to create dynamic documents from your Word templates. To insert text in your template, use double curly braces with a tag name: {{ FirstName }} When you generate a document from the template, this tag will be replaced with the corresponding value from your data. For example, if FirstName is set to "John", the tag {{ FirstName }} will be replaced with "John" while preserving any text formatting (bold, italic, font size, etc.) applied to the tag in the original Word document. If you haven't already, make sure to read the Template Introduction guide. ## Tag Rules URL: https://templatedocs.io/docs/templates/tags#tag-rules Tags are: surrounded by double curly braces {{ and }} case-sensitive must start with a letter can contain letters, numbers, and underscores must not contain spaces in the tag name can contain spaces before and after the tag name Examples: Good ✓ Bad ✗ Double curly braces, not single curly braces {{FirstName}} {FirstName} Double curly braces without spaces {{ firstName }} { { firstName } } No spaces in tag name {{ FirstName }} {{ First Name }} No special characters except underscores {{ last_name }} {{ last-name }} No underscores at the beginning {{first_name}} {{_first_name}} No numbers at the beginning {{ Item5 }} {{ 5Item }} ## Loop Tags URL: https://templatedocs.io/docs/templates/tags#loop-tags To repeat content (like paragraphs, table rows, or list items), use a loop structure. Loop tags consist of: An opening tag: {{>> tag }} Content to be repeated A closing tag: {{<<}} Here's an example: {{>> Fruits }} {{ Name }} {{<<}} The resulting document may look like this: Apple Banana Orange Some examples to help you with the syntax: Good ✓ Bad ✗ Opening tag {{>> Items }} {{# Items }} Closing tag {{<<}} {{/ Items }} Surrounded by double curly braces {{>> Items }} {{ ItemName }} {{<<}} {<< Items } { ItemName } {<<} Spaces around tag names (but not within them) are allowed and will be ignored. This means {{FirstName}} is the same as {{ FirstName }} and {{>>HealthyFood}} is the same as {{ >> HealthyFood }}. ## See it in action URL: https://templatedocs.io/docs/templates/tags#see-it-in-action Video: Editing Templates ## Next Steps URL: https://templatedocs.io/docs/templates/tags#next-steps Read the introduction guide Try the example templates Learn how to create tables and lists with loop tags Learn how to conditionally include content with conditions Learn how to insert images, links, QR codes and charts --- # Workflow Documents URL: https://templatedocs.io/docs/workflows/documents Document steps generate Word (.docx) or PDF files from your templates and workflow data. Add a Document step anywhere in your workflow, select a template, and map workflow variables to the template's tags. ## Adding a Document Step URL: https://templatedocs.io/docs/workflows/documents#adding-a-document-step Add a Document step to your workflow and select a template from your organization's template library. You can: Generate documents in DOCX or PDF format Use any template from your template library Map data from previous workflow steps to template tags Add multiple Document steps to generate different documents ![The Document step card in the workflow editor, labeled Generate document](https://templatedocs.io/docs/workflows/documents/document_step.png) ## Mapping Data to Documents URL: https://templatedocs.io/docs/workflows/documents#mapping-data-to-documents Templates contain dynamic tags, such as {{ Name }} or {{ CompanyName }}. The Document Mapping editor lets you map workflow variables to these tags. Drag variables from previous steps to the corresponding template tags to control the data used when the document is generated. Workflow variables can come from forms, webhooks, formulas, integrations, or any other previous step in the workflow. ![Dragging the Company Name workflow variable onto its matching template tag in the Document Mapping editor](https://templatedocs.io/docs/workflows/documents/mapping_drag.gif) ## Loops URL: https://templatedocs.io/docs/workflows/documents#loops Template loops can be mapped to arrays of workflow data. For example, a table field in a form can collect multiple rows of data. Arrays can also be provided directly when triggering a workflow through a webhook. Select the source array for the loop, then map values from each array item to the tags inside the loop. This makes it easy to generate tables and repeating sections from data such as order items, invoice lines, or contacts. You can also use array expressions to filter, sort, or select data before mapping it to a loop. ## Using Generated Documents URL: https://templatedocs.io/docs/workflows/documents#using-generated-documents Once generated, a document becomes available to later steps in the workflow. You can attach it to an email, upload it to cloud storage, or use it in other supported workflow steps. ## Next Steps URL: https://templatedocs.io/docs/workflows/documents#next-steps Learn more about template tags Explore loops for repeating data Learn how to use formulas --- # Workflow Automation URL: https://templatedocs.io/docs/workflows/overview Workflows let you automate business processes - without writing code. They connect forms, webhooks, logic, document actions, emails, and integrations into a single, repeatable flow. Instead of manually reviewing requests, sending emails, or copying data between systems, a workflow does it for you - consistently and instantly. ## See it in action URL: https://templatedocs.io/docs/workflows/overview#see-it-in-action Video: Getting started: create a new workflow ## What is a Workflow? URL: https://templatedocs.io/docs/workflows/overview#what-is-a-workflow A workflow is a series of steps that run automatically when something happens - for example, when a client submits a form or a webhook is received. Each workflow can: Collect information Generate documents Send emails and notifications Make decisions with conditions Connect to storage, spreadsheets, external systems, and APIs ## Example Workflow URL: https://templatedocs.io/docs/workflows/overview#example-workflow In the example below: A client submits an intake form The workflow evaluates urgency and value based on the user input High-priority requests notify the team and create a CRM lead Standard requests receive an automatic confirmation with a document attachment All of this runs without manual intervention, ensuring a consistent and efficient process. ![Example workflow with a form trigger, flow control step, document steps, email notifications, and a spreadsheet update](https://templatedocs.io/docs/workflows/overview/workflow_example.png) ## Run History URL: https://templatedocs.io/docs/workflows/overview#run-history Every workflow keeps a history of its runs. For each run you can see its status, the steps it executed, their timing and cost, and any errors or warnings - making it easy to verify results and troubleshoot problems. Runs that are still in progress can be cancelled from the history view: steps that are waiting to execute stop immediately, steps that are already executing finish their work, and the run is marked as Cancelled. ## Next Steps URL: https://templatedocs.io/docs/workflows/overview#next-steps Follow the Getting started guide Read more about Documents and Templates Start a workflow for every spreadsheet row with Bulk Generation Explore the power of Formulas for advanced calculations and transformations --- # Webhooks URL: https://templatedocs.io/docs/workflows/webhooks Webhook triggers let you start workflows from external applications and services by sending data to a unique URL. When a webhook is called, the JSON data you send becomes available as workflow variables and can be used by later steps to generate documents, apply logic, send emails, and more. ## See it in action URL: https://templatedocs.io/docs/workflows/webhooks#see-it-in-action Video: Getting started: use webhooks ## Adding a Webhook Trigger URL: https://templatedocs.io/docs/workflows/webhooks#adding-a-webhook-trigger Select Webhook as the trigger type in the workflow designer. Each webhook trigger gets a unique URL: https://hooks.templatedocs.io/hooks/ Send an HTTP POST request with a JSON body to this URL to start the workflow. Webhooks invoke the published version of a workflow. If the workflow has unpublished changes, the currently published version will continue to run until the workflow is published again. To try out unpublished changes, see Testing Before Publishing. ## Data Structure URL: https://templatedocs.io/docs/workflows/webhooks#data-structure The webhook's data structure defines the variables that are available to later steps in the workflow. To detect the data structure, click Start Listening in the trigger settings, then send a sample request to the webhook URL. TemplateDocs captures the request and automatically detects its structure. Once detected, fields from the JSON body become workflow variables. Nested objects and arrays are supported, including arrays of objects that can be mapped directly to document loops. If the structure of your webhook data changes, use Detect again to capture a new sample and update the data structure. Incoming data is checked against the detected structure when a workflow runs. Differences are reported as warnings in the run history, but do not stop the workflow. ![Webhook listening for sample requests](https://templatedocs.io/docs/workflows/webhooks/webhook_listening.png) ## Calling the Webhook URL: https://templatedocs.io/docs/workflows/webhooks#calling-the-webhook Send a POST request with a JSON body to the webhook URL: WEBHOOK_URL="https://hooks.templatedocs.io/hooks/my_webhook_123" curl -X POST "$WEBHOOK_URL" \ -H "Content-Type: application/json" \ -d '{ "customerName": "Jane Smith", "items": [ { "name": "Consulting services", "total": 1200 } ] }' const webhookUrl = "https://hooks.templatedocs.io/hooks/my_webhook_123"; const response = await fetch(webhookUrl, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ customerName: "Jane Smith", items: [ { name: "Consulting services", total: 1200 } ] }) }) const data = await response.json() console.log(data) import requests webhook_url = "https://hooks.templatedocs.io/hooks/my_webhook_123" response = requests.post( webhook_url, json={ "customerName": "Jane Smith", "items": [ { "name": "Consulting services", "total": 1200 } ] } ) print(response.json()) import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; public class Main { public static void main(String[] args) { try { String webhookUrl = "https://hooks.templatedocs.io/hooks/my_webhook_123"; String requestBody = """ { "customerName": "Jane Smith", "items": [ { "name": "Consulting services", "total": 1200 } ] } """; HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(webhookUrl)) .header("Content-Type", "application/json") .POST(HttpRequest.BodyPublishers.ofString(requestBody)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } catch (Exception e) { e.printStackTrace(); } } } using System.Net.Http; using System.Text; using System.Text.Json; string webhookUrl = "https://hooks.templatedocs.io/hooks/my_webhook_123"; var client = new HttpClient(); var content = new StringContent( JsonSerializer.Serialize(new { customerName = "Jane Smith", items = new[] { new { name = "Consulting services", total = 1200 } } }), Encoding.UTF8, "application/json" ); HttpResponseMessage response = await client.PostAsync(webhookUrl, content); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); A successful request returns: { "accepted": true, "requestId": "7c132a39-49c8-4f9d-91ac-9d31672eaa4f" } The workflow starts asynchronously after the request is accepted. The maximum request size is 10 MB. ## Testing Before Publishing URL: https://templatedocs.io/docs/workflows/webhooks#testing-before-publishing You can test a webhook-triggered workflow without publishing it. In the workflow designer, click the Test button (shown when the workflow is a draft or has unpublished changes). A dialog opens where you can review and edit the JSON body, then start a run of the current draft. The results appear in the run history like any other run. Test runs use your current draft instead of the live webhook URL. Each test run still consumes credits the same way a published workflow does. ## Starting in Bulk URL: https://templatedocs.io/docs/workflows/webhooks#starting-in-bulk Instead of calling the webhook once per record, you can start the workflow for a whole spreadsheet at once: upload a CSV file, map its columns to the webhook's data structure, and each row starts its own run. See Bulk Generation for details. ## API Key Authentication URL: https://templatedocs.io/docs/workflows/webhooks#api-key-authentication By default, anyone with the webhook URL can invoke the workflow. For additional protection, enable Require API Key in the webhook trigger settings. Requests must then include an organization API key in the Authorization header, prefixed with Bearer. Authorization: Bearer See API Authentication for information about creating and using API keys. ## Next Steps URL: https://templatedocs.io/docs/workflows/webhooks#next-steps Read the Workflows overview Start a workflow for every spreadsheet row with Bulk Generation Learn how to use formulas and array expressions for advanced data processing Generate files with Document steps