Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Campaign Cleaner

Scalekit connector
Open markdown

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

Tools
20
What they doRead · write · destructive
12 · 5 · 312 read5 write3 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 Campaign Cleaner connection

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

    Each user opens the link once and enters their Campaign Cleaner 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
  • campaigncleaner_campaign_getGet a processed campaign with its cleaned HTML and full analysis.Read-only

    Get Campaign

    Get a processed campaign with its cleaned HTML and full analysis. Returns the cleaned HTML, settings used, spam keyword findings, link and image summaries, SpamAssassin score and other checks. Use after campaigncleaner_campaign_status_get reports completed.

    Inputs

    campaign_idstringrequired
    ID of the saved campaign, from campaigncleaner_campaign_send or campaigncleaner_campaigns_list. Example: 4f8a2c1e9b7d.
    minimize_htmlboolean
    Return minified HTML without extra whitespace. Defaults to true. Example: true.
  • campaigncleaner_campaign_status_getGet the processing status of a submitted campaign.Read-only

    Get Campaign Status

    Get the processing status of a submitted campaign. Returns the campaign id, name, status (processing, completed or paused) and date added. When completed, read it with campaigncleaner_campaign_get.

    Inputs

    campaign_idstringrequired
    ID of the saved campaign, from campaigncleaner_campaign_send or campaigncleaner_campaigns_list. Example: 4f8a2c1e9b7d.
  • campaigncleaner_campaigns_listList every saved campaign on the account.Read-only

    List Campaigns

    List every saved campaign on the account. Returns each campaign's id, name, status and date added. Use an id with campaigncleaner_campaign_get.

    Inputs

    This tool takes no inputs.

  • campaigncleaner_credits_getGet how many API credits the account has left.Read-only

    Get Credits

    Get how many API credits the account has left. Returns credits. Sending a campaign or creating an inbox test uses 1 credit; monitor tools use none.

    Inputs

    This tool takes no inputs.

  • campaigncleaner_inbox_test_results_getGet the placement results of an inbox test.Read-only

    Get Inbox Test Results

    Get the placement results of an inbox test. Returns the test's status (Processing or Completed) and, per seed mailbox, where the email landed (inbox, spam, tab) plus authentication results. Call again until status is Completed.

    Inputs

    job_idstringrequired
    job_id returned by campaigncleaner_inbox_test_create. Example: 186.
  • campaigncleaner_monitor_alerts_listList alert rules and the 50 most recent alerts.Read-only

    List Monitor Alerts

    List alert rules and the 50 most recent alerts. Returns alerts (rules with alert_id, kind, recipients) and recent events with status, domain, provider and detail. Use campaigncleaner_monitor_alert_save to create or change a rule.

    Inputs

    This tool takes no inputs.

  • campaigncleaner_monitor_domains_listList the account's monitored and alert domains with verification status and limits.Read-only

    List Monitor Domains

    List the account's monitored and alert domains with verification status and limits. Returns domains with domain_id, domain, purpose, status, DNS record and message counts, plus limits. Only mail sent from a verified domain is recorded.

    Inputs

    This tool takes no inputs.

  • campaigncleaner_monitor_message_getGet one stored monitor message with authentication details, selected headers and a text preview.Read-only

    Get Monitor Message

    Get one stored monitor message with authentication details, selected headers and a text preview. Returns the message fields plus first and last seen times, DKIM domain, sender IP, preview, headers, and optionally the original as eml_base64. Use campaigncleaner_monitor_messages_list for message IDs.

    Inputs

    message_idintegerrequired
    ID of the message, from campaigncleaner_monitor_messages_list. Example: 52731.
    include_emlboolean
    true adds the original message (up to 10 MB) as eml_base64; limited to 10 a minute. Defaults to false. Example: false.