Documents

Create a document

Changed on

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

Request body

automationIdstring required

The automation ID to execute.

docIdstring

Also accepted instead of automationId, so existing integrations keep working. Send only one of the two: different values in automationId and docId fail with HTTP 400.

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.

wordTemplateLinkstring uri

Word templates only. An https link to a .docx file (up to 25 MB) to use instead of the automation's Word template for this request only. The data, mapping, signing and output settings still come from the automation in docId.

wordTemplateBase64string byte

Word templates only. The .docx file itself, base64 encoded (up to 25 MB before encoding), to use instead of the automation's Word template for this request only. Send either wordTemplateLink or wordTemplateBase64, not both.

pdfTemplateLinkstring uri

PDF templates only. An https link to a PDF (up to 25 MB) to use as the background for this request only. The automation's saved fields are placed on it at their saved positions; the PDF must have every page that holds a saved field. On a page with a different size, fields keep their distance from the top-left corner and are not scaled, and the response lists the page in warnings.

pdfTemplateBase64string byte

PDF templates only. The PDF itself, base64 encoded (up to 25 MB before encoding), to use as the background for this request only. Send either pdfTemplateLink or pdfTemplateBase64, not both.

Example request

{
  "automationId": "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",
  "wordTemplateLink": "https://example.com/templates/proposal.docx",
  "pdfTemplateLink": "https://example.com/checks/check-1043.pdf",
  "recipients": [
    {
      "signer": 1,
      "email": "anna@acme.com",
      "name": "Anna Weber"
    }
  ]
}

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' | 'awaiting_approval'

Status of the signing session creation. awaiting_approval means the automation needs internal approval: nothing went to the signers yet, and no signing links are returned.

Example response

{
  "message": "success"
}

Changes

    • warning

      added the new awaiting_approval enum value to the response property for the response status

    • info

      added the optional property to the response with the status

    • info

      added the new optional request property

    • info

      added the new optional request property