Skip to main content
POST
/
templates
/
{template_id}
/
generate-document
Generate Document from Template
curl --request POST \
  --url https://api.luminpdf.com/v1/templates/{template_id}/generate-document \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "tags": {
    "Client.Name": "Acme Corp",
    "Effective.Date": "2025-08-01"
  },
  "fields": {
    "CustomerName": "John Doe",
    "AgreeToTerms": true
  },
  "variables": {
    "Company.Name": "ACME Corp",
    "Document.Name": "NDA Document"
  },
  "document_name": "My Contract"
}
'
{
  "document_name": "<string>",
  "signed_url": "<string>",
  "expires_at": 123
}

Documentation Index

Fetch the complete documentation index at: https://developers.luminpdf.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-Key
string
header
required

Provide your API key in the X-API-Key header, e.g., X-API-Key: YOUR_API_KEY.

Path Parameters

template_id
string
required

ID of the template to generate document from.

Body

application/json
tags
object

Key–value pairs for Merge Tags defined in the Sign template. Keys must match tag names. Values replace the corresponding tags and are rendered as plain text in the generated document.

fields
object

Key–value pairs for Form Fields defined in the template. Keys must match field names. Values prefill the corresponding fields in the generated document.

variables
object

Key–value pairs for Variables defined in the AgreementGen template. Keys must match variable names. Values prefill the corresponding variables and are rendered as plain text in the generated document.

document_name
string

Optional name for the generated document. If omitted, the document name defaults to the template's name.

Response

Returns the generated document.

document_name
string
required

Name of the generated document (from input or default).

signed_url
string<uri>
required

Signed HTTPS URL to download the generated document. Expires in 30 minutes.

expires_at
integer<unix-epoch>
required

Unix epoch timestamp (in seconds) indicating when signed_url will no longer work.