Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to EspoCRM

Scalekit connector
Open markdown

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

Tools
58
What they doRead · write · destructive
32 · 17 · 932 read17 write9 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 EspoCRM connection

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

    Each user opens the link once and enters their EspoCRM 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
  • espocrm_account_cases_listList the Case records linked to an account.Read-only

    List Account Cases

    List the Case records linked to an account. Returns total and list of records. Use this to see an account's cases. Get the account ID from espocrm_accounts_list.

    Inputs

    idstringrequired
    Account record ID, from espocrm_accounts_list. Example: 6650f1a2b3c4d5e6f.
    max_sizeinteger
    Maximum records to return, up to 200. Example: 20.
    offsetinteger
    Number of records to skip, for paging. Example: 0.
    orderstring
    Sort direction. Example: desc.one of ascdesc
    order_bystring
    Field to sort by. Example: createdAt.
  • espocrm_account_contacts_listList the Contact records linked to an account.Read-only

    List Account Contacts

    List the Contact records linked to an account. Returns total and list of records. Use this to see an account's contacts. Get the account ID from espocrm_accounts_list.

    Inputs

    idstringrequired
    Account record ID, from espocrm_accounts_list. Example: 6650f1a2b3c4d5e6f.
    max_sizeinteger
    Maximum records to return, up to 200. Example: 20.
    offsetinteger
    Number of records to skip, for paging. Example: 0.
    orderstring
    Sort direction. Example: desc.one of ascdesc
    order_bystring
    Field to sort by. Example: createdAt.
  • espocrm_account_getGet one Account record by ID.Read-only

    Get Account

    Get one Account record by ID. Returns all of its fields, including related IDs and names. Use espocrm_accounts_list to find the ID.

    Inputs

    idstringrequired
    Account record ID, from espocrm_accounts_list. Example: 6650f1a2b3c4d5e6f.
  • espocrm_account_opportunities_listList the Opportunity records linked to an account.Read-only

    List Account Opportunities

    List the Opportunity records linked to an account. Returns total and list of records. Use this to see an account's opportunities. Get the account ID from espocrm_accounts_list.

    Inputs

    idstringrequired
    Account record ID, from espocrm_accounts_list. Example: 6650f1a2b3c4d5e6f.
    max_sizeinteger
    Maximum records to return, up to 200. Example: 20.
    offsetinteger
    Number of records to skip, for paging. Example: 0.
    orderstring
    Sort direction. Example: desc.one of ascdesc
    order_bystring
    Field to sort by. Example: createdAt.
  • espocrm_accounts_listList Account records, with optional text search, built-in filter, sorting and paging.Read-only

    List Accounts

    List Account records, with optional text search, built-in filter, sorting and paging. Returns total and list, with each record's id and fields. Use this to find a account ID. Use espocrm_account_get for one record's full details.

    Inputs

    attribute_selectarray
    Fields to return, to make the response smaller. Omit for all fields. Example: ["id", "name"]
    max_sizeinteger
    Maximum records to return, up to 200. Example: 20.
    offsetinteger
    Number of records to skip, for paging. Example: 0.
    orderstring
    Sort direction. Example: desc.one of ascdesc
    order_bystring
    Field to sort by, for example createdAt, modifiedAt or name. Example: createdAt.
    primary_filterstring
    Built-in filter: customers, resellers, partners, recentlyCreated. Example: customers.one of customersresellerspartnersrecentlyCreated
    text_filterstring
    Text search across the main fields. * is a wildcard. Example: acme*.
  • espocrm_call_getGet one Call record by ID.Read-only

    Get Call

    Get one Call record by ID. Returns all of its fields, including related IDs and names. Use espocrm_calls_list to find the ID.

    Inputs

    idstringrequired
    Call record ID, from espocrm_calls_list. Example: 6650f1a2b3c4d5e6f.
  • espocrm_calls_listList Call records, with optional text search, built-in filter, sorting and paging.Read-only

    List Calls

    List Call records, with optional text search, built-in filter, sorting and paging. Returns total and list, with each record's id and fields. Use this to find a call ID. Use espocrm_call_get for one record's full details.

    Inputs

    attribute_selectarray
    Fields to return, to make the response smaller. Omit for all fields. Example: ["id", "name"]
    max_sizeinteger
    Maximum records to return, up to 200. Example: 20.
    offsetinteger
    Number of records to skip, for paging. Example: 0.
    orderstring
    Sort direction. Example: desc.one of ascdesc
    order_bystring
    Field to sort by, for example createdAt, modifiedAt or name. Example: createdAt.
    primary_filterstring
    Built-in filter: planned, held, todays. Example: planned.one of plannedheldtodays
    text_filterstring
    Text search across the main fields. * is a wildcard. Example: acme*.
  • espocrm_campaign_getGet one Campaign record by ID, with all its fields.Read-only

    Get Campaign

    Get one Campaign record by ID, with all its fields. Returns the full record. Get the ID from espocrm_campaigns_list.

    Inputs

    idstringrequired
    Campaign record ID, from espocrm_campaigns_list. Example: 6650f1a2b3c4d5e6f.