Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Gainsight

Scalekit connector
Open markdown

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

Tools
28
What they doRead · write · destructive
14 · 13 · 114 read13 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 Gainsight connection

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

    Console steps with screenshots

    Register your Scalekit environment with the Gainsight connector so Scalekit can proxy API requests using your Gainsight access key. There is no redirect URI or OAuth flow.

    1. Generate a Gainsight access key

      • Sign in to Gainsight and go to Administration → Connectors 2.0 → Connections.
      • Click + Create Connection.
      • Select Gainsight API as the connector type, enter a connection name, and choose Access Key as the authentication type.
      • Click Generate Access Key.

      Gainsight Create Connection modal showing the Gainsight API connector type selected, a connection name field, Access Key authentication type selected, and the Generate Access Key button

    2. Create a connection in Scalekit

      • In Scalekit dashboard, go to AgentKit > Connections > Create Connection. Find Gainsight and click Create.
      • Note the Connection name — use this as connection_name in your code (e.g., gainsight).
      • Click Save.
    3. Add a connected account

      In the dashboard, to test

      • Open the connection and click the Connected Accounts tab → Add account.
      • Fill in:
        • Your User’s ID — a unique identifier for this user in your system (e.g., user_123)
        • Tenant Domain — your Gainsight hostname without https:// (e.g., mycompany.gainsightcloud.com)
        • Access Key — the key you generated in step 1
      • Click Save.

      In production

      Each user adds their own account through the authorization link: they enter their credentials on the page it opens.

      From your backend, if your app already has the credentials

      For example, when users enter them on a settings page in your app:

      import { ConnectorStatus } from '@scalekit-sdk/node'
      // Never hard-code API keys — read from secure storage or user input
      const gainsightKey = getUserGainsightKey(); // retrieve from your secure store
      const authorizationDetails = {
      details: {
      case: 'staticAuth',
      value: {
      details: {
      domain: 'mycompany.gainsightcloud.com',
      api_key: gainsightKey,
      },
      },
      },
      };
      let { connectedAccount } = await scalekit.actions.upsertConnectedAccount({
      connectionName: 'gainsight',
      identifier: 'user_123',
      authorizationDetails,
      });
      // Make sure the account is ACTIVE before the first tool call.
      if (connectedAccount?.status !== ConnectorStatus.ACTIVE) {
      ({ connectedAccount } = await scalekit.actions.upsertConnectedAccount({
      connectionName: 'gainsight',
      identifier: 'user_123',
      authorizationDetails,
      }));
      }
  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 = 'gainsight'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Gainsight:', 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: 'gainsight_company_query',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Gainsight credentials there. If your app already has a user's credentials, add the account from your backend instead, as the console steps above show. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • gainsight_company_querySearch and filter Gainsight company records by any field.Read-only

    Query Companies

    Search and filter Gainsight company records by any field. Returns up to 5000 records per call.

    Inputs

    limitinteger
    Maximum number of records to return per call (1–5000). Default: 100.
    offsetinteger
    Number of records to skip, used for pagination. Default: 0.
    orderByobject
    Sort specification as an object with field names as keys and 'asc' or 'desc' as values. Custom fields use '__gc' suffix; lookup fields use '__gr'.
    selectarray
    Field names to return. Omit to get standard fields (Name, Gsid, Status, Stage, ARR, etc.).
    whereobject
    Filter object with conditions array and expression string. Each condition uses name (field name), alias, value array, and operator.
  • gainsight_cta_listSearch and filter CTAs in Gainsight Cockpit with field selection and pagination.Read-only

    List CTAs

    Search and filter CTAs in Gainsight Cockpit with field selection and pagination. Returns up to 1000 CTAs per request.

    Inputs

    linkedObjectboolean
    Set to true to include linked object data in the associatedRecords field of each CTA response.
    pageNumberinteger
    Page number to fetch, starting from 1. Default: 1.
    pageSizeinteger
    Number of records per page (1–1000). Default: 50.
    selectarray
    Field names to return. Custom fields must be appended with '__gc'; lookup fields with '__gr'. Omit to get standard CTA fields.
    whereobject
    Filter object with conditions array and expression string. Each condition uses either fieldName (regular fields) or associatedRecord: true (linked object filter).
  • gainsight_goal_fetchFetches/queries Customer Goal records in Gainsight.Read-only

    Fetch Customer Goals

    Fetches/queries Customer Goal records in Gainsight. Select which fields to return, and optionally filter by company, relationship, status, opportunity, or any custom attribute.

    Inputs

    selectarrayrequired
    Field names to return for each goal.
    page_numberinteger
    Page number to fetch, starting from 1.
    page_sizeinteger
    Number of records to return per page.
    whereobject
    Filter conditions with a conditions array (fieldName, value, operator, alias) and an expression combining their aliases.
  • gainsight_object_describeReturn the full field schema for any Gainsight MDA object, including field names, types, and picklist values.Read-only

    Describe Object

    Return the full field schema for any Gainsight MDA object, including field names, types, and picklist values. Use gainsight_object_list to find valid object names.

    Inputs

    object_namestringrequired
    Gainsight MDA object name. Use exact names: Company, call_to_action, activity_timeline, or custom objects ending in __gc (e.g. MyObj__gc).
    children_levelinteger
    Depth of child levels to include.
    include_childrenboolean
    Include child objects in the response.
    include_hidden_columnsboolean
    Include hidden columns in the response.
    include_picklist_detailsboolean
    Include picklist field details in the response.
  • gainsight_object_listList all standard and custom objects available in Gainsight MDA.Read-only

    List Objects

    List all standard and custom objects available in Gainsight MDA. Use this to discover object names before calling gainsight_object_query or gainsight_object_describe.

    Inputs

    emboolean
    Exclude object mappings from the response.
    postring
    Filter by parent object name.
  • gainsight_object_queryQuery any standard or custom Gainsight MDA object by name.Read-only

    Query Object

    Query any standard or custom Gainsight MDA object by name. Custom objects use the __gc suffix (e.g. MyObject__gc). Use gainsight_object_list to discover available object names.

    Inputs

    object_namestringrequired
    Gainsight MDA object name, e.g. Company, activity_timeline, call_to_action, or a custom object like MyObj__gc.
    limitinteger
    Maximum number of records to return per call (1–5000). Default: 100.
    offsetinteger
    Number of records to skip, used for pagination. Default: 0.
    orderByobject
    Sort specification as an object with field names as keys and 'asc' or 'desc' as values.
    selectarray
    Field names to return. Custom fields end with '__gc'; lookup traversals use '__gr'. Omit for all fields.
    whereobject
    Filter object with conditions array and expression string. Each condition uses name, alias, value array, and operator.
  • gainsight_playbook_listList Playbooks configured in Gainsight Cockpit, optionally filtered by entity type, active status, and playbook type.Read-only

    List Playbooks

    List Playbooks configured in Gainsight Cockpit, optionally filtered by entity type, active status, and playbook type. Useful for discovering valid playbook names before referencing one in gainsight_cta_create's playbook field.

    Inputs

    activeboolean
    Restrict to active (true) or inactive (false) playbooks. Omit to return both.
    entity_typestring
    Restrict to playbooks configured for this entity type, e.g. COMPANY or GLOBAL.
    typestring
    Comma-separated playbook types to filter by, e.g. Risk,Expansion.
  • gainsight_query_company_personQuery contact-to-company associations in Gainsight.Read-only

    Query Company Person

    Query contact-to-company associations in Gainsight. Each record links a person to a company with their role, title, and primary company designation.

    Inputs

    limitinteger
    Maximum number of records to return per call (1–5000). Default: 100.
    offsetinteger
    Number of records to skip, used for pagination. Default: 0.
    orderByobject
    Sort specification as an object with field names as keys and 'asc' or 'desc' as values.
    selectarray
    Field names to return. Key fields: Gsid, Person_ID, Company_ID, Active, IsPrimaryCompany, Role, Title, SfdcContactId, SfdcAccountId. Omit for standard fields.
    whereobject
    Filter object with conditions array and expression string. Each condition uses name, alias, value array, and operator.