Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Documint

Scalekit connector
Open markdown

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

Tools
5
What they doRead · write · destructive
2 · 2 · 12 read2 write1 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. 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>
  3. Create the Documint connection

    In AgentKit > Connections, create a Documint connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. 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.actions
    const connector = 'documint'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Documint:', 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: 'documint_templates_list',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Documint credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • documint_template_getGet one document template by ID.Read-only

    Get Template

    Get one document template by ID. Returns the template record. Use select to limit the fields returned.

    Inputs

    template_idstringrequired
    ID of the template, from documint_templates_list. Example: 64f1c2a9e4b0a1b2c3d4e5f6.
    selectstring
    Comma-separated fields to return; prefix a field with - to exclude it. Example: name,description,createdAt.
  • documint_templates_listList the document templates in your Documint account, with paging and sorting.Read-only

    List Templates

    List the document templates in your Documint account, with paging and sorting. Returns result, an array of template records with id, name and createdAt (or the fields chosen with select). Use this to find a template ID for documint_document_create. Use documint_template_get for one template.

    Inputs

    limitinteger
    Results per page. Default 100, maximum 200. Example: 50.
    pageinteger
    Page number of results. Default 1. Example: 1.
    selectstring
    Comma-separated fields to return; prefix a field with - to exclude it. Example: name,description,createdAt.
    sortstring
    Field to sort by; prefix with - for descending, and separate several with commas. Example: -createdAt.
  • documint_document_createMerge data into a Documint template to generate a document (usually a PDF).Write

    Create Document from Template

    Merge data into a Documint template to generate a document (usually a PDF). Returns url (link to the generated file), name, fileExtension, timestamp, templateName and templateId. Use documint_templates_list to find the template ID; the data keys must match the template's field tokens. Set preview true to generate a preview document.

    Inputs

    dataobjectrequired
    Merge data whose keys match the template's field tokens; nested objects and arrays fill nested fields and repeat loops. Example: {"customer_name": "Acme Inc.", "invoice_number": "INV-1001", "items": [{"description": "Consulting", "amount": 1200}]}
    template_idstringrequired
    ID of the template to merge, from documint_templates_list. Example: 64f1c2a9e4b0a1b2c3d4e5f6.
    activeboolean
    Set to true to merge the template's active version, as in Documint's API examples. Example: true.
    previewboolean
    Set to true to create a preview document instead of a final one. Example: true.
  • documint_template_updateUpdate a template's name, or deactivate or trash it.Write

    Update Template

    Update a template's name, or deactivate or trash it. Returns the updated template. Use is_trashed true to move a template to the trash instead of documint_template_delete.

    • Idempotent

    Inputs

    template_idstringrequired
    ID of the template to update, from documint_templates_list. Example: 64f1c2a9e4b0a1b2c3d4e5f6.
    is_activeboolean
    Set to false to deactivate the template. Example: true.
    is_trashedboolean
    Set to true to move the template to the trash. Example: false.
    namestring
    New template name. Example: Invoice v2.
  • documint_template_deletePermanently delete a template.Destructive

    Delete Template

    Permanently delete a template. Returns a confirmation. This cannot be undone. To keep the template recoverable, use documint_template_update with is_trashed or is_active instead.

    • Idempotent

    Inputs

    template_idstringrequired
    ID of the template to delete, from documint_templates_list. Example: 64f1c2a9e4b0a1b2c3d4e5f6.