Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to LeadMagic

Scalekit connector
Open markdown

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

Tools
72
What they doRead · write · destructive
60 · 10 · 260 read10 write2 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 LeadMagic connection

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

    Each user opens the link once and enters their LeadMagic 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
  • leadmagic_detect_job_changeCheck whether a person still works at an expected company or has moved to a new one.Read-only

    Detect Job Change

    Check whether a person still works at an expected company or has moved to a new one. Returns a status (for example JOB_CHANGE_DETECTED or PROFILE_NOT_FOUND), job_change_detected, and the person's current company and title. Costs 3 credits per check; an unresolved profile costs nothing. Use this to keep CRM contacts current. Use leadmagic_get_person_profile for the full profile.

    Inputs

    profile_urlstringrequired
    B2B social profile URL or profile slug of the person, for example https://www.linkedin.com/in/alex-rivera or alex-rivera.
    company_domainstring
    Domain of the company you expect the person to work at, for example example.com. It adds match aliases for the company. Provide company_name or company_domain.
    company_namestring
    The company you expect the person to work at, for example Example Robotics. This value is authoritative for the match. Provide company_name or company_domain.
  • leadmagic_find_competitorsFind the competitors of a company.Read-only

    Find Competitors

    Find the competitors of a company. Returns competing companies with name, short description, founding year, headquarters, employee count and funding and operating metrics. Use this for competitive landscape research. Use leadmagic_find_lookalike_companies to find similar companies as new prospects.

    Inputs

    company_domainstring
    Company website domain without protocol or path, for example leadmagic.io. The domain is the most accurate way to identify a company. Provide at least one of company_domain, company_url or company_name.
    company_namestring
    Company name, for example LeadMagic. Less precise than the domain; use it when the domain is unknown. Provide at least one of company_domain, company_url or company_name.
    company_urlstring
    B2B company profile URL or slug, for example leadmagichq.
  • leadmagic_find_emailFind a person's verified work email from their name and company, or from their B2B profile URL.Read-only

    Find Work Email

    Find a person's verified work email from their name and company, or from their B2B profile URL. Returns the email, its validation status, the person's name and the company domain and name. A miss returns a not-found message and costs no credits. Use this to find a work email. Use leadmagic_find_profile_work_email when you only have a profile URL and want the profile-based match, leadmagic_find_personal_email for personal addresses, and leadmagic_validate_email to check an address you already have.

    Inputs

    allow_domain_mismatchboolean
    When false (the API default), an email found on a domain unrelated to the requested one is returned as a free not-found with domain_mismatch true. Set true to return that email anyway, flagged domain_mismatch true and charged like any other find.
    company_namestring
    Company name, for example LeadMagic. Less precise than the domain; use it when the domain is unknown. Provide this or domain unless you pass profile_url.
    domainstring
    Company website domain, for example leadmagic.io. Provide domain or company_name unless you pass profile_url. The domain gives the most accurate results.
    first_namestring
    The person's first name, for example Alex. A single initial is accepted when last_name is a full surname. Provide first_name and last_name, or full_name, unless you pass profile_url.
    full_namestring
    The person's full name, for example Alex Rivera, as an alternative to first_name plus last_name. An initial plus a surname (J Orjuela) is accepted.
    last_namestring
    The person's last name, for example Rivera. Use together with first_name.
    profile_urlstring
    B2B social profile URL or profile slug of the person, for example https://www.linkedin.com/in/alex-rivera or alex-rivera. On its own it identifies the person and their company, so names and company are then optional.
  • leadmagic_find_employeesList employees of a company.Read-only

    Find Employees

    List employees of a company. Returns employees with their profile URLs, titles and locations. Costs 0.05 credits per employee returned, and nothing when none are found. Use this to list people at one company. Use leadmagic_find_role for a single title, and leadmagic_search_people to filter by seniority, function or location.

    Inputs

    company_domainstring
    Company website domain without protocol or path, for example leadmagic.io. The domain is the most accurate way to identify a company. Preferred over company_name. Provide this or company_name.
    company_namestring
    Company name, for example LeadMagic. Less precise than the domain; use it when the domain is unknown. Provide this or company_domain.
    limitinteger
    Maximum number of employees to return. The API default is 10. Each employee returned costs 0.05 credits.
  • leadmagic_find_jobsFind job postings by company, title, location, experience level, remote option and posting date.Read-only

    Find Jobs

    Find job postings by company, title, location, experience level, remote option and posting date. Returns matching job postings with title, company, location, publish date, description, salary range, experience level and application URL, plus total_count and total_pages for paging with page and per_page. Use this for simple job lookups by company or title. Use leadmagic_search_jobs for the richer search with occupation taxonomy, salary and tag filters. The ID filters take values from leadmagic_list_job_countries, leadmagic_list_job_regions, leadmagic_list_job_types, leadmagic_list_job_company_types and leadmagic_list_job_industries.

    Inputs

    city_namestring
    City name, for example Austin. Pair with country_id to tell apart cities that share a name.
    company_industry_idinteger
    Industry ID from leadmagic_list_job_industries, for example 7.
    company_namestring
    Company name, for example LeadMagic. Less precise than the domain; use it when the domain is unknown.
    company_type_idinteger
    Company type ID from leadmagic_list_job_company_types, for example 1.
    company_websitestring
    Company website domain, for example clay.com.
    country_idstring
    Country code, for example US or GB. Supported values come from leadmagic_list_job_countries.
    experience_levelstring
    Required experience level: entry, mid, senior or executive. Leave empty for all levels.one of entrymidseniorexecutive
    has_remoteboolean
    true for remote listings only, false for non-remote listings only. Leave empty for both.
    job_descriptionstring
    Keywords or phrases to match in the job description, for example Salesforce.
    job_titlestring
    Job title to search for, for example RevOps Engineer.
    job_type_idinteger
    Job type ID from leadmagic_list_job_types, for example 1.
    locationstring
    Job location as free text, for example United States.
    max_employeesinteger
    Maximum number of employees at the hiring company, for example 10000.
    min_employeesinteger
    Minimum number of employees at the hiring company, for example 51.
    pageinteger
    Page number, starting at 1 (the API default).
    per_pageinteger
    Results per page. The API default is 20 and the maximum is 50.
    posted_afterstring
    Only jobs posted on or after this date, in YYYY-MM-DD format.
    posted_beforestring
    Only jobs posted on or before this date, in YYYY-MM-DD format.
    posted_withininteger
    Only jobs posted within this many days, for example 30.
    region_idinteger
    Region ID from leadmagic_list_job_regions, for example 5.
  • leadmagic_find_lookalike_companiesFind companies similar to a seed company domain, name or free-text description.Read-only

    Find Lookalike Companies

    Find companies similar to a seed company domain, name or free-text description. Returns similar companies with full firmographics, ranked by similarity, and metadata.next_offset for paging. Costs 5 credits when at least one lookalike is returned, and nothing when none are. Use this to expand a target account list. Use leadmagic_find_competitors for direct competitors, and leadmagic_search_companies to search by filters.

    Inputs

    company_domainstring
    Company website domain without protocol or path, for example leadmagic.io. The domain is the most accurate way to identify a company. Provide a seed: company_domain, company_name or description.
    company_filtersobject
    Filters applied to the lookalikes, a subset of the Search Companies filters: country_codes, employee_ranges, min_employees, max_employees, revenue_ranges, industries, sic_codes, naics_codes, founded_after, founded_before, has_funding, min_total_funding, max_total_funding, website_active, has_tech_stack, tech_stack and technographic lists such as crm_tech. Example: {"country_codes": ["US"], "employee_ranges": ["51 to 200", "201 to 500"]}.
    company_namestring
    Company name, for example LeadMagic. Less precise than the domain; use it when the domain is unknown. Used as the seed when no domain is given.
    descriptionstring
    Free-text description to use as the seed, for example AI-powered B2B email finder for sales teams.
    limitinteger
    Number of lookalikes per page. The API default is 25. Pages hold at most 100 companies; values from 101 to 2000 are reduced to 100.
    offsetinteger
    Offset into the similarity ranking, for example 100 for the second page of 100. Use metadata.next_offset from the previous response. Maximum 2000.
  • leadmagic_find_mobileFind a person's mobile phone number from their B2B profile URL, work email or personal email.Read-only

    Find Mobile Number

    Find a person's mobile phone number from their B2B profile URL, work email or personal email. Returns the mobile number found, or a not-found message. Use this for direct-dial numbers. People search tools only report whether a number is available; this tool returns the number itself.

    Inputs

    personal_emailstring
    The person's personal email address, for example alex.rivera@gmail.com. Provide at least one of profile_url, work_email or personal_email.
    profile_urlstring
    B2B social profile URL or profile slug of the person, for example https://www.linkedin.com/in/alex-rivera or alex-rivera. Provide at least one of profile_url, work_email or personal_email.
    work_emailstring
    The person's work email address, for example alex.rivera@example.com. Provide at least one of profile_url, work_email or personal_email.
  • leadmagic_find_personal_emailFind the personal (non-work) email addresses of a person from their B2B profile URL.Read-only

    Find Personal Email

    Find the personal (non-work) email addresses of a person from their B2B profile URL. Returns the personal emails found for the profile, or a not-found message. Use this for personal addresses. Use leadmagic_find_email or leadmagic_find_profile_work_email for work emails.

    Inputs

    profile_urlstringrequired
    B2B social profile URL or profile slug of the person, for example https://www.linkedin.com/in/alex-rivera or alex-rivera.