> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to DocuGenerate

The DocuGenerate connector lets your AI agent act in each user's DocuGenerate account. Each user connects their own DocuGenerate API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 8 tools.

**Authentication:** API Key
**Categories:** Files & Documents
**Tools:** 8: 4 read, 2 write, 2 destructive
**Users sign in with:** API key
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=DOCUGENERATE)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the DocuGenerate connection

   In **AgentKit > Connections**, create a DocuGenerate connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'docugenerate'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize DocuGenerate:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'docugenerate_templates_list',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "docugenerate"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize DocuGenerate:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="docugenerate_templates_list",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their DocuGenerate credentials there. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'docugenerate_document_get',
  toolInput: {
    document_id: '<document_id>',
  },
  connector: 'docugenerate',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="docugenerate_document_get",
    tool_input={
        "document_id": "<document_id>",
    },
    connection_name="docugenerate",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `docugenerate_document_get`

Get Document · Read-only

Get one generated document.
Returns its name, template id, format, page count, document_uri (download link) and creation time.
Use documents_list to find document IDs.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_id` (`string`, required): ID of the generated document. Get it from documents_list or document_generate. Example: Ap7rKq2LmX9sWzT4vBnD.

Example input: `{"document_id":"<document_id>"}`

### `docugenerate_documents_list`

List Documents · Read-only

List the documents generated from a template, newest first.
Returns each document's id, name, format, page count, document_uri and creation time.
Use document_get for one document.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `template_id` (`string`, required): ID of the template that was used to generate the documents. Example: hW9ZqkxGm2vSfX4LbNcE.

Example input: `{"template_id":"<template_id>"}`

### `docugenerate_template_get`

Get Template · Read-only

Get one template.
Returns its name, format, tags (the fields to fill), delimiters, folder, preview and file URLs.
Use its tags as the keys of data in document_generate.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `template_id` (`string`, required): ID of the template. Get it from templates_list. Example: hW9ZqkxGm2vSfX4LbNcE.

Example input: `{"template_id":"<template_id>"}`

### `docugenerate_templates_list`

List Templates · Read-only

List your document templates, newest first, optionally filtered by folder.
Returns each template's id, name, format, tags, folder, region and creation time.
Use template_get for one template's tags.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `folder` (`array`, optional): Filter templates by folder, defined as an ordered array of folder names from root to leaf.For example, ?folder=Legal&folder=Contracts returns templates from the Legal > Contracts folder. Example: ["Legal", "Contracts"]

Example input: `{}`

### `docugenerate_document_generate`

Generate Document · Write

Generate one or more documents from a template by filling its tags with data (one document per data object, or all combined with single_file).
Returns the document id, name, page count and document_uri to download the file.
Use template_get to see which tags the data needs.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `data` (`array`, required): Array of objects whose keys match the template's tags; one document is generated per object (or one combined file with single_file). A single object also works. Example: [{"Name": "Jane Doe", "Address": "500 Market St"}].
- `template_id` (`string`, required): ID of the template to fill. Get it from templates_list. Example: hW9ZqkxGm2vSfX4LbNcE.
- `attach` (`string`, optional): File(s) to be attached to the generated document, specified as a URL or a Base64-encoded data URI, or an array of such values.If a URL is provided, the filename will be automatically determined from the URL.If a data URI is used, the filename can be specified with the name property in the URI (e.g., data:text/xml;name=invoice.xml;base64,...).If no filename is specified in the data URI, the file will be named attachment with an extension matching... Example: https://example.com/invoice.xml.
- `merge_with` (`string`, optional): PDF file(s) to be merged at the end of the generated document, specified as a URL or a Base64-encoded data URI, or an array of such values.If any document specified by a URL is not found or is not a PDF file, then that file will be ignored.If the flag single_file is false, then the PDF file(s) are merged at the end of each generated document.If multiple files are provided, they will be merged in the order they appear in the array.This parameter... Example: https://example.com/terms.pdf.
- `name` (`string`, optional): The document’s name. If not provided, it will be initialized with the template’s name.This is a logical name for identifying the document and is different from the output_name which specifies the filename of the generated document. Example: Offer letters.
- `output_format` (`string`, optional): Output format of the generated document. If no format is specified, then the default format is .docx.The supported formats are .docx, .doc, .odt, .txt, .html, .png, .pdf, .pdf/a-1b, .pdf/a-2b and .pdf/a-3b.If the format is .png, then only the first page is exported. This is useful for generating document thumbnails for example.The .pdf/a-1b, .pdf/a-2b and .pdf/a-3b formats allow selecting the PDF/A version for archival purposes. Example: .pdf. One of: `.docx`, `.doc`, `.odt`, `.txt`, `.html`, `.png`, `.pdf`, `.pdf/a-1b`, `.pdf/a-2b`, `.pdf/a-3b`.
- `output_name` (`string`, optional): The filename without extension of the generated document. If not provided, it will be initialized based on the document’s name.For example, if output_name=invoice and output_format=.pdf then the filename of the generated document will be invoice.pdf. Example: offer-letter-jane-doe.
- `output_quality` (`integer`, optional): Specifies the quality of the generated document if output_format is .pdf (or a PDF/A version) or .png. A higher value results in higher quality and file size.The lower the value, the less good is the image compression quality and the bigger is the file size. The minimum value is 1.The higher the value, the better is the image compression quality and the smaller is the file size. The maximum value is 100, which is also the default. Example: 100.
- `page_break` (`boolean`, optional): Flag indicating whether to add a page break in the document after each data row. The default value is true.The flag only applies if single_file is true. Example: true.
- `single_file` (`boolean`, optional): If the flag is true, then all the generated documents will be combined in a single file with the output_format format.If the flag is false, then for each data item a separate document will be generated with the output_format format and the all the files will be included in a .zip archive.The flag is ignored if there is only one data item, so to generate a .zip archive multiple data items are required. By default, the flag value is true. Example: true.

Example input: `{"data":[{"Name":"Jane Doe","Address":"500 Market St"}],"template_id":"<template_id>"}`

### `docugenerate_document_update`

Rename Document · Write

Rename a generated document.
Returns the updated document.
Only the name can change.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_id` (`string`, required): ID of the generated document. Get it from documents_list or document_generate. Example: Ap7rKq2LmX9sWzT4vBnD.
- `name` (`string`, required): The document’s name. Example: Offer letter - Jane Doe.

Example input: `{"document_id":"<document_id>","name":"<name>"}`

### `docugenerate_document_delete`

Delete Document · Destructive

Delete a generated document and its file.
Returns the result.
This cannot be undone.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `document_id` (`string`, required): ID of the generated document. Get it from documents_list or document_generate. Example: Ap7rKq2LmX9sWzT4vBnD.

Example input: `{"document_id":"<document_id>"}`

### `docugenerate_template_delete`

Delete Template · Destructive

Delete a template.
Returns the result.
Documents already generated from it are kept.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `template_id` (`string`, required): ID of the template. Get it from templates_list. Example: hW9ZqkxGm2vSfX4LbNcE.

Example input: `{"template_id":"<template_id>"}`

## Related

Other Files & Documents connectors ([all 76](/agentkit/connectors/?category=files-documents)):

- [Notion](/agentkit/connectors/notion/): Scalekit connector, OAuth, 51 tools
- [Google Sheets](/agentkit/connectors/googlesheets/): Scalekit connector, OAuth, 48 tools
- [Google Drive](/agentkit/connectors/googledrive/): Scalekit connector, OAuth, 47 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
