Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Kustomer

Scalekit connector
Open markdown

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

Tools
26
What they doRead · write · destructive
17 · 9 · 017 read9 write0 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 Kustomer connection

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

    Each user opens the link once and enters their Kustomer 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
  • kustomer_companies_listList companies, optionally by name or external ID.Read-only

    List Companies

    List companies, optionally by name or external ID. Returns data[] of companies with name, externalId, domains, emails, phones and tags. Use kustomer_companies_list to find a company ID. Needs the API key role org.permission.company.read (legacy org.user.company.read); without it Kustomer returns 401.

    Inputs

    external_idstring
    Your external ID for the company. Example: acct-2201
    filterstring
    Company name to filter by. Example: Acme
    pageinteger
    Page number, starting at 1. Example: 2
    page_sizeinteger
    Results per page (up to 1000). Example: 100
  • kustomer_company_getGet one company by ID.Read-only

    Get Company

    Get one company by ID. Returns the company's name, externalId, domains, contact details, tags and custom attributes. Use kustomer_company_get for a known ID. Needs the API key role org.permission.company.read (legacy org.user.company.read); without it Kustomer returns 401.

    Inputs

    company_idstringrequired
    ID of the company (24-character Kustomer ID). Example: 5faaf4a6ea0cb48cd0801bbf
  • kustomer_conversation_getGet one conversation by ID, or several with comma-separated IDs.Read-only

    Get Conversation

    Get one conversation by ID, or several with comma-separated IDs. Returns status, priority, channels, customer, assignment, tags, SLA metrics and message counts. Use kustomer_conversation_get for a known ID. Needs the API key role org.permission.conversation.read (legacy org.user.conversation.read); without it Kustomer returns 401.

    Inputs

    conversation_idstringrequired
    ID of the conversation (24-character Kustomer ID). Example: 5faaf4a6ea0cb48cd0801bbf
    includestring
    Set to customer to side-load the customer. Example: customerone of customer
  • kustomer_conversation_messages_listList the messages in a conversation.Read-only

    List Conversation Messages

    List the messages in a conversation. Returns data[] of messages with channel, direction, preview, subject, sentAt, createdBy and attachments. Use kustomer_conversation_messages_list to read a conversation. Use kustomer_conversation_notes_list for internal notes. Needs the API key role org.permission.message.read (legacy org.user.message.read); without it Kustomer returns 401.

    Inputs

    conversation_idstringrequired
    ID of the conversation (24-character Kustomer ID). Example: 5faaf4a6ea0cb48cd0801bbf
    channelstring
    Only messages on this channel. Example: emailone of emailsmschatfacebooktwitter-dmtwitter-tweetvoiceinstagramwhatsapp
    pageinteger
    Page number, starting at 1. Example: 2
    page_sizeinteger
    Results per page (up to 1000). Example: 100
    sortstring
    Sort order; prefix a field with - for descending. Example: createdAt
  • kustomer_conversation_notes_listList the internal notes on a conversation.Read-only

    List Conversation Notes

    List the internal notes on a conversation. Returns data[] of notes with body, userMentions, createdBy and createdAt. Use kustomer_conversation_notes_list to read agent notes. Needs the API key role org.permission.note.read (legacy org.user.note.read); without it Kustomer returns 401.

    Inputs

    conversation_idstringrequired
    ID of the conversation (24-character Kustomer ID). Example: 5faaf4a6ea0cb48cd0801bbf
    pageinteger
    Page number, starting at 1. Example: 2
    page_sizeinteger
    Results per page (up to 1000). Example: 100
    sortstring
    Sort order; prefix a field with - for descending. Example: createdAt
  • kustomer_conversations_listList the organization's conversations with paging.Read-only

    List Conversations

    List the organization's conversations with paging. Returns data[] of conversations with name, status, priority, customer, assignedUsers, assignedTeams, tags and timestamps. Use kustomer_conversations_list to browse. Use kustomer_search for open conversations or other filters. Needs the API key role org.permission.conversation.read (legacy org.user.conversation.read); without it Kustomer returns 401.

    Inputs

    pageinteger
    Page number, starting at 1. Example: 2
    page_sizeinteger
    Results per page (up to 1000). Example: 100
    populate_linked_conversationsboolean
    true to fill in linked conversation fields. Example: false
    sortstring
    Sort order; prefix a field with - for descending. Example: desc
  • kustomer_current_user_getGet the user behind the API key (for an API key, its machine user).Read-only

    Get Current User

    Get the user behind the API key (for an API key, its machine user). Returns data with the user id, name, email, userType and roles. Works with any valid API key.

    Inputs

    This tool takes no inputs.

  • kustomer_customer_conversations_listList one customer's conversations.Read-only

    List Customer Conversations

    List one customer's conversations. Returns data[] of conversations with name, status, channels, priority, assignedUsers, assignedTeams, tags and timestamps. Use kustomer_customer_conversations_list to see a customer's history. Use kustomer_conversation_messages_list for a conversation's messages. Needs the API key role org.permission.conversation.read (legacy org.user.conversation.read); without it Kustomer returns 401.

    Inputs

    customer_idstringrequired
    ID of the customer (24-character Kustomer ID). Example: 5faaf4a6ea0cb48cd0801bbf