EveryPapers API Documentation
Integrate EveryPapers into your web app, ERP, or SaaS platform to generate pixel-perfect PDF and DOCX documents in milliseconds. Use standard Microsoft Word templates with dynamic data, repeating tables, custom file naming, and automated webhook delivery.
How EveryPapers Works
EveryPapers separates visual template design from business data. You design documents once in Microsoft Word or Google Docs using natural double-curly placeholders like {{customer_name}}, and your system triggers asynchronous generation via a single REST call.
Design in Word
Create a .docx file. Format text, brand colors, fonts, and repeating table rows using double-curly tags.
Upload Template
Upload your file via /v1/upload_template or the dashboard to obtain a permanent template_id.
Post JSON Data
Send dynamic records to /v1/generate_document. Queue 1 to 200 documents in a single request.
Receive Document
Get signed download URLs instantly via webhook callback, status polling, or automatic direct email delivery.
60-Second Quickstart
Generate your first document right now. Pass your x-api-key, template ID, target format ("pdf" or "docx"), and data records.
Authentication & Rate Limits
All EveryPapers endpoints require an API Key passed in the x-api-key HTTP header. You can generate and rotate keys anytime from your EveryPapers Dashboard.
ep_ prefixed tokens
Every active key starts with ep_ (e.g. ep_a4b91f0c...). Never commit keys to client-side code.
1,000 Documents / Day
Free accounts include 1,000 document generations every calendar day. Limits reset automatically at 00:00 UTC.
Up to 200 Records / Call
Submit between 1 and 200 records in a single payload. Multi-record jobs are bundled into a high-speed ZIP file.
x-api-key in front-end JavaScript or mobile apps.
Template Syntax & Tag Rules
EveryPapers processes standard .docx files created with Word, Google Docs, or LibreOffice. Tags use standard double-curly braces. The engine preserves all your font families, colors, text sizes, bold/italic stylings, and cell borders.
Simple Merge Fields
Maps directly to keys in your record's fields: {} object. Works across paragraphs, headers, footers, and table cells.
Dynamic Table Rows
Place inside a single table row. The prefix before the dot (items) binds to tables.items: [...], auto-duplicating the row.
Custom File Naming
Set "fileName": "Invoice_Acme" in each record. The resulting PDF/DOCX (and internal ZIP entries) will be named Invoice_Acme.pdf.
table_chart How Dynamic Repeating Tables Work
To render line items (such as invoices, bills of materials, or attendance records), create a table in your Word document with a header row and exactly one template row. Use the dot notation matching your JSON array key:
| Description | Qty | Price | Total |
|---|---|---|---|
| {{items.description}} | {{items.qty}} | {{items.rate}} | {{items.amount}} |
| Total: | {{total_amount}} | ||
💡 Notice: The row containing {{items.*}} will be repeated automatically for every object in tables.items. The Header and Total rows stay untouched!
| Description | Qty | Price | Total |
|---|---|---|---|
| Enterprise Cloud Subscription | 1 | $1,200.00 | $1,200.00 |
| Priority 24/7 Support Tier | 1 | $250.00 | $250.00 |
| Total: | $1,450.00 | ||
✅ All font weights, alignments, borders, and margins configured in Word are pixel-accurately preserved!
preview End-to-End Visual Workflow
{
"records": [{
"fileName": "Inv_1001",
"fields": {
"customer_name": "Acme Corp",
"invoice_number": "INV-1001",
"total_amount": "$1,450.00"
},
"tables": {
"items": [
{"description": "Hosting", "amount": "$950"},
{"description": "SSL Cert", "amount": "$500"}
]
}
}]
}
REST API Reference
Base URL: https://api.everypapers.com
/v1/upload_template
Upload a DOCX template encoded in Base64 (max 20MB). EveryPapers validates the DOCX format, inspects and extracts all mergeFields and tables, uploads it securely to cloud storage, and returns a unique template_id for document generation.
Request Headers
JSON Body Parameters
template_name
string (required, max 100)
Human-readable name for identifying the template (e.g. "Tax Invoice 2026").
template_description
string (optional, max 500)
Optional notes or version metadata describing this template.
content
string (required, Base64)
Base64-encoded binary string of your valid .docx template file (up to 20MB).
/v1/analyze_template
Analyze any template to inspect what variables and repeating tables it contains before generating documents. You can provide an existing template_id (form-data) OR upload a file directly via multipart/form-data.
Request Headers
Form Parameters (Provide at least one)
template_id
string (optional)
The ID of an already uploaded template (e.g. TMP_A1B2C3D4).
file
file (optional)
A local DOCX template binary uploaded directly via multipart form data.
/v1/generate_document
Core Engine Endpoint
Queue asynchronous document generation for 1 to 200 records. Produces pixel-accurate PDF or editable DOCX files. When generating a single record, you get a direct download URL. When generating 2+ records, EveryPapers automatically builds and optimizes a compressed ZIP archive containing all individual documents.
Request Headers
JSON Body Parameters
template_id
string (required)
The template ID created via upload or visible in your dashboard.
document_format
string (optional, default: "docx")
Choose "pdf" for print-ready vector PDF or "docx" for editable Word files.
records
array of objects (required, 1-200 items)
Array of data objects. Each record can contain:
• fileName: Custom output name (e.g. "Invoice_1001").
• fields: Key-value map for standard tags.
• tables: Map of array items for repeating table rows.
webhook_url
string (optional)
Public HTTPS URL that receives a POST event when rendering completes.
email
string (optional)
Sends an automated email notification with the secure download link upon completion.
/v1/job_status
Check the real-time processing status of your document generation job. Once completed, this endpoint provides the secure signed download_url (valid for 1 hour).
Query Parameters
job_id
string (required)
The 32-character job identifier returned by /v1/generate_document.
Possible Job Status Values
Webhooks Integration
Instead of polling /v1/job_status, pass a webhook_url in your generation request. When document rendering finishes, EveryPapers sends an instantaneous HTTPS POST callback.
Event: document.ready
The payload contains the complete job status, total record count, timestamp, and a signed download URL valid for 60 minutes.
.pdf or .docx with custom filename.everypapers_{job_id}.zip bundle.Example Webhook Handlers
app.post('/webhooks/everypapers', (req, res) => {
const { event, job_id, status, download_url } = req.body;
if (event === 'document.ready' && status === 'completed') {
console.log(`Job ${job_id} ready at: ${download_url}`);
// Save to database or forward to client
}
// Return 200 to acknowledge receipt
res.status(200).send('OK');
});
@app.route('/webhooks/everypapers', methods=['POST'])
def handle_webhook():
payload = request.get_json()
if payload.get('event') == 'document.ready':
download_url = payload.get('download_url')
print(f"Document ready: {download_url}")
# Process file or update database
return 'OK', 200
Error Handling & Status Codes
EveryPapers uses standard HTTP response codes and returns descriptive error envelopes in the format:
{"error": "message"}.
tips_and_updates Common Integration Mistakes & Solutions
Putting {{item.name}} in Word, but naming the JSON object tables: {"items": [...]}.
Fix: Ensure the word before the dot exactly matches your JSON key: {{items.name}}.
Passing data URLs like data:application/...;base64, in /v1/upload_template.
Fix: Strip any data URI prefix and send only the pure Base64 string.
Storing the signed Google Storage download URL in your database for weeks.
Fix: Signed URLs expire after 1 hour. Download the file into your own S3/GCS bucket or local storage right after receiving it.