Actions16
- Document Actions
- Template Actions
- Recipient Actions
- Field Actions
Template → Generate Document From Template
AI-generatedSummary
POST /api/v1/templates/:templateId/generate-document
Inputs
- templateId (required) — ID of the template to generate a document from
- templateRecipients (required) — Recipient overrides for the generated document; at least one override required. Each override includes templateRecipientId, email, name, and signingOrder.
- templateAdditionalFields — Optional additional fields merged into the generation request. Supports title, externalId, formValuesJson, metaJson, prefillJson, and authOptionsJson.
Output shape
Generated document JSON from SpaceSign API
The node processes templateRecipients via helper S, mapping each to {id, email, name, signingOrder}. Optional additional fields are transformed: prefillJson→prefillFields, formValuesJson→formValues, metaJson→meta, authOptionsJson→authOptions. Title and externalId are passed through if present.
Examples
Example 1: Generate a document from a template with a single recipient override and custom title
templateId: 'abc123', templateRecipients: [{templateRecipientId: 'rec1', email: 'user@example.com', name: 'John Doe', signingOrder: 1}], templateAdditionalFields: {title: 'Custom Title'}