Documents

Create a document

Triggers document generation from an automation template (Google Doc or PDF). Supports sync mode (waits for result) and async mode (returns a job ID for polling). The response includes PDF and optional Google Doc URLs.

When the automation has e-signatures enabled and the template contains e-sign placeholders, a signing session is automatically created and included in the response.

post/createDocument

Request body

docIdstring required

The automation ID to execute. Also accepted as automationId.

dataobject

Key-value pairs for template placeholders. Keys must match placeholder names in your template (Google Doc syntax or PDF placeholder names). Line items are also included inside this object as line_items_1, line_items_2, etc. — each is an array of objects whose keys match line item placeholder names. Use the children key within line item objects for nested line items (up to 2 levels).

documentNamestring

Custom name for the generated document. Overrides the automation's document name setting.

asyncboolean

When true, returns immediately with a jobId (HTTP 202). Poll GET /job/{jobId} for the result. When false (default), the request blocks until the document is ready (up to 5 minutes).

webhookParamsobject

Custom parameters passed through to webhook notifications and stored on signing sessions. Returned in webhook payloads as webhookParams (an identical additionalParams key also exists, kept only for legacy integrations). The trigger record identifier (recId, Notion pageId, ClickUp taskId, Google Sheets rowNumber) is folded in automatically — your own keys are never overwritten.

existingPdfsstring[]

PDF URLs to merge or prepend to the generated document.

docTemplateLinkstring uri

Override the automation's Google Doc template URL for this request only.

Example request

{
  "docId": "abc123",
  "data": {
    "customer_name": "Acme Corp",
    "invoice_number": "INV-2025-001",
    "invoice_date": "2025-01-15",
    "due_date": "2025-02-15",
    "subtotal": "$5,500.00",
    "tax": "$495.00",
    "total": "$5,995.00"
  },
  "documentName": "Invoice INV-2025-001",
  "webhookParams": {
    "orderId": "ORD-123",
    "source": "api"
  },
  "existingPdfs": [
    "https://example.com/terms-and-conditions.pdf"
  ],
  "docTemplateLink": "https://docs.google.com/document/d/your-template-id/edit"
}

Response

Document created successfully (sync mode)

messagestring
pdfUrlstring uri

URL of the generated PDF.

documentNamestring

Name of the generated document.

googleDocUrlstring uri

URL of the saved Google Doc (if saveGoogleDoc is enabled).

savePdfGoogleDriveUrlstring uri

Google Drive URL of the saved PDF (if Drive saving is configured).

savePdfGoogleDriveFileIdstring

Google Drive file ID of the saved PDF.

signingSessionIdstring

E-signature session ID (if e-signing is enabled on the automation).

signingStatus'created' | 'queued'

Status of the signing session creation.

Example response

{
  "message": "success"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.