Skip to main content
POST
Create Document via API
When your automation’s data source is set to API, you pass all field data directly in the request body. This is the most flexible option, as you control exactly what data goes into the document.

Endpoint

Request Body

string
required
The automation ID. Find it on the automation’s settings page or via GET /automations.
object
required
Key-value pairs for template placeholders. Keys must match the placeholder names in your template (e.g., {{customer_name}} in your template → "customer_name" in the data object). Line items are also included inside this object as line_items_1, line_items_2, etc. — see Example with Line Items below.
string
Custom name for the generated document. Overrides the automation’s document name setting.
boolean
default:"false"
When true, returns immediately with a jobId (HTTP 202). Poll GET /job/{jobId} for the result.
object
Custom parameters passed through to webhook notifications under both webhookParams and additionalParams (identical content; the latter is kept for backward compatibility).
boolean
default:"false"
When true, skips e-signing for this request even if the automation has e-signing enabled. The document is generated and delivered normally (Drive save, email, webhook), but no signing session is started and no signing invitations are sent. Useful for two-step approval flows: generate a draft for review first, then re-run without skipEsign to send the document for signing. Also accepted as a query parameter (?skipEsign=true) on GET requests.
object[]
Who signs or accepts this document. Each entry is { "signer": 1, "email": "anna@acme.com", "name": "Anna Weber" }. signer is the signer’s number in the automation: for signing it matches the number in the template tags (1 in {{esign.signature_1}}), for acceptance it is the position in the Recipients list. name is optional; without it the name set in the automation is used.A listed signer’s email and name replace the saved ones for this document only. Signers you leave out keep their saved setup, and nothing is saved on the automation. The automation decides how many signers there are, so recipients never adds a signer. You can leave out signer when the automation has exactly one signer. With two or more signers, every entry needs it.In the automation’s Signing & Acceptance settings, a signer’s email can be set to Given with each request. This option is available for API and MCP automations and automations without a data source. Every request must then name that signer in recipients, or it fails with “Signer 1 needs an email: pass it in recipients”.The request fails before anything is generated when a signer number does not exist, the same signer is listed twice, an email is invalid, or the automation has no signing or acceptance step.
string
Email address of the team member generating this document. When the automation’s email delivery (or e-signature email settings) has Send from the team member who generates the document enabled, the email is sent from this member’s own connected Gmail or Outlook account instead of the configured sender. The address must match a mailbox connected to the workspace; otherwise DocsAutomator falls back to the automation’s configured sender. Also accepted as a query parameter (?actingUserEmail=...) on GET requests or as an X-Acting-User-Email request header (the header takes precedence). The in-app Generate button passes this automatically.
string[]
Array of publicly accessible PDF URLs to merge or prepend to the generated document.
Override the automation’s Google Doc template URL for this request only. Pass a full Google Docs URL or just the document ID.

Basic Example

Example with Line Items

Pass line items as arrays inside the data object. Use line_items_1 for the first group, line_items_2 for a second group, and so on — there is no limit on the number of line item groups. Each object’s keys must match the line item placeholder names in your template.

Nested Line Items

Use the children key for nesting (up to 2 levels):
Learn more about setting up line items in your template in the Line Items guide.

Images

Any placeholder whose name contains image is filled with a picture. Pass a publicly accessible URL as the value (a single URL, or an array for a multi-image placeholder):
To make an image a clickable link, pass it as a { "url", "link" } object instead of a plain URL string. No automation setup is required, and the link survives PDF export (Google Doc and Word templates). Arrays work too, with a link per image:
See Dynamic Images for supported formats, resizing, choosing which image to insert, and clickable links.

Async Mode

For high-volume or latency-sensitive workflows, use async mode. The API returns a jobId immediately, and you poll for the result.

Response

Sync mode (200)

message, pdfUrl and documentName are always present. Additional fields are included depending on your automation’s configuration:

Async mode (202)

Last modified on September 24, 2026