{"uid":"cap_cEUvf0fpsdKdsTifmSWGV","slug":"tanod-docs-docx-template-fill-8ea9b093","name":"Tanod Docs – DOCX Template Fill","description":"Documents: DOCX template fill, Office to PDF, any file to Markdown, PDF to Word, OCR, PDF pipeline.","url":"https://docs.tanod.dev/v1/docs/fill-template?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"url":{"anyOf":[{"type":"string","maxLength":2048,"minLength":1},{"type":"null"}],"default":null,"description":"Public http(s) URL of the DOCX template (at most 20 MB; private, internal and IP-literal hosts are refused); or use file_base64."},"data":{"type":"object","description":"The values, a JSON object (at most 1 MB, 12 levels deep). {{name}} reads data[\"name\"], {{customer.name}} data[\"customer\"][\"name\"], {{items.0}} the first element of a list. A table row holding {{#items}} and {{/items}} is repeated for each element of the list items; inside it {{field}} reads the element first, then data, and {{.}} is the element itself.","additionalProperties":true},"output":{"enum":["docx","pdf"],"type":"string","default":"docx","description":"docx (default) or pdf (the filled file rendered by LibreOffice; priced higher)."},"delivery":{"enum":["base64","url"],"type":"string","default":"base64","description":"base64 (default): the file comes back inline as base64. url: the file is stored for 24 hours and the reply carries a download link (url, expires_at, bytes, content_type, sha256) instead of the base64, which keeps the file out of your context window."},"file_base64":{"anyOf":[{"type":"string","maxLength":13398872,"minLength":1},{"type":"null"}],"default":null,"description":"The DOCX template as base64 (at most 10 MB decoded); or use url."}}},"responseSchema":{"type":"json","example":{"file":{"name":"filled.docx","bytes":1151,"data_base64":"UEsDBBQAAAAIAAAA... (trimmed: 1,536 base64 characters in the reply)","content_type":"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},"output":"docx","missing":[],"operation":"docx-fill","input_bytes":1158,"output_bytes":1151,"untrusted_content":true,"placeholders_filled":10,"unmatched_loop_tags":[]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_DjnSPvqEugKGBXzUMEr3Y","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fills a DOCX template with JSON data, replacing {{placeholders}} and repeating table rows for lists, returning a filled DOCX or PDF file.","exampleAgentPrompt":"Take my invoice DOCX template at https://example.com/invoice_template.docx, fill it with this data — customer name 'Acme Corp', amount '$4,200', due date 'June 15 2025' — and give me back a PDF.","exampleUseCases":[{"title":"Auto-generate client contracts","prompt":"I have a contract template DOCX at https://storage.example.com/contract.docx — fill in the client name 'Riverstone LLC', start date 'July 1 2025', and monthly fee '$2,500', then return the filled document as a downloadable link in PDF format."},{"title":"Personalized invoice generation","prompt":"Use my invoice template (I'll send it as base64) and fill it with customer 'Jane Smith', invoice number 'INV-0042', line items for 'Consulting – $800' and 'Design – $350', and give me back the filled DOCX inline."},{"title":"Certificate of completion bulk fill","prompt":"Here's my certificate template URL: https://cdn.example.com/cert_template.docx — fill in recipient name 'Carlos Mendes', course 'Advanced Python', completion date 'May 30 2025', and export it as a PDF with a download link so I can email it to him."}],"resultDescription":"Returns a JSON object with the filled file (as base64 data or a 24-hour download URL), the output format, number of placeholders filled, a list of missing/unmatched placeholders, and file metadata (bytes, content_type).","failureModes":["Template URL is private, internal, or IP-literal — returns refusal error","DOCX file exceeds 20 MB (URL) or 10 MB (base64) — returns size error","JSON data object exceeds 1 MB or 12 nesting levels — returns validation error","Malformed or non-DOCX file provided — returns parsing error","PDF rendering failure via LibreOffice — returns conversion error","Unmatched loop tags in template — returned in unmatched_loop_tags field without hard failure"],"whenToPreferThis":"Choose this endpoint when you need to merge structured JSON data into a DOCX template with {{placeholder}} syntax, especially when you need loop/table repetition for list data or want the result as a rendered PDF — it handles both simple mail-merge and complex tabular document generation in one call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-14T11:56:33.969Z","isFirstParty":false,"canonicalSlug":"tanod-docs-docx-template-fill-8ea9b093"}