Skip to content

Generate PDFs via API

DocSpring generates PDFs by filling your templates with submission data. Templates can either be uploads that you annotate in the Template Editor or fully custom HTML/CSS layouts that you host in DocSpring.

POST /api/v1/templates/{template_id}/submissions

Every submission must include:

  • data — Field values that match your template schema.
  • test — Use true for free, watermarked PDFs while building your integration.
  • metadata — Optional map for values you want echoed back in webhooks.
  • version — Choose draft, latest, or a specific version such as 1.2.3.

Optional parameters:

  • wait — Decide between synchronous and asynchronous processing.
  • editable — Keep the resulting PDF fillable or flatten the form fields.
  • expires_in — Set a TTL for the generated PDF download link.
  • field_overrides — Temporarily adjust field requirements or defaults.
  • data_requests — Kick off a data collection or signature workflow before finalizing the PDF.

Submissions sent to sync.api.docspring.com wait for processing and return the download_url in the response. Switching wait=false or using the asynchronous domain returns immediately with a pending submission. See Sync vs. Async Processing for flow diagrams, polling tips, and webhook guidance.

Need to create many PDFs at once? Use the batch endpoint to submit up to 50 requests together. Each entry can target a different template, switch between test/live, and specify its own metadata.