IN

instantly-data-handling

Implements data handling, compliance workflows, and block list management for Instantly.ai lead data.

Install

mkdir -p .claude/skills/instantly-data-handling && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5387" && unzip -o skill.zip -d .claude/skills/instantly-data-handling && rm skill.zip

Installs to .claude/skills/instantly-data-handling

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Implement Instantly.ai lead data management, GDPR/CAN-SPAM compliance,
70 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Manage lead lists and block list entries
  • Validate email formats before import
  • Move leads between campaigns and lists
  • Update lead interest status programmatically
  • Perform bulk lead deletions

How it works

The system provides CRUD operations for leads and lists, incorporating validation logic to filter out blocked domains and invalid email formats before interacting with the API.

Inputs & outputs

You give it
Lead data object
You get back
Import success status or lead ID

When to use instantly-data-handling

  • Manage lead list imports
  • Implement unsubscribe flows
  • Ensure GDPR and CAN-SPAM compliance

About this skill

Instantly Data Handling

Overview

Manage leads, lead lists, block lists, and regulatory compliance in Instantly API v2. Covers lead CRUD operations, list management, bulk import patterns, unsubscribe handling, GDPR right-to-deletion, CAN-SPAM compliance, and block list automation. Cold email has specific legal requirements — this skill ensures your integrations are compliant.

Prerequisites

  • Completed instantly-install-auth setup
  • API key with leads:all scope
  • Understanding of CAN-SPAM / GDPR requirements for cold outreach

Instructions

Step 1: Lead List Management

import { InstantlyClient } from "./src/instantly/client";
const client = new InstantlyClient();

// Create a lead list (container for leads outside campaigns)
async function createLeadList(name: string) {
  const list = await client.request<{ id: string; name: string }>("/lead-lists", {
    method: "POST",
    body: JSON.stringify({
      name,
      has_enrichment_task: false,
    }),
  });
  console.log(`Created list: ${list.name} (${list.id})`);
  return list;
}

// List all lead lists
async function getLeadLists() {
  return client.request<Array<{
    id: string; name: string; timestamp_created: string;
  }>>("/lead-lists?limit=50");
}

// Delete a lead list
async function deleteLeadList(listId: string) {
  await client.request(`/lead-lists/${listId}`, { method: "DELETE" });
}

Step 2: Lead Import with Validation

interface LeadImport {
  email: string;
  first_name?: string;
  last_name?: string;
  company_name?: string;
  website?: string;
  phone?: string;
  custom_variables?: Record<string, string>;
}

async function importLeads(
  campaignId: string,
  leads: LeadImport[],
  options = { skipDuplicates: true, verifyEmails: true }
) {
  const results = { added: 0, skipped: 0, failed: 0, errors: [] as string[] };

  for (const lead of leads) {
    try {
      // Validate email format
      if (!lead.email || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(lead.email)) {
        results.failed++;
        results.errors.push(`Invalid email: ${lead.email}`);
        continue;
      }

      // Check against block list patterns
      const domain = lead.email.split("@")[1];
      if (BLOCKED_PATTERNS.some((p) => domain.includes(p))) {
        results.skipped++;
        continue;
      }

      await client.request("/leads", {
        method: "POST",
        body: JSON.stringify({
          campaign: campaignId,
          email: lead.email,
          first_name: lead.first_name,
          last_name: lead.last_name,
          company_name: lead.company_name,
          website: lead.website,
          phone: lead.phone,
          custom_variables: lead.custom_variables,
          skip_if_in_workspace: options.skipDuplicates,
          skip_if_in_campaign: true,
          verify_leads_on_import: options.verifyEmails,
        }),
      });
      results.added++;
    } catch (e: any) {
      results.failed++;
      results.errors.push(`${lead.email}: ${e.message}`);
    }
  }

  console.log(`Import: ${results.added} added, ${results.skipped} skipped, ${results.failed} failed`);
  return results;
}

// Role-based emails and internal domains to always skip
const BLOCKED_PATTERNS = [
  "noreply", "no-reply", "donotreply",
  "info@", "admin@", "support@", "help@", "abuse@",
  "postmaster@", "webmaster@", "hostmaster@",
];

Step 3: Lead Operations (Move, Update, Delete)

// Move leads between campaigns or lists
async function moveLeads(opts: {
  fromCampaign?: string;
  fromList?: string;
  toCampaign?: string;
  toList?: string;
  limit?: number;
}) {
  return client.request("/leads/move", {
    method: "POST",
    body: JSON.stringify({
      in_campaign: opts.fromCampaign,
      in_list: opts.fromList,
      to_campaign_id: opts.toCampaign,
      to_list_id: opts.toList,
      limit: opts.limit || 1000,
      check_duplicates: true,
    }),
  });
}

// Update lead interest status
async function updateLeadInterest(
  email: string,
  campaignId: string,
  status: "interested" | "not_interested" | "meeting_booked" | "closed"
) {
  const interestMap: Record<string, number> = {
    interested: 1,
    not_interested: -1,
    meeting_booked: 2,
    closed: 3,
  };

  await client.request("/leads/update-interest-status", {
    method: "POST",
    body: JSON.stringify({
      lead_email: email,
      campaign_id: campaignId,
      interest_value: interestMap[status],
    }),
  });
}

// Update lead data
async function updateLead(leadId: string, data: Partial<LeadImport>) {
  await client.request(`/leads/${leadId}`, {
    method: "PATCH",
    body: JSON.stringify(data),
  });
}

// Delete leads from a campaign (bulk)
async function deleteLeadsFromCampaign(campaignId: string, status?: number) {
  await client.request("/leads", {
    method: "DELETE",
    body: JSON.stringify({
      campaign_id: campaignId,
      status, // e.g., -1 for bounced only
    }),
  });
}

Step 4: Block List Management

// Add entries to workspace block list
async function addToBlockList(entries: string[]) {
  // Single entry
  for (const entry of entries) {
    await client.request("/block-lists-entries", {
      method: "POST",
      body: JSON.stringify({ bl_value: entry }), // email or domain
    });
  }

  // Or bulk add
  await client.request("/block-lists-entries/bulk-create", {
    method: "POST",
    body: JSON.stringify({ entries }),
  });
}

// Seed block list with standard entries
async function seedBlockList() {
  const standardBlocks = [
    // Your own domains
    "yourdomain.com",
    "yourcompany.com",
    // Competitor domains
    "competitor1.com",
    "competitor2.com",
    // ISP domains (not your target audience)
    "gmail.com",      // uncomment if B2B only
    "yahoo.com",
    "hotmail.com",
    "outlook.com",
    // Trap/spamtrap domains
    "spamtrap.com",
  ];

  await addToBlockList(standardBlocks);
  console.log(`Seeded block list with ${standardBlocks.length} entries`);
}

// List and audit block list
async function auditBlockList() {
  const entries = await client.request<Array<{
    id: string; bl_value: string;
  }>>("/block-lists-entries?limit=100");
  console.log(`Block list: ${entries.length} entries`);
  for (const e of entries) {
    console.log(`  ${e.bl_value}`);
  }
}

Step 5: GDPR / CAN-SPAM Compliance

// GDPR: Right to deletion — remove lead from everywhere
async function handleDeletionRequest(email: string) {
  console.log(`Processing GDPR deletion request for: ${email}`);

  // 1. Find all campaigns containing this lead
  const campaigns = await client.request<Array<{ id: string }>>(
    `/campaigns/search-by-contact?search=${encodeURIComponent(email)}`
  );

  // 2. Delete lead from each campaign
  for (const campaign of campaigns) {
    const leads = await client.leads.list({ campaign: campaign.id });
    const matchingLead = leads.find((l) => l.email === email);
    if (matchingLead) {
      await client.leads.delete(matchingLead.id);
      console.log(`  Deleted from campaign ${campaign.id}`);
    }
  }

  // 3. Add to workspace block list (prevent re-import)
  await addToBlockList([email]);
  console.log(`  Added to block list`);

  // 4. Log for compliance records
  console.log(`  Deletion complete. Log this for GDPR records.`);
}

// CAN-SPAM: Ensure unsubscribe is honored
async function handleUnsubscribe(email: string) {
  // 1. Add to block list (global across all campaigns)
  await addToBlockList([email]);

  // 2. Also add the domain if it's a business-wide request
  // const domain = email.split("@")[1];
  // await addToBlockList([domain]);

  console.log(`Unsubscribe processed: ${email} added to global block list`);
}

// Email verification before import
async function verifyEmail(email: string) {
  // Start verification
  await client.request("/email-verification", {
    method: "POST",
    body: JSON.stringify({
      email,
      webhook_url: "https://api.yourapp.com/webhooks/verification",
    }),
  });

  // Check status (may need to poll)
  const result = await client.request<{
    email: string; status: string; reason: string;
  }>(`/email-verification/${encodeURIComponent(email)}`);

  return result;
}

Key API Endpoints

MethodPathPurpose
POST/leadsCreate lead
POST/leads/listList/filter leads
PATCH/leads/{id}Update lead
DELETE/leads/{id}Delete single lead
DELETE/leadsBulk delete leads
POST/leads/moveMove leads between campaigns/lists
POST/leads/update-interest-statusUpdate interest status
POST/lead-listsCreate lead list
GET/lead-listsList lead lists
POST/block-lists-entriesAdd block list entry
POST/block-lists-entries/bulk-createBulk add entries
POST/email-verificationVerify email
GET/campaigns/search-by-contactFind campaigns by lead

Error Handling

ErrorCauseSolution
422 on lead createDuplicate in workspaceUse skip_if_in_workspace: true
Lead not found in campaignAlready deleted or movedSearch across campaigns first
Block list fullToo many entriesRemove outdated entries periodically
Email verification timeoutExternal service delayPoll status endpoint

Resources

Next Steps

For workspace access control, see instantly-enterprise-rbac.

When not to use it

  • When importing leads without verifying email formats
  • When ignoring CAN-SPAM compliance requirements

Prerequisites

API key with leads:all scopeUnderstanding of CAN-SPAM/GDPR

Limitations

  • Block list capacity is finite
  • Email verification may require polling

How it compares

This provides a programmatic interface for compliance and list hygiene, whereas manual list management is prone to human error and regulatory non-compliance.

Compared to similar skills

instantly-data-handling side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
instantly-data-handling (this skill)125dReviewIntermediate
posthog-webhooks-events125dCautionIntermediate
telegram-bot-builder1066moReviewIntermediate
mcp-integration218moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

posthog-webhooks-events

jeremylongshore

Implement PostHog webhook signature validation and event handling. Use when setting up webhook endpoints, implementing signature verification, or handling PostHog event notifications securely. Trigger with phrases like "posthog webhook", "posthog events", "posthog webhook signature", "handle posthog events", "posthog notifications".

11

telegram-bot-builder

davila7

Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.

106130

mcp-integration

anthropics

This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context Protocol", "connect external service", mentions "${CLAUDE_PLUGIN_ROOT} with MCP", or discusses MCP server types (SSE, stdio, HTTP, WebSocket). Provides comprehensive guidance for integrating Model Context Protocol servers into Claude Code plugins for external tool and service integration.

21123

n8n-workflow-patterns

czlonkowski

Proven workflow architectural patterns from real n8n workflows. Use when building new workflows, designing workflow structure, choosing workflow patterns, planning workflow architecture, or asking about webhook processing, HTTP API integration, database operations, AI agent workflows, or scheduled tasks.

16115

discord-send-message

Nice-Wolf-Studio

Send messages to Discord channels via the Discord API. Use this skill when the user wants to send text messages, notifications, or formatted content to a Discord channel.

7123

n8n-code-javascript

czlonkowski

Write JavaScript code in n8n Code nodes. Use when writing JavaScript in n8n, using $input/$json/$node syntax, making HTTP requests with $helpers, working with dates using DateTime, troubleshooting Code node errors, or choosing between Code node modes.

7122

Search skills

Search the agent skills registry