Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Affinity

Scalekit connector
Open markdown

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

Tools
49
What they doRead · write · destructive
33 · 11 · 533 read11 write5 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 Affinity connection

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

    Each user opens the link once and enters their Affinity 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
  • affinity_get_opportunityRetrieve full details of a deal or opportunity in Affinity including current stage, owner, associated persons and organizations, custom field values, and list membership.Read-only

    Get Opportunity

    Retrieve full details of a deal or opportunity in Affinity including current stage, owner, associated persons and organizations, custom field values, and list membership. Use this before updating a deal or generating a deal memo.

    Inputs

    opportunity_idintegerrequired
    Unique numeric ID of the opportunity to retrieve
  • affinity_get_organizationRetrieve an organization's full profile from Affinity including domain, team member connections, associated people, deal history, and interaction metadata.Read-only

    Get Organization

    Retrieve an organization's full profile from Affinity including domain, team member connections, associated people, deal history, and interaction metadata. Use this for deep company diligence or to understand team relationships before an investment.

    Inputs

    organization_idintegerrequired
    Unique numeric ID of the organization to retrieve
    with_interaction_datesboolean
    Include first and last interaction dates in the response
  • affinity_get_personRetrieve a person's full profile from Affinity including contact information, email addresses, phone numbers, organization memberships, interaction history, and relationship score.Read-only

    Get Person

    Retrieve a person's full profile from Affinity including contact information, email addresses, phone numbers, organization memberships, interaction history, and relationship score. Use this to deeply evaluate a contact before a meeting or investment decision.

    Inputs

    person_idintegerrequired
    Unique numeric ID of the person to retrieve
    with_interaction_datesboolean
    Include first and last interaction dates in the response
  • affinity_get_relationship_strengthRetrieve relationship strength scores between your team members and an external contact (person) in Affinity.Read-only

    Get Relationship Strength

    Retrieve relationship strength scores between your team members and an external contact (person) in Affinity. Scores reflect email and meeting interaction frequency and recency. Use this to identify the best warm introduction path to a founder, LP, or co-investor.

    Inputs

    external_idintegerrequired
    Affinity person ID of the external contact to evaluate relationship strength against
    internal_idinteger
    Affinity person ID of the internal team member (optional — omit to get scores for all team members)
  • affinity_list_listsRetrieve all Affinity lists available in the workspace, including people lists, organization lists, and opportunity/deal pipeline lists.Read-only

    List All Lists

    Retrieve all Affinity lists available in the workspace, including people lists, organization lists, and opportunity/deal pipeline lists. Returns list IDs, names, types, and owner information. Use this to discover list IDs before adding entries or filtering opportunities.

    Inputs

    This tool takes no inputs.

  • affinity_list_notesRetrieve notes associated with a specific person, organization, or opportunity in Affinity.Read-only

    List Notes

    Retrieve notes associated with a specific person, organization, or opportunity in Affinity. Returns paginated note records including content, creator, and creation timestamp. Use this to review interaction history, meeting summaries, or due diligence logs on a CRM entity.

    Inputs

    opportunity_idinteger
    Filter notes by opportunity ID
    organization_idinteger
    Filter notes by organization ID
    page_sizeinteger
    Number of results to return per page (max 500)
    page_tokenstring
    Pagination token from a previous response to fetch the next page
    person_idinteger
    Filter notes by person ID
  • affinity_list_opportunitiesList pipeline opportunities in Affinity with optional filters by list ID, owner, or stage.Read-only

    List Opportunities

    List pipeline opportunities in Affinity with optional filters by list ID, owner, or stage. Returns paginated deal records including stage, value, associated people and organizations, and custom field values. Designed for deal flow monitoring and portfolio tracking.

    Inputs

    list_idinteger
    Filter opportunities belonging to a specific Affinity list ID
    page_sizeinteger
    Number of results to return per page (max 500)
    page_tokenstring
    Pagination token from a previous response to fetch the next page
  • affinity_search_organizationsSearch for companies and organizations in the Affinity network by name or domain.Read-only

    Search Organizations

    Search for companies and organizations in the Affinity network by name or domain. Returns a paginated list of matching organization records including team connections, domain info, and interaction metadata. Useful for deal sourcing and company diligence lookups.

    Inputs

    page_sizeinteger
    Number of results to return per page (max 500)
    page_tokenstring
    Pagination token from a previous response to fetch the next page
    termstring
    Search term to filter organizations by name or domain
    with_interaction_datesboolean
    Include first and last interaction dates in the response