Skip to main content
POST
Trigger template

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
payload
object
required

Data context (source) for all template expressions. No schema required — completely flexible and user-defined. Every key in the payload becomes an identifier available in template tags. Example: payload {"client_name": "Acme", "invoice_number": "INV-001"} makes {client_name} and {invoice_number} available in the template. Nested objects and arrays are fully traversable: {client.address.city}, {items.0.price}, {#items}...{/items}. Missing fields render as empty (not errors) — use conditionals like {#field}...{/} to handle optional data. Structure your payload to match the identifiers referenced in your template; the API does not validate field matching.

Example:
list
object[]
required

One or more template trigger entries. Each queues an independent generation job rendered against the shared payload; per-entry output overrides take precedence over the template's stored output configuration.

Response

Trigger jobs queued. The response is per-template: entries with a subject were queued successfully (the subject identifies the document record to poll); entries with errors failed validation and no job was queued for them. A 200 therefore does not guarantee every template was triggered — check each result.

template
string
required

Template key that was triggered.

Example:

"invoice-template"

subject
string

Messaging subject of the queued document (ms.document.document.{sanitised filepath}). Present on success — poll GET /documents/{key} with the corresponding key to observe generation progress.

Example:

"ms.document.document.invoices.2026.invoice-INV-2026-014.pdf"

errors
string[]

Validation or processing errors. Present on failure.

Example: