Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Smartlead

Scalekit connector
Open markdown

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

Tools
30
What they doRead · write · destructive
14 · 12 · 414 read12 write4 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 Smartlead connection

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

    Each user opens the link once and enters their Smartlead 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
  • smartlead_campaign_analytics_getGet campaign-wide totals for a Smartlead campaign.Read-only

    Get Campaign Analytics

    Get campaign-wide totals for a Smartlead campaign. Returns totals of emails sent, opened, clicked and replied, and the open, click, reply, bounce and unsubscribe rates. Use Get Campaign Statistics for per-email rows.

    Inputs

    campaign_idintegerrequired
    Numeric ID of the Smartlead campaign. Get it from List Campaigns. Example: 123.
  • smartlead_campaign_email_accounts_listList the sending email accounts attached to a Smartlead campaign.Read-only

    List Campaign Email Accounts

    List the sending email accounts attached to a Smartlead campaign. Returns each account's id, from_email, from_name, type and warmup fields. Use List Email Accounts for every account in the workspace.

    Inputs

    campaign_idintegerrequired
    Numeric ID of the Smartlead campaign. Get it from List Campaigns. Example: 123.
    include_tagsboolean
    Set true to include email account tags in the response. Example: true.
  • smartlead_campaign_getGet one Smartlead campaign by ID.Read-only

    Get Campaign

    Get one Smartlead campaign by ID. Returns the campaign's id, name, status, client_id, track_settings, stop_lead_settings, sending_limit and lead counts. Use this when you have the campaign ID. Use List Campaigns to find it.

    Inputs

    campaign_idintegerrequired
    Numeric ID of the Smartlead campaign. Get it from List Campaigns. Example: 123.
    include_tagsboolean
    Set true to include campaign tags in the response. Example: true.
  • smartlead_campaign_lead_message_history_getGet the email thread between a Smartlead campaign and one lead, sent and received.Read-only

    Get Lead Message History

    Get the email thread between a Smartlead campaign and one lead, sent and received. Returns the messages exchanged with the lead, each with its subject, direction and timestamps. Use this to read a lead's replies.

    Inputs

    campaign_idintegerrequired
    Numeric ID of the Smartlead campaign. Get it from List Campaigns. Example: 123.
    lead_idintegerrequired
    Numeric ID of the lead. Get it from List Campaign Leads or Get Lead by Email. Example: 456.
    event_time_gtstring
    Only messages after this ISO 8601 date-time. Example: 2026-01-01T00:00:00Z.
    show_plain_text_responseboolean
    Set true to include the plain-text version of each email. Example: true.
  • smartlead_campaign_leads_listList the leads in a Smartlead campaign, filterable by status, category, engagement and dates.Read-only

    List Campaign Leads

    List the leads in a Smartlead campaign, filterable by status, category, engagement and dates. Returns the total and a page of leads, each with id, email, name, company, status, category, last sent time and custom fields. Use Get Lead by Email to find one lead across all campaigns.

    Inputs

    campaign_idintegerrequired
    Numeric ID of the Smartlead campaign. Get it from List Campaigns. Example: 123.
    created_at_gtstring
    Only leads added after this ISO 8601 date-time. Example: 2026-01-01T00:00:00Z.
    email_statusstring
    Email engagement filter: is_opened, is_clicked, is_bounced, is_replied, is_unsubscribed, is_spam, is_accepted, not_replied or is_sender_bounced. Example: is_replied.one of is_openedis_clickedis_bouncedis_repliedis_unsubscribedis_spamis_acceptednot_repliedis_sender_bounced
    event_time_gtstring
    Only leads whose last event is after this ISO 8601 date-time. Example: 2026-01-01T00:00:00Z.
    last_sent_time_gtstring
    Only leads last emailed after this ISO 8601 date-time. Example: 2026-01-01T00:00:00Z.
    lead_category_idinteger
    Only leads in this category. Get IDs from List Lead Categories. Example: 1.
    limitinteger
    Records per page, 1 to 100. Smartlead defaults to 100. Example: 50.
    offsetinteger
    Number of records to skip, for paging. Smartlead defaults to 0. Example: 100.
    statusstring
    Lead status: STARTED, INPROGRESS, COMPLETED, PAUSED or STOPPED. Example: INPROGRESS.one of STARTEDINPROGRESSCOMPLETEDPAUSEDSTOPPED
  • smartlead_campaign_sequences_getGet the email sequence steps of a Smartlead campaign.Read-only

    Get Campaign Sequences

    Get the email sequence steps of a Smartlead campaign. Returns each step's id, seq_number, subject, email_body and sequence_variants. Use this before Save Campaign Sequences to keep existing step IDs.

    Inputs

    campaign_idintegerrequired
    Numeric ID of the Smartlead campaign. Get it from List Campaigns. Example: 123.
  • smartlead_campaign_statistics_getList per-email send statistics of a Smartlead campaign, filterable by sequence step, engagement status and send date.Read-only

    Get Campaign Statistics

    List per-email send statistics of a Smartlead campaign, filterable by sequence step, engagement status and send date. Returns the campaign's email engagement statistics (opens, clicks, replies, bounces, unsubscribes) for the chosen page and filters. Use Get Campaign Analytics for campaign-wide totals.

    Inputs

    campaign_idintegerrequired
    Numeric ID of the Smartlead campaign. Get it from List Campaigns. Example: 123.
    email_sequence_numberinteger
    Only return emails from this sequence step (1 to 20). Example: 1.
    email_statusstring
    Only return emails with this engagement: opened, clicked, replied, unsubscribed or bounced. Example: replied.one of openedclickedrepliedunsubscribedbounced
    limitinteger
    Records per page, 1 to 100. Smartlead defaults to 100. Example: 50.
    offsetinteger
    Number of records to skip, for paging. Smartlead defaults to 0. Example: 100.
    sent_time_end_datestring
    Only return emails sent on or before this ISO 8601 date-time. Example: 2026-01-31T23:59:59Z.
    sent_time_start_datestring
    Only return emails sent on or after this ISO 8601 date-time. Example: 2026-01-01T00:00:00Z.
  • smartlead_campaign_webhooks_listList the webhooks configured on a Smartlead campaign.Read-only

    List Campaign Webhooks

    List the webhooks configured on a Smartlead campaign. Returns each webhook's id, name, webhook_url and event_types. Use Save Campaign Webhook to add or change one.

    Inputs

    campaign_idintegerrequired
    Numeric ID of the Smartlead campaign. Get it from List Campaigns. Example: 123.