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.
- Tools
- 6
- What they doRead · write · destructive
- 3 · 2 · 13 read2 write1 destructive
- Users sign in with
- API key
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the Draftable connection
In AgentKit > Connections, create a Draftable connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Authorize a user and make your first call
quickstart.mts 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.actionsconst connector = 'draftable'const identifier = 'user_123'// Generate an authorization link for the userconst { 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 callconst result = await actions.executeTool({connector,identifier,toolName: 'draftable_comparisons_list',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_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.actionsconnection_name = "draftable"identifier = "user_123"# Generate an authorization link for the userlink_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 callresult = actions.execute_tool(tool_input={},tool_name="draftable_comparisons_list",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user opens the link once and enters their Draftable credentials there. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_tooldraftable_comparison_getGet one comparison and its processing state.Read-onlyGet Comparison
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.
Inputs
identifierstringrequired- Identifier of the comparison, from List Comparisons or Create Comparison. Example: uCtUqmYb.
draftable_comparisons_listList all comparisons in the Draftable account.Read-onlyList Comparisons
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.
Inputs
This tool takes no inputs.
draftable_export_getGet an export and its status.Read-onlyGet Export
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.
Inputs
identifierstringrequired- Identifier of the export, from Create Export. Example: Hk2mPq9z.
draftable_comparison_createCompare two documents (PDF, Word, PowerPoint or text) that Draftable downloads from URLs.WriteCreate Comparison
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).
Inputs
left_file_typestringrequired- File type of the left document: pdf, docx, docm, doc, rtf, pptx, pptm, ppt or txt. Example: pdf.one of
pdfdocxdocmdocrtfpptxpptmppttxt left_source_urlstringrequired- 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_typestringrequired- File type of the right document: pdf, docx, docm, doc, rtf, pptx, pptm, ppt or txt. Example: pdf.one of
pdfdocxdocmdocrtfpptxpptmppttxt right_source_urlstringrequired- 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_timestring- ISO 8601 time when the comparison is deleted automatically; never when empty. Example: 2025-02-15T00:00:00Z.
identifierstring- Optional custom identifier, unique in the account (reusable after the comparison is deleted). Example: contract-2025-v1-v2.
left_display_namestring- Name shown for the left document in the viewer. Example: Contract v1.
publicboolean- Set true to let anyone with the viewer URL see the comparison; private (false) is the default. Example: false.
right_display_namestring- Name shown for the right document in the viewer. Example: Contract v1.
draftable_export_createExport a ready comparison as a PDF: single_page (right document with changes marked), combined (both documents interleaved), left or right only.WriteCreate Export
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.
Inputs
comparisonstringrequired- Identifier of the comparison to export. Example: uCtUqmYb.
kindstringrequired- Export kind: single_page, combined, left or right. Example: single_page.one of
single_pagecombinedleftright
draftable_comparison_deleteDelete a comparison.DestructiveDelete Comparison
Delete a comparison. Its identifier can then be reused. Returns an empty 204 response. Use List Comparisons to find the identifier.
- Idempotent
Inputs
identifierstringrequired- Identifier of the comparison, from List Comparisons or Create Comparison. Example: uCtUqmYb.
No tools match.