CURL - The Fastest Way to Get Started
No installation required. Test our API directly from your terminal in seconds. CURL works everywhere and is the best way to understand our API before integrating with SDKs.
Zero Setup
Already installed on Mac/Linux
Universal
Works with any language
Scriptable
Easy to automate
Debug Friendly
See raw requests/responses
# Generate a PDF - it's this simple! curl -X POST https://api.pdfmodule.com/v1/render \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "template": "invoice", "data": { "invoice_number": "INV-2024-001", "customer_name": "Acme Corporation", "items": [ {"description": "Professional Services", "quantity": 10, "unit_price": 150.00} ], "total": 1500.00 } }'
Download Official SDKs
Python SDK
Full-featured Python client with type hints, dataclasses, and comprehensive error handling. Works with Python 3.7+.
Node.js SDK
Modern async/await JavaScript client. Works with Node.js 14+ and supports both CommonJS and ES modules.
PHP SDK
Clean PHP 7.4+ client using cURL. No external dependencies required. Perfect for Laravel, Symfony, or vanilla PHP.
Go SDK
Idiomatic Go client with full type safety. Supports Go 1.18+ with generics and context support.
Complete CURL Reference
# Basic render request curl -X POST https://api.pdfmodule.com/v1/render \ -H "Authorization: Bearer pm_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{ "template": "invoice", "data": { "invoice_number": "INV-2024-001", "customer_name": "Acme Corp", "items": [{"description": "Widget", "qty": 10, "price": 29.99}], "total": 299.90 } }' # Render with specific version curl -X POST https://api.pdfmodule.com/v1/render \ -H "Authorization: Bearer pm_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{"template": "invoice", "version": 3, "data": {...}}' # Download PDF directly (pipe to file) curl -X POST https://api.pdfmodule.com/v1/render \ -H "Authorization: Bearer pm_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{"template": "invoice", "data": {...}}' \ | jq -r '.url' | xargs curl -o invoice.pdf
# Validate data without rendering (saves API calls) curl -X POST https://api.pdfmodule.com/v1/validate \ -H "Authorization: Bearer pm_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{ "template": "invoice", "data": { "customer_name": "Test" } }' # Response shows missing fields # { # "valid": false, # "errors": ["Missing required field: invoice_number"], # "warnings": ["Field 'items' is empty"] # }
# List all templates curl -X GET https://api.pdfmodule.com/v1/templates \ -H "Authorization: Bearer pm_live_xxxxx" # Get single template curl -X GET https://api.pdfmodule.com/v1/templates/invoice \ -H "Authorization: Bearer pm_live_xxxxx" # Create new template curl -X POST https://api.pdfmodule.com/v1/templates \ -H "Authorization: Bearer pm_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{ "name": "Invoice Template", "slug": "invoice", "body_html": "Invoice {{invoice_number}}
...", "page_size": "A4" }' # Lock template (makes it immutable) curl -X POST https://api.pdfmodule.com/v1/templates/invoice/lock \ -H "Authorization: Bearer pm_live_xxxxx" # Get template versions curl -X GET https://api.pdfmodule.com/v1/templates/invoice/versions \ -H "Authorization: Bearer pm_live_xxxxx"
# List recent documents curl -X GET "https://api.pdfmodule.com/v1/documents?limit=10" \ -H "Authorization: Bearer pm_live_xxxxx" # Get document by UUID curl -X GET https://api.pdfmodule.com/v1/documents/550e8400-e29b-41d4-a716-446655440000 \ -H "Authorization: Bearer pm_live_xxxxx" # Download PDF file curl -X GET https://api.pdfmodule.com/v1/documents/550e8400.../download \ -H "Authorization: Bearer pm_live_xxxxx" \ -o document.pdf
# Get current user info curl -X GET https://api.pdfmodule.com/v1/auth/me \ -H "Authorization: Bearer pm_live_xxxxx" # Get usage statistics curl -X GET https://api.pdfmodule.com/v1/account/usage \ -H "Authorization: Bearer pm_live_xxxxx" # Response: # { # "pdfs_used_this_month": 1234, # "pdf_limit": 5000, # "plan": "production", # "billing_cycle_start": "2024-01-01" # } # List API keys curl -X GET https://api.pdfmodule.com/v1/account/api-keys \ -H "Authorization: Bearer pm_live_xxxxx"