Document Generation
API & SDK
TurboDocx's document generation API fills the {placeholders} in a Word (DOCX) template with your data in 1 call, then returns the result as a DOCX or PDF. 6 published SDKs (JavaScript/TypeScript, Python, Go, PHP, Java, Ruby) wrap the same REST API, so document automation fits the stack you already run. The same API key also sends the generated document for e-signature.
Document Generation API & SDK: Key Takeaways
- 1 callcreates a document:
Deliverable.generateDeliverable()takes a templateId and variables, thendownloadSourceFile()returns the DOCX anddownloadPDF()returns the PDF. - 4 typesof template variable: plain text, HTML, Markdown, and images.
- 6 publishedSDKs (JavaScript/TypeScript, Python, Go, PHP, Java, Ruby) are built on the same REST API.
- $0Free plan includes 5 documents and 5 signatures a month; paid plans start at $10/user/mo.
- 1,000,000+downloads a month (npm) for the related open-source @turbodocx/html-to-docx package, free and independent of the paid API.
Template-Based Generation
Upload a Word (DOCX) template with {placeholders} once; every API call fills a fresh copy with your data.
DOCX and PDF Output
Download each generated document in its original DOCX format or as a PDF, over the same REST API.
4 Variable Types
Fill placeholders with plain text, HTML, Markdown, or images, so one template covers customized documents.
Signature Webhooks
When a generated document goes out for signature, webhooks report sent, viewed, signed, completed, and voided.
6 Published SDKs
JavaScript/TypeScript, Python, Go, PHP, Java, and Ruby, all versioned together at 0.9.0.
One Key, Two Modules
Deliverable generates documents; TurboSign sends them for signature. Same API key, same SDK install.
Can an AI coding agent install the document generation SDK?
Skip the boilerplate. Drop the TurboDocx SDK and @turbodocx/html-to-docx into any project with our open-source Agent Skill. It detects your language and framework, installs the package, configures env vars, and writes working integration code that matches your existing patterns.
How do I generate a DOCX or PDF from a template with an API?
Call the Deliverable module with a templateId and your variables, then download the file. Straight from the official SDK examples.
// npm install @turbodocx/sdk
import { Deliverable } from '@turbodocx/sdk';
Deliverable.configure({
apiKey: process.env.TURBODOCX_API_KEY,
orgId: process.env.TURBODOCX_ORG_ID,
});
const created = await Deliverable.generateDeliverable({
templateId: 'YOUR_TEMPLATE_ID',
name: 'Employee Contract - John Smith',
variables: [
{ placeholder: '{EmployeeName}', text: 'John Smith', mimeType: 'text' },
{ placeholder: '{JobTitle}', text: 'Senior Software Engineer', mimeType: 'text' },
],
});
const id = created.results.deliverable.id;
const docx = await Deliverable.downloadSourceFile(id); // filled DOCX
const pdf = await Deliverable.downloadPDF(id); // same document as PDFNeed e-signatures on that document? Same API key, same SDK: send it with the TurboSign module. Full endpoints, pricing, and code samples are on the E-Signature API page.
Need Go, PHP, Java, or Ruby? Every SDK exposes the same generate call:
- JavaScript / TypeScript:
Deliverable.generateDeliverable({ templateId, name, variables }) - Python:
await Deliverable.generate_deliverable(template_id=..., name=..., variables=[...]) - PHP:
Deliverable::generateDeliverable([...]) - Go:
client.Deliverable.GenerateDeliverable(ctx, &turbodocx.CreateDeliverableRequest{...}) - Java:
client.deliverable().generateDeliverable(request) - Ruby:
TurboDocxSdk::Deliverable.generate_deliverable(request)
Which REST endpoints generate documents?
7 REST endpoints cover document generation end to end, from template to DOCX and PDF, plus the hand-off to signing. Base URL: https://api.turbodocx.com
| POST | /v1/deliverable |
| GET | /v1/deliverable |
| GET | /v1/deliverable/:id |
| GET | /v1/deliverable/file/:id |
| GET | /v1/deliverable/file/pdf/:id |
| PATCH | /v1/deliverable/:id |
| POST | /turbosign/single/prepare-for-signing |
Which languages have a document generation SDK?
6 published SDKs wrap the same REST API and ship at version 0.9.0, each with a Deliverable module for document generation and a TurboSign module for signatures.
JavaScript / TypeScript
npm install @turbodocx/sdkPython
pip install turbodocx-sdkPHP
composer require turbodocx/sdkGo
go get github.com/TurboDocx/SDK/packages/go-sdkJava
implementation 'com.turbodocx:turbodocx-sdk:0.9.0'Ruby
gem install turbodocx-sdkCan the SDK handle high-volume document generation?
Each document is 1 generateDeliverable() call, so a batch job loops over your records and can run calls concurrently: Promise.all in Node.js, asyncio.gather in the async Python SDK, or goroutines with the Go client. listDeliverables() pages back through what you generated, and Enterprise plans set custom API rate limits for sustained volume.
Generating proposals, contracts, or reports from a CRM? See the Developer Hub for quickstarts, or book a demo to size an Enterprise rate limit.
Build Document Features Fast
Add document generation and e-signatures to your SaaS with 1 API key and 1 SDK install.
Need a Tailored Integration?
Most teams self-serve with the API above. If your Salesforce, SharePoint, or legacy ERP setup needs a custom document workflow built and maintained for you, our team delivers that as a tailored integration, at software pricing.
How much does the document generation API cost?
Document generation is included in every plan: 5 documents a month on Free, 10 on Team, and unlimited in-app on Pro.
E-signature pricing: API plans start at $0.30 per signature, with no minimums. Start on the free plan and pay only for the signatures you send beyond it, so a month with one extra signature costs $0.30.
Automate with n8n
Connect TurboDocx to 400+ apps with our official n8n nodes. Automate document generation and signature workflows without writing code.
# Install in your n8n instance
npm install @turbodocx/n8n-nodes-turbodocxFrequently Asked Questions
Is there a free tier for the TurboDocx document automation API?
$0 to start: the Free plan includes 5 document generations and 5 e-signatures a month, plus 1,000 AI credits, no credit card required. The $10/user/month Team plan raises that to 10 documents and 15 signatures a month shared across the team. The $20/user/month Pro plan gives named users unlimited document generation, signatures, and AI credits in the app. API signatures beyond any plan's included allowance start at $0.30 each with no minimums.
Which SDKs does the TurboDocx API support?
6 published SDKs cover JavaScript/TypeScript, Python, Go, PHP, Java, and Ruby, all built on the same REST API and versioned together at 0.9.0. Each ships a Deliverable module for document generation and a TurboSign module for e-signatures, so one install covers both. Install with npm, pip, composer, Go modules, Maven Central, or RubyGems.
Can the API generate DOCX and PDF documents from templates?
1 API call generates a document: Deliverable.generateDeliverable() takes a templateId and a list of variables, such as a placeholder like {EmployeeName}, and creates the filled document. Deliverable.downloadSourceFile() then returns it as a DOCX and Deliverable.downloadPDF() returns it as a PDF. Each variable is plain text, HTML, Markdown, or an image.
Does the document automation API include e-signatures, or is that separate?
1 platform, 2 capabilities: the same API key and SDK generate documents with the Deliverable module and send them for signature with the TurboSign module, so a contract can be created, sent, and signed without switching tools or credentials. For endpoints, pricing, and code samples focused only on signing, see /e-signature-api.
Is TurboDocx open source?
1,000,000+ downloads a month on npm: @turbodocx/html-to-docx is a free, MIT-licensed package that converts HTML to Word documents in Node.js, independent of the paid API and usable without a TurboDocx account. It runs standalone in any Node.js project or alongside the TurboDocx SDK, and its source is public on GitHub.
Related Resources
Ready to generate your first document?
Get an API key in minutes. Start with 5 free documents a month, scale as you grow.
Need a tailored integration into Salesforce, SharePoint, or a legacy system instead? Book a demo and our team scopes it with you.