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
- API key
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. 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>Create the Campaign Cleaner connection
In AgentKit > Connections, create a Campaign Cleaner connection. The name you give it is the
connection_nameyour code passes. See Configure connections.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.actionsconst connector = 'campaigncleaner'const identifier = 'user_123'// Generate an authorization link for the userconst { 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 callconst result = await actions.executeTool({connector,identifier,toolName: 'campaigncleaner_campaigns_list',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "campaigncleaner"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Campaign Cleaner:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="campaigncleaner_campaigns_list",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach 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 toexecute_toolcampaigncleaner_campaign_getGet a processed campaign with its cleaned HTML and full analysis.Read-onlyGet 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-onlyGet 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-onlyList 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-onlyGet 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-onlyGet 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-onlyList 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-onlyList 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-onlyGet 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.
campaigncleaner_monitor_messages_listList stored copies of your mail that reached a monitor seed, newest first, with placement and authentication results (last 30 days).Read-onlyList Monitor Messages
List stored copies of your mail that reached a monitor seed, newest first, with placement and authentication results (last 30 days). Returns page, page_size, total and messages with message_id, domain, provider, placement, subject, from and SPF/DKIM/DMARC results. Use campaigncleaner_monitor_message_get for one message.
Inputs
daysinteger- Look back this many days, 1 to 30. Defaults to 30. Example: 7.
domain_idinteger- Only this monitored domain. Defaults to all verified domains. Example: 13.
pageinteger- Page number, starting at 1. Example: 1.
page_sizeinteger- Messages per page, 1 to 200. Defaults to 50. Example: 50.
placementstring- Only messages in this folder. Example: Spam.one of
InboxSpamPromotionsSocialUpdatesNewsletterAnnouncementsForumsOther provider_keystring- Only this provider, using a provider_key from campaigncleaner_monitor_seeds_list. Example: gmail.com.
campaigncleaner_monitor_seeds_listGet the Inbox Placement Monitor seed addresses to add as To recipients on your real sends.Read-onlyList Monitor Seeds
Get the Inbox Placement Monitor seed addresses to add as To recipients on your real sends. Returns count and seeds with address, provider and provider_key. Needs a plan with Inbox Placement Monitor. Send from a verified domain (campaigncleaner_monitor_domains_list).
Inputs
This tool takes no inputs.
campaigncleaner_monitor_summary_getGet inbox and spam rates overall and per mailbox provider.Read-onlyGet Monitor Placement Summary
Get inbox and spam rates overall and per mailbox provider. Returns overall and per-provider totals for inbox, tabs, spam and other, plus inbox_rate and spam_rate. Use campaigncleaner_monitor_messages_list for individual messages.
Inputs
daysinteger- Look back this many days, 1 to 365. Defaults to 30. Example: 30.
domain_idinteger- Only this monitored domain. Example: 13.
campaigncleaner_monitor_usage_getGet how many monitor messages were stored this billing period against the limits.Read-onlyGet Monitor Usage
Get how many monitor messages were stored this billing period against the limits. Returns messages_used, messages_limit, failed_auth_used, failed_auth_limit, not_stored and resets_at. A null limit means unlimited.
Inputs
This tool takes no inputs.
campaigncleaner_campaign_sendSubmit an email campaign's HTML to be sanitized, CSS-inlined, optimized for deliverability and analyzed for spam triggers, broken links, image sizes and more.WriteSend Campaign for Cleaning
Submit an email campaign's HTML to be sanitized, CSS-inlined, optimized for deliverability and analyzed for spam triggers, broken links, image sizes and more. Returns the campaign id; processing usually takes seconds and up to a few minutes. Poll campaigncleaner_campaign_status_get, then read the cleaned HTML and analysis with campaigncleaner_campaign_get. Uses 1 credit.
Inputs
campaign_htmlstringrequired- The full HTML of the email campaign. Example: <html><body><h1>Spring sale</h1><p>Save 40% this week.</p></body></html>.
campaign_namestringrequired- Name for the campaign. Example: Spring Sale Newsletter.
adjust_font_colorsboolean- Shift spam-trigger colors such as pure red to a near-identical shade. Defaults to true. Example: true.
adjust_font_sizeboolean- Clamp font sizes to min_font_size_allowed and max_font_size_allowed. Defaults to true. Example: true.
convert_h_to_p_tagsboolean- Turn H tags into P tags with matching font sizes. Defaults to false. Example: false.
convert_tables_to_divsboolean- Experimental: convert tables to divs. Defaults to false. Example: false.
custom_infostring- Your own data (up to 500 characters) returned with the campaign. Example: batch-2026-11.
host_extensionless_imagesboolean- Also host images without file extensions when resize_and_host is on. Defaults to false. Example: false.
inline_cssboolean- Inline CSS into style attributes. Defaults to true. Example: true.
inline_css_importantboolean- Keep !important flags when inlining. Defaults to false. Example: false.
max_font_size_allowedinteger- Largest font size in pixels, under 100. Defaults to 32. Example: 32.
media_queries_importantboolean- Mark media query styles !important. Defaults to true. Example: true.
min_font_size_allowedinteger- Smallest font size in pixels, under 100. Defaults to 10. Example: 10.
preserve_media_queriesboolean- Keep media queries. Defaults to true. Example: true.
relative_links_base_urlstring- Base URL used to turn relative links into absolute ones. Example: https://example.com.
remove_classes_and_idsboolean- Remove class and id attributes after inlining. Defaults to true. Example: true.
remove_commentsboolean- Strip HTML and CSS comments. Defaults to true. Example: true.
remove_control_non_printableboolean- Remove control and non-printable characters. Defaults to false. Example: false.
remove_css_inheritanceboolean- Remove inherited CSS. Defaults to true. Example: true.
remove_image_heightboolean- Remove height styles from images. Defaults to true. Example: true.
remove_large_widths_overinteger- Experimental: remove widths above this many pixels on elements other than images and tables. Example: 800.
remove_successive_punctuationboolean- Collapse repeated punctuation such as !!! to one. Defaults to true. Example: true.
replace_diacriticsboolean- Replace accented characters with plain ones. Defaults to true. Example: true.
replace_non_ascii_charactersboolean- Replace non-ASCII characters with ASCII equivalents. Defaults to true. Example: true.
resize_and_hostboolean- Resize, convert and host eligible images on Campaign Cleaner's CDN. Defaults to true. Example: true.
set_image_max_widthinteger- Apply this max-width in pixels to all images. Example: 600.
surrounding_divobject- Wrap the HTML in a div with max_width (pixels), text_align (left, center or right), font_size (pixels) and center_to_parent (true or false). Example: {"max_width": 600, "text_align": "left", "font_size": 15, "center_to_parent": true}
webhook_urlstring- Absolute URL with no query string that receives the results when processing finishes. Example: https://example.com/webhooks/campaign-cleaner.
campaigncleaner_inbox_test_createCreate an inbox placement test and get the seed addresses to send your campaign to.WriteCreate Inbox Placement Test
Create an inbox placement test and get the seed addresses to send your campaign to. Returns job_id, test_name, mailtester_address and the send_to list of seed addresses. Send the campaign to every address, then poll campaigncleaner_inbox_test_results_get. Needs a subscription that includes it; uses 1 credit.
Inputs
test_namestringrequired- Name of the test, up to 80 characters. Example: Spring Sale Inbox Test.
campaigncleaner_monitor_alert_saveCreate an alert rule, or replace an existing one when alert_id is given.WriteSave Monitor Alert
Create an alert rule, or replace an existing one when alert_id is given. Returns the saved alert. Recipients must be the account owner, team members or addresses at a verified domain.
Inputs
kindstringrequired- spam (mail lands in spam), notinbox (spam, Gmail tabs or Outlook Other), rate (inbox rate below threshold) or auth (SPF, DKIM or DMARC fails). Example: spam.one of
spamnotinboxrateauth alert_idinteger- ID of the alert to replace. Leave empty to create a new one. Example: 4.
deliverystring- instant, or digest (once a day). Defaults to instant. Example: instant.one of
instantdigest domain_idinteger- One monitored domain; leave empty or 0 for all. Example: 13.
enabledboolean- Whether the alert is on. Defaults to true. Example: true.
min_messagesinteger- For kind rate: minimum messages in 24 hours before it can trigger, 1 to 1000. Defaults to 5. Example: 5.
provider_keystring- One provider (from campaigncleaner_monitor_seeds_list); leave empty for all. Example: gmail.com.
recipientsarray- Up to 5 email addresses; empty sends to the account owner. Example: ["ops@example.com"]
thresholdinteger- For kind rate: inbox rate in percent, 1 to 100. Defaults to 80. Example: 80.
campaigncleaner_monitor_domain_addAdd a sending domain to the Inbox Placement Monitor.WriteAdd Monitor Domain
Add a sending domain to the Inbox Placement Monitor. Returns the domain with the DNS TXT record to publish and the next step. Publish the record, then call campaigncleaner_monitor_domain_verify.
Inputs
domainstringrequired- The domain you send From, such as news.example.com. Freemail and shared sending domains can't be added. Example: news.example.com.
alerts_onlyboolean- true verifies the domain only so alerts can be sent to addresses at it; it is not monitored. Defaults to false. Example: false.
campaigncleaner_monitor_domain_verifyCheck the DNS TXT record of a pending monitored domain.WriteVerify Monitor Domain
Check the DNS TXT record of a pending monitored domain. Returns verified (true or false), a message and the domain's status. DNS can take a while; retry later if not verified.
- Idempotent
Inputs
domain_idintegerrequired- ID of the monitored domain, from campaigncleaner_monitor_domains_list. Example: 13.
campaigncleaner_campaign_deletePermanently delete a saved campaign and its analysis.DestructiveDelete Campaign
Permanently delete a saved campaign and its analysis. Returns status success. This cannot be undone.
- Idempotent
Inputs
campaign_idstringrequired- ID of the saved campaign, from campaigncleaner_campaign_send or campaigncleaner_campaigns_list. Example: 4f8a2c1e9b7d.
campaigncleaner_monitor_alert_deleteDelete an alert rule and its alert history.DestructiveDelete Monitor Alert
Delete an alert rule and its alert history. Returns the status. Use campaigncleaner_monitor_alerts_list for alert IDs.
- Idempotent
Inputs
alert_idintegerrequired- ID of the alert to delete. Example: 4.
campaigncleaner_monitor_domain_removeRemove a monitored domain; its stored messages and alerts are deleted immediately.DestructiveRemove Monitor Domain
Remove a monitored domain; its stored messages and alerts are deleted immediately. Returns the status. This cannot be undone.
- Idempotent
Inputs
domain_idintegerrequired- ID of the monitored domain, from campaigncleaner_monitor_domains_list. Example: 13.
No tools match.