> **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 Draftable

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

**Authentication:** API Key
**Categories:** Files & Documents, Productivity
**Tools:** 6: 3 read, 2 write, 1 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=DRAFTABLE)

## 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 Draftable connection

   In **AgentKit > Connections**, create a Draftable 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 = 'draftable'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Draftable:', 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: 'draftable_comparisons_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 = "draftable"
   identifier = "user_123"

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

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

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their Draftable 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: 'draftable_comparison_get',
  toolInput: {
    identifier: '<identifier>',
  },
  connector: 'draftable',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="draftable_comparison_get",
    tool_input={
        "identifier": "<identifier>",
    },
    connection_name="draftable",
    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.

### `draftable_comparison_get`

Get Comparison · Read-only

Get one comparison and its processing state.
Returns identifier, left and right documents, public, creation_time, expiry_time, ready, ready_time, failed and error_message.
Poll this after Create Comparison until ready is true.

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

Inputs:

- `identifier` (`string`, required): Identifier of the comparison, from List Comparisons or Create Comparison. Example: uCtUqmYb.

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

### `draftable_comparisons_list`

List Comparisons · Read-only

List all comparisons in the Draftable account.
Returns comparisons with identifier, left and right documents, public, creation_time, expiry_time, ready, failed and error_message.
Use this to find a comparison identifier. Use Get Comparison for one.

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

Inputs: none.

Example input: `{}`

### `draftable_export_get`

Get Export · Read-only

Get an export and its status.
Returns identifier, comparison, kind, ready, failed and url, a signed link to download the PDF once ready.
Poll this after Create Export until ready is true.

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

Inputs:

- `identifier` (`string`, required): Identifier of the export, from Create Export. Example: Hk2mPq9z.

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

### `draftable_comparison_create`

Create Comparison · Write

Compare two documents (PDF, Word, PowerPoint or text) that Draftable downloads from URLs.
Returns the new comparison with identifier, ready false and the document details; it is usually ready within seconds.
Use Get Comparison to poll. View it at https://api.draftable.com/v1/comparisons/viewer/<account_id>/<identifier> (private comparisons need a signed URL).

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

Inputs:

- `left_file_type` (`string`, required): File type of the left document: pdf, docx, docm, doc, rtf, pptx, pptm, ppt or txt. Example: pdf. One of: `pdf`, `docx`, `docm`, `doc`, `rtf`, `pptx`, `pptm`, `ppt`, `txt`.
- `left_source_url` (`string`, required): URL Draftable downloads the left document from (a public or one-time signed URL). Example: https://api.draftable.com/static/test-documents/paper/left.pdf.
- `right_file_type` (`string`, required): File type of the right document: pdf, docx, docm, doc, rtf, pptx, pptm, ppt or txt. Example: pdf. One of: `pdf`, `docx`, `docm`, `doc`, `rtf`, `pptx`, `pptm`, `ppt`, `txt`.
- `right_source_url` (`string`, required): URL Draftable downloads the right document from (a public or one-time signed URL). Example: https://api.draftable.com/static/test-documents/paper/right.pdf.
- `expiry_time` (`string`, optional): ISO 8601 time when the comparison is deleted automatically; never when empty. Example: 2025-02-15T00:00:00Z.
- `identifier` (`string`, optional): Optional custom identifier, unique in the account (reusable after the comparison is deleted). Example: contract-2025-v1-v2.
- `left_display_name` (`string`, optional): Name shown for the left document in the viewer. Example: Contract v1.
- `public` (`boolean`, optional): Set true to let anyone with the viewer URL see the comparison; private (false) is the default. Example: false.
- `right_display_name` (`string`, optional): Name shown for the right document in the viewer. Example: Contract v1.

Example input: `{"left_file_type":"pdf","left_source_url":"<left_source_url>","right_file_type":"pdf","right_source_url":"<right_source_url>"}`

### `draftable_export_create`

Create Export · Write

Export a ready comparison as a PDF: single_page (right document with changes marked), combined (both documents interleaved), left or right only.
Returns the export with identifier, comparison, kind, ready, failed and url (empty until ready).
Use Get Export to poll for the download URL.

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

Inputs:

- `comparison` (`string`, required): Identifier of the comparison to export. Example: uCtUqmYb.
- `kind` (`string`, required): Export kind: single_page, combined, left or right. Example: single_page. One of: `single_page`, `combined`, `left`, `right`.

Example input: `{"comparison":"<comparison>","kind":"single_page"}`

### `draftable_comparison_delete`

Delete Comparison · Destructive

Delete a comparison. Its identifier can then be reused.
Returns an empty 204 response.
Use List Comparisons to find the identifier.

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

Inputs:

- `identifier` (`string`, required): Identifier of the comparison, from List Comparisons or Create Comparison. Example: uCtUqmYb.

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

## 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 |
