Create Document from Notion
curl --request POST \
--url https://api.docsautomator.co/createDocument \
--header 'Content-Type: application/json' \
--data '
{
"automationId": "<string>",
"recId": "<string>",
"pageId": "<string>",
"async": true,
"webhookParams": {},
"skipEsign": true,
"recipients": [
{}
],
"actingUserEmail": "<string>",
"docTemplateLink": "<string>",
"wordTemplateLink": "<string>",
"wordTemplateBase64": "<string>",
"pdfTemplateLink": "<string>",
"pdfTemplateBase64": "<string>"
}
'import requests
url = "https://api.docsautomator.co/createDocument"
payload = {
"automationId": "<string>",
"recId": "<string>",
"pageId": "<string>",
"async": True,
"webhookParams": {},
"skipEsign": True,
"recipients": [{}],
"actingUserEmail": "<string>",
"docTemplateLink": "<string>",
"wordTemplateLink": "<string>",
"wordTemplateBase64": "<string>",
"pdfTemplateLink": "<string>",
"pdfTemplateBase64": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
automationId: '<string>',
recId: '<string>',
pageId: '<string>',
async: true,
webhookParams: {},
skipEsign: true,
recipients: [{}],
actingUserEmail: '<string>',
docTemplateLink: '<string>',
wordTemplateLink: '<string>',
wordTemplateBase64: '<string>',
pdfTemplateLink: '<string>',
pdfTemplateBase64: '<string>'
})
};
fetch('https://api.docsautomator.co/createDocument', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.docsautomator.co/createDocument",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'automationId' => '<string>',
'recId' => '<string>',
'pageId' => '<string>',
'async' => true,
'webhookParams' => [
],
'skipEsign' => true,
'recipients' => [
[
]
],
'actingUserEmail' => '<string>',
'docTemplateLink' => '<string>',
'wordTemplateLink' => '<string>',
'wordTemplateBase64' => '<string>',
'pdfTemplateLink' => '<string>',
'pdfTemplateBase64' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.docsautomator.co/createDocument"
payload := strings.NewReader("{\n \"automationId\": \"<string>\",\n \"recId\": \"<string>\",\n \"pageId\": \"<string>\",\n \"async\": true,\n \"webhookParams\": {},\n \"skipEsign\": true,\n \"recipients\": [\n {}\n ],\n \"actingUserEmail\": \"<string>\",\n \"docTemplateLink\": \"<string>\",\n \"wordTemplateLink\": \"<string>\",\n \"wordTemplateBase64\": \"<string>\",\n \"pdfTemplateLink\": \"<string>\",\n \"pdfTemplateBase64\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.docsautomator.co/createDocument")
.header("Content-Type", "application/json")
.body("{\n \"automationId\": \"<string>\",\n \"recId\": \"<string>\",\n \"pageId\": \"<string>\",\n \"async\": true,\n \"webhookParams\": {},\n \"skipEsign\": true,\n \"recipients\": [\n {}\n ],\n \"actingUserEmail\": \"<string>\",\n \"docTemplateLink\": \"<string>\",\n \"wordTemplateLink\": \"<string>\",\n \"wordTemplateBase64\": \"<string>\",\n \"pdfTemplateLink\": \"<string>\",\n \"pdfTemplateBase64\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.docsautomator.co/createDocument")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"automationId\": \"<string>\",\n \"recId\": \"<string>\",\n \"pageId\": \"<string>\",\n \"async\": true,\n \"webhookParams\": {},\n \"skipEsign\": true,\n \"recipients\": [\n {}\n ],\n \"actingUserEmail\": \"<string>\",\n \"docTemplateLink\": \"<string>\",\n \"wordTemplateLink\": \"<string>\",\n \"wordTemplateBase64\": \"<string>\",\n \"pdfTemplateLink\": \"<string>\",\n \"pdfTemplateBase64\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyDocuments
Create Document from Notion
Trigger document generation for a Notion page via the API
POST
/
createDocument
Create Document from Notion
curl --request POST \
--url https://api.docsautomator.co/createDocument \
--header 'Content-Type: application/json' \
--data '
{
"automationId": "<string>",
"recId": "<string>",
"pageId": "<string>",
"async": true,
"webhookParams": {},
"skipEsign": true,
"recipients": [
{}
],
"actingUserEmail": "<string>",
"docTemplateLink": "<string>",
"wordTemplateLink": "<string>",
"wordTemplateBase64": "<string>",
"pdfTemplateLink": "<string>",
"pdfTemplateBase64": "<string>"
}
'import requests
url = "https://api.docsautomator.co/createDocument"
payload = {
"automationId": "<string>",
"recId": "<string>",
"pageId": "<string>",
"async": True,
"webhookParams": {},
"skipEsign": True,
"recipients": [{}],
"actingUserEmail": "<string>",
"docTemplateLink": "<string>",
"wordTemplateLink": "<string>",
"wordTemplateBase64": "<string>",
"pdfTemplateLink": "<string>",
"pdfTemplateBase64": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
automationId: '<string>',
recId: '<string>',
pageId: '<string>',
async: true,
webhookParams: {},
skipEsign: true,
recipients: [{}],
actingUserEmail: '<string>',
docTemplateLink: '<string>',
wordTemplateLink: '<string>',
wordTemplateBase64: '<string>',
pdfTemplateLink: '<string>',
pdfTemplateBase64: '<string>'
})
};
fetch('https://api.docsautomator.co/createDocument', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.docsautomator.co/createDocument",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'automationId' => '<string>',
'recId' => '<string>',
'pageId' => '<string>',
'async' => true,
'webhookParams' => [
],
'skipEsign' => true,
'recipients' => [
[
]
],
'actingUserEmail' => '<string>',
'docTemplateLink' => '<string>',
'wordTemplateLink' => '<string>',
'wordTemplateBase64' => '<string>',
'pdfTemplateLink' => '<string>',
'pdfTemplateBase64' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.docsautomator.co/createDocument"
payload := strings.NewReader("{\n \"automationId\": \"<string>\",\n \"recId\": \"<string>\",\n \"pageId\": \"<string>\",\n \"async\": true,\n \"webhookParams\": {},\n \"skipEsign\": true,\n \"recipients\": [\n {}\n ],\n \"actingUserEmail\": \"<string>\",\n \"docTemplateLink\": \"<string>\",\n \"wordTemplateLink\": \"<string>\",\n \"wordTemplateBase64\": \"<string>\",\n \"pdfTemplateLink\": \"<string>\",\n \"pdfTemplateBase64\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.docsautomator.co/createDocument")
.header("Content-Type", "application/json")
.body("{\n \"automationId\": \"<string>\",\n \"recId\": \"<string>\",\n \"pageId\": \"<string>\",\n \"async\": true,\n \"webhookParams\": {},\n \"skipEsign\": true,\n \"recipients\": [\n {}\n ],\n \"actingUserEmail\": \"<string>\",\n \"docTemplateLink\": \"<string>\",\n \"wordTemplateLink\": \"<string>\",\n \"wordTemplateBase64\": \"<string>\",\n \"pdfTemplateLink\": \"<string>\",\n \"pdfTemplateBase64\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.docsautomator.co/createDocument")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"automationId\": \"<string>\",\n \"recId\": \"<string>\",\n \"pageId\": \"<string>\",\n \"async\": true,\n \"webhookParams\": {},\n \"skipEsign\": true,\n \"recipients\": [\n {}\n ],\n \"actingUserEmail\": \"<string>\",\n \"docTemplateLink\": \"<string>\",\n \"wordTemplateLink\": \"<string>\",\n \"wordTemplateBase64\": \"<string>\",\n \"pdfTemplateLink\": \"<string>\",\n \"pdfTemplateBase64\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyWhen your automation’s data source is set to Notion, you only need to pass the ID of the Notion page you want to turn into a document. All property mapping, line items, page-body content, and output settings are pulled from the DocsAutomator app automatically.
Additional fields like
For setup instructions on connecting Notion to DocsAutomator, see the Notion integration guide.
Endpoint
POST https://api.docsautomator.co/createDocument
Request Body
string
required
The automation ID. Find it on the automation’s settings page or via
GET /automations. docId is also accepted, so existing integrations keep working. Send only one of the two: a request with different values in automationId and docId fails with HTTP 400.string
required
The Notion page ID, with or without dashes (e.g.
1a2b3c4d5e6f4708b1c2d3e4f5a6b7c8). DocsAutomator fetches all mapped properties from this page automatically.Two aliases are accepted, in this order of precedence:recId— the DocsAutomator standard, used by every data source and by the in-app Generate button.pageId— a Notion-specific alias, accepted as a body or query parameter.data.id— the payload shape Notion itself posts from a Button property configured to send a webhook. You do not build this by hand; point the button at the generation URL and Notion supplies it.
string
Notion-specific alias for
recId. Use whichever reads better in your integration.boolean
default:"false"
By default the request waits and returns the document (HTTP 200 with
pdfUrl). When true, it returns immediately with a jobId (HTTP 202) instead. Poll GET /job/{jobId} for the result.object
Custom parameters passed through to webhook notifications as
webhookParams (plus an identical additionalParams copy kept only for legacy integrations). The triggering page ID is folded in automatically; your own keys are never overwritten.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.Use it when an AI agent or your own code sends one document to a person it names at send time. The record’s data and the write-back of the signing link and signed PDF work as usual. Triggers from your data source (buttons, formula links, webhooks) do not send recipients, so they keep working exactly as set up.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."recipients": [
{ "signer": 1, "email": "anna@acme.com", "name": "Anna Weber" },
{ "signer": 2, "email": "cfo@acme.com" }
]
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, and as an
X-Acting-User-Email request header, which takes precedence.string
Override the automation’s Google Doc template URL for this request only.
string
Word templates only. Use a different Word file for this request only: an https link to a .docx file that our servers can download. The data, mapping, signing and output settings still come from the automation in
docId. The file can be up to 25 MB. Links to private or internal network addresses are refused.string
Word templates only. The same as
wordTemplateLink, but you send the .docx file itself, encoded as base64, in the JSON body. Use this when you cannot host the file. Up to 25 MB before encoding. Send either wordTemplateLink or wordTemplateBase64, not both.string
PDF templates only. Use a different PDF as the background for this request only: an https link to a PDF file that our servers can download. The automation’s saved fields are placed on this PDF at their saved positions, for example to fill in a check or a form that another tool created. The data, mapping, signing and output settings still come from the automation in
docId. The file can be up to 25 MB. Links to private or internal network addresses are refused, and so are password-protected PDFs.The PDF must have every page that holds a saved field. If a field is on a page the PDF does not have, the request fails and the error names the fields and pages. If a page has a different size from the page in the saved template, each field keeps its distance from the top-left corner of the page and is not scaled. The response then lists the affected pages in warnings.string
PDF templates only. The same as
pdfTemplateLink, but you send the PDF itself, encoded as base64, in the JSON body. Use this when you cannot host the file. Up to 25 MB before encoding. Send either pdfTemplateLink or pdfTemplateBase64, not both.Example
curl -X POST https://api.docsautomator.co/createDocument \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"automationId": "YOUR_AUTOMATION_ID",
"recId": "1a2b3c4d5e6f4708b1c2d3e4f5a6b7c8"
}'
const response = await fetch("https://api.docsautomator.co/createDocument", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
automationId: "YOUR_AUTOMATION_ID",
recId: "1a2b3c4d5e6f4708b1c2d3e4f5a6b7c8",
}),
});
const result = await response.json();
console.log(result.pdfUrl);
import requests
response = requests.post(
"https://api.docsautomator.co/createDocument",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"automationId": "YOUR_AUTOMATION_ID",
"recId": "1a2b3c4d5e6f4708b1c2d3e4f5a6b7c8",
},
)
result = response.json()
print(result["pdfUrl"])
Triggering from a Notion button
You do not have to call the API yourself. A Button property in your Notion database can send the request for you, which is the usual setup for non-technical users. See Notion button setup in the integration guide. Notion posts the source page underdata, and DocsAutomator reads the page ID from there.
Notion buttons require a Notion Plus plan or higher.
Response
{
"message": "success",
"pdfUrl": "https://files.docsautomator.co/..."
}
googleDocUrl, savePdfGoogleDriveUrl, and e-signature fields are included depending on your automation’s configuration. See the API data source page for the full list.Last modified on October 12, 2026