Page cover

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

circle-info

Integration developers: If you're interested in building an integration for DocsAutomator, please reach out to support.

Authorization

DocsAutomator uses API keys for authentication. The API key is passed like so:

Authorization: Bearer API_KEY

Error 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'
}

Endpoints

Create a new document

post

This endpoint triggers document creation as a POST request. Choose ONE of the following patterns based on your data source:

Pattern 1: API Data Source - Pass docId + data object with your placeholder values

Pattern 2: Airtable - Pass docId + recId (record ID) to fetch data from Airtable

Pattern 3: Google Sheets - Pass docId + rowId (row number) to fetch data from a specific row

Pattern 4: ClickUp - Pass docId + taskId to fetch data from a ClickUp task

Pattern 5: One-off Document - Pass docTemplateLink + data to generate a document without a saved automation

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Header parameters
Content-TypestringRequired

Content type header

Example: application/json
AuthorizationstringRequired

Authorization header with Bearer token

Example: Bearer {apiKey}
Body
or
or
or
or
Responses
chevron-right
200

Document created successfully

application/json
post
/createDocument

Get workspace automations

get
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
chevron-right
200

Successful response

application/json
get
/automations

Update an automation

put
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
docIdstringRequired

The ID of the automation document

Body
objectOptional
Responses
chevron-right
200

Automation updated successfully

application/json
put
/updateAutomation

Delete an automation

delete
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
docIdstringRequired

The ID of the automation document

Responses
chevron-right
200

Automation deleted successfully

application/json
delete
/deleteAutomation

List placeholders in automation

get

This endpoint lists placeholders in an automation. The response includes all placeholders for main document and line items.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
automationIdstringRequired

The ID of the automation

Responses
chevron-right
200

Placeholders listed successfully

application/json
get
/listPlaceholdersV2

Duplicate an automation

post
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
automationIdstringRequired

The ID of the automation to duplicate

Responses
chevron-right
200

Automation duplicated successfully

application/json
post
/duplicateAutomation

Duplicate a Google Doc template

post
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
automationIdstringRequired

The ID of the automation containing the template to duplicate

newTemplateNamestringOptional

The name for the new template

Responses
chevron-right
200

Google Doc template duplicated successfully

application/json
post
/duplicateGoogleDocTemplate

Create a new automation

post
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
titlestringRequired
dataSourceNamestringRequired
docTemplateLinkstring · nullableOptional
Responses
post
/createAutomation

Last updated