DocsAutomator API
DocsAutomator offers a powerful REST API to create documents from anywhere and list, create, update and delete your DocsAutomator automations.
Intro
DocsAutomator's API allows you to generate documents programmatically from code. In addition, it offers endpoints to perform all CRUD actions on automations (create, read, update, delete) as well as listing placeholders of documents, copying a Google Doc tempate with code and more.
The API can be utilised to add a performant document creation solution into any software. If you have any questions, please reach out via chat or to [email protected].
If you haven't created a template yet, please start with the guide here: Google Doc Template Guide
Authorization
DocsAutomator uses API keys for authentication. The API key is passed like so:
Authorization: Bearer API_KEYError Responses
The API will send descriptive error responses for a variety of errors that can occur during document creation requests. Please find the most common errors listed below:
Please make sure you're passing the correct API key. Otherwise, you'll receive the following error:
{
"message": 'Incorrect / missing API key'
}Google's refresh token is valid for 60 days and might expire. Please re-authenticate in this case under settings in your DocsAutomator account.
{
"message": "No refresh token found, please re-authenticate Google"
}Please makes you're passing a valid automation id ("docId").
{
"message": "Please add a valid automation id with key 'docId' to the request."
}Please makes you're passing a valid automation id ("docId") which is part of the authenticated user.
{
"message": "Automation / template id does not exist or is not part of the account with the given API key. Please check in your DocsAutomator account."
}Please make sure to set a Google Doc template in your automation.
{
"message": "No Google Docs template set for the given document id. Please set a template in your DocsAutomator account."
}If you've reached your documents limit, you will receive the following:
{
"message": "You have reached your documents limit. Please upgrade your plan: https://app.docsautomator.co/subscribe"
}Please make sure the automation is active when sending requests:
{
"message": "Automation is not active. Please activate automation in your DocsAutomator account."
}Endpoints
This endpoint triggers document creation as a POST request. For successes, you will receive a JSON response with the URL of the created PDF and optionally the URL of the Google Doc (if enabled in your automation). Error messages are returned as JSON.
Line Items: If your template contains line items (repeating rows), pass them as arrays named line_items_1, line_items_2, etc. Each array contains objects with keys matching your template placeholders.
Nested Line Items: For hierarchical data (categories with sub-items), use the reserved children property within each line item object. The children property contains an array of nested items, and each child can also have its own children array for up to 3 levels of nesting.
Content type header
application/jsonAuthorization header with Bearer token
Bearer {apiKey}The ID of the document
The name of the generated document (data source API only)
Record ID for Airtable (Airtable only — data not required)
Task ID for ClickUp (ClickUp only — data not required)
Document created successfully
POST /createDocument HTTP/1.1
Host: api.docsautomator.co
Authorization: Bearer {apiKey}
Content-Type: application/json
Accept: */*
Content-Length: 797
{
"docId": "text",
"documentName": "text",
"recId": "text",
"taskId": "text",
"data": {
"placeholderOne": "text",
"placeholderTwo": "text",
"line_items_1": [
{
"product_name": "Consulting Services",
"quantity": "5",
"unit_price": "150.00",
"line_total": "750.00"
},
{
"product_name": "Software License",
"quantity": "1",
"unit_price": "299.00",
"line_total": "299.00"
}
],
"line_items_2": [
{
"expense_description": "Travel costs",
"expense_amount": "250.00"
}
],
"line_items_1_with_nested_children": [
{
"category_name": "Hardware",
"category_subtotal": "549.97",
"children": [
{
"item_name": "Keyboard",
"item_price": "149.99"
},
{
"item_name": "Mouse",
"item_price": "79.99"
},
{
"item_name": "Monitor Stand",
"item_price": "319.99"
}
]
},
{
"category_name": "Software",
"category_subtotal": "199.00",
"children": [
{
"item_name": "Productivity Suite",
"item_price": "199.00"
}
]
}
]
}
}Document created successfully
{
"pdfUrl": "https://firebasestorage.googleapis.com/v0/b/docsautomator.appspot.com/o/1krzffnfKYAEO6gbOmvIHfnOqw6-OjaDSzemLkQb1yjM.pdf?alt=media&token=194fd896-e303-4e7c-8abd-d5718b91723c",
"googleDocUrl": "https://docs.google.com/document/d/1RQqb0JqkCHSp0WaJGuRAVt85C4yxxizV48kyhBPXoug/edit",
"savePdfGoogleDriveFolderId": "1RQqb0JqkCHSp0WaJGuRAVt85C4yxxizV48kyhBPXoug"
}Successful response
Unauthorized
User not found
Internal server error
GET /automations HTTP/1.1
Host: api.docsautomator.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"automations": [
{
"dataSource": {
"airtableLinkedFields": [
"text"
],
"name": "text",
"airtableBaseId": "text",
"airtableTableId": "text"
},
"imageOptions": {
"quality": "text",
"maxWidth": 1
},
"options": {
"lineDeletions": [
"text"
]
},
"title": "text",
"dateCreated": "2025-12-06T14:04:56.424Z",
"locale": "text",
"isActive": true,
"formatNumbersWithLocale": true,
"pdfExpiration": "2025-12-06T14:04:56.424Z",
"_id": "text",
"docTemplateLink": "text",
"newDocumentNameField": "text",
"attachmentField": "text",
"lastPreviewPdf": "text",
"dataSourceName": "text"
}
]
}The ID of the automation document
Automation updated successfully
Bad request
Unauthorized
Document not found
Internal server error
PUT /updateAutomation?docId=text HTTP/1.1
Host: api.docsautomator.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 2
{}{
"message": "text",
"updatedAutomation": {
"title": "text",
"docTemplateLink": "text",
"newDocumentNameField": "text",
"attachmentField": "text",
"locale": "text",
"dataSource": {
"name": "text",
"airtableBaseId": "text",
"airtableTableId": "text",
"airtableLinkedFields": [
"text"
]
},
"fields": {},
"saveGoogleDoc": true,
"overwriteAttachment": true,
"isActive": true,
"isPreview": true,
"lastPreviewPdf": "text",
"googleDocDestinationFolderUrl": "text",
"googleDocUrlField": "text",
"dateFormat": "text",
"formatNumbersWithLocale": true,
"pdfExpiration": "2025-12-06T14:04:56.424Z",
"imageOptions": {
"quality": "text",
"maxWidth": 1
},
"options": {
"lineDeletions": [
"text"
]
}
}
}The ID of the automation document
Automation deleted successfully
Unauthorized
Document or user not found
Internal server error
DELETE /deleteAutomation?docId=text HTTP/1.1
Host: api.docsautomator.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"message": "text",
"user": {}
}This endpoint lists placeholders in an automation. The response includes all placeholders for main document and line items.
The ID of the automation
Placeholders listed successfully
Unauthorized
Automation or user not found
Internal server error
GET /listPlaceholdersV2?automationId=text HTTP/1.1
Host: api.docsautomator.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"placeholders": {
"main": [
"text"
],
"line_items_1": [],
"line_items_2": []
}
}The ID of the automation to duplicate
Automation duplicated successfully
Unauthorized
Automation or user not found
Internal server error
POST /duplicateAutomation?automationId=text HTTP/1.1
Host: api.docsautomator.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"newAutomationId": "text"
}The ID of the automation containing the template to duplicate
The name for the new template
Google Doc template duplicated successfully
Bad request
Unauthorized
Automation or user not found
Internal server error
POST /duplicateGoogleDocTemplate?automationId=text HTTP/1.1
Host: api.docsautomator.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"message": "text",
"newTemplateId": "text",
"url": "text"
}Automation created successfully
Bad request
Unauthorized
Internal server error
POST /createAutomation HTTP/1.1
Host: api.docsautomator.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 65
{
"title": "text",
"dataSourceName": "text",
"docTemplateLink": "text"
}{
"message": "text",
"newAutomation": {
"title": "text",
"dateCreated": "2025-12-06T14:04:56.424Z",
"docTemplateLink": "text",
"dataSource": {
"name": "text"
},
"_id": "text"
}
}Last updated
