All Posts

Smartlead API Guide: Build Custom Workflows (Pro Plan)

Smartlead's UI works fine when you are managing five campaigns and a few hundred leads. But the moment your outbound operation scales past that, the clicking becomes the bottleneck.

Smartlead API Guide: Build Custom Workflows (Pro Plan)

Published on
February 26, 2026

Overview

Smartlead's UI works fine when you are managing five campaigns and a few hundred leads. But the moment your outbound operation scales past that, the clicking becomes the bottleneck. You are manually uploading CSVs, copy-pasting lead data between tools, and checking campaign status one at a time. The API exists to eliminate all of that, but Smartlead's documentation leaves gaps that cost hours of debugging if you don't know where to look.

This guide covers the Smartlead API end to end: authentication setup, the endpoints that matter for campaign and lead management, webhook configuration for real-time event handling, and the integration patterns that connect Smartlead to the rest of your GTM stack. Whether you are building a custom enrichment-to-outreach pipeline with Clay or syncing campaign data back to your CRM, the API is how you turn Smartlead from a standalone tool into a programmable sending layer.

One important caveat upfront: API access requires Smartlead's Pro Plan ($94/month) or higher. The Basic Plan does not include API access, and this is the single most common frustration for teams that discover it after building integration specs.

Authentication and API Fundamentals

Smartlead uses API key authentication, which is the simplest pattern you will encounter in GTM integrations. If you have worked with REST API auth methods before, this is the straightforward end of the spectrum.

Getting Your API Key

1
Navigate to Settings: Log into Smartlead and go to Settings > General Settings. Your API key is displayed in the API section. Copy it and store it securely. Treat it like a password because anyone with this key can read and modify your campaigns, leads, and account data.
2
Verify access: Test the key immediately with a simple GET request to the campaigns endpoint. If you receive a 401 or 403, your plan does not include API access. Upgrade to Pro before building anything.
3
Store securely: Use environment variables, a secrets manager, or your platform's credential storage. Never hardcode the key in Clay formulas, n8n workflows, or Make scenarios where teammates can see it in plaintext.

Base URL and Request Format

All requests go to https://server.smartlead.ai/api/v1/ with your API key passed as a query parameter: ?api_key=YOUR_API_KEY. This is slightly unusual because most modern APIs pass authentication in headers, but Smartlead uses query parameters for their key. Request and response bodies use JSON.

Security Note

Passing API keys as query parameters means they appear in server logs and browser history. For production integrations, ensure all calls are server-side (not client-side JavaScript) and that your logging infrastructure redacts query parameters containing keys. This matters especially if you are building automation that logs requests for debugging.

Rate Limits

Smartlead enforces rate limits that vary by endpoint and plan tier. The Pro Plan allows approximately 100 requests per minute across most endpoints. Campaign creation and lead upload endpoints have lower limits, roughly 30 requests per minute, because they trigger heavier backend processing.

When you hit a rate limit, the API returns a 429 status code with a Retry-After header. The correct response is exponential backoff: wait the specified duration, then retry with increasing delays on subsequent failures. Teams that ignore this and hammer the API with immediate retries risk temporary key suspension.

Endpoint CategoryRate Limit (Pro Plan)Rate Limit (Custom Plan)Backoff Strategy
Campaign reads (GET)~100/min~300/minExponential, start at 1s
Campaign writes (POST/PATCH)~30/min~100/minExponential, start at 2s
Lead management~60/min~200/minExponential, start at 1s
Analytics/reporting~50/min~150/minExponential, start at 1s
Webhook configuration~20/min~50/minExponential, start at 3s

For a deeper look at managing rate limits across your full stack, see our API rate limiting guide. The short version: batch your operations, respect the 429 responses, and never run parallel API calls to the same endpoint without a queue.

Campaign Management Endpoints

Campaigns are the core object in Smartlead. Every outbound sequence you run maps to a campaign, and the API gives you full CRUD control over them. This is where programmatic campaign creation saves the most time because setting up campaigns manually through the UI takes 10-15 minutes each, and agencies running dozens of client campaigns feel that overhead acutely.

Creating Campaigns

The POST /api/v1/campaigns/create endpoint accepts a JSON body with the campaign name, sending schedule, and configuration options. A minimal creation request looks like this:

Minimal Campaign Creation Payload

POST /api/v1/campaigns/create?api_key=YOUR_KEY

Body: { "name": "Q1 VP Sales - Series A SaaS", "client_id": null }

The response includes the campaign_id you will need for all subsequent operations: adding sequences, uploading leads, configuring sending schedules, and pulling analytics.

After creation, you configure the campaign in separate calls. This modular approach is actually useful because it lets you build campaigns incrementally: create the shell, add sequences, configure settings, upload leads, and activate—each as a discrete step in your automation pipeline.

Configuring Sequences

Sequences are the email steps within a campaign. The POST /api/v1/campaigns/{campaign_id}/sequences endpoint lets you add and order sequence steps. Each step includes the subject line, body (supporting HTML and Smartlead variables like {{first_name}}), and the delay before sending.

The key here is variable mapping. If your leads include custom fields from a Clay enrichment pipeline, you need to ensure the variable names in your email templates match the field names in your lead upload. A mismatch means the variable renders as blank or literal text, and there is no validation at upload time to catch it.

Listing and Updating Campaigns

GET /api/v1/campaigns?api_key=YOUR_KEY returns all campaigns with their status, lead counts, and basic metrics. Use this for building dashboards or monitoring systems that track campaign health across your entire operation.

PATCH /api/v1/campaigns/{campaign_id}/status lets you pause, resume, or stop campaigns programmatically. This is critical for building guardrails: if your deliverability monitoring detects a bounce rate spike, your automation can pause the offending campaign before it damages sender reputation further. Teams running deliverability-focused operations often build this as an automated circuit breaker.

Campaign Settings

The settings endpoint (PATCH /api/v1/campaigns/{campaign_id}/settings) controls sending behavior: daily send limits per mailbox, sending windows (time zones and hours), stop-on-reply behavior, and tracking preferences. Two settings deserve special attention:

  • stop_on_reply: When enabled, a lead who replies is automatically removed from the sequence. This should almost always be true for cold outreach. Sending a follow-up to someone who already replied is the fastest way to burn goodwill.
  • track_opens: Open tracking inserts a pixel that modifies deliverability. For campaigns targeting technical audiences or companies with aggressive email security, disabling open tracking can improve inbox placement. The tradeoff is losing open rate data, which as we discuss in our Smartlead analytics guide, is already an unreliable metric.

Lead Management Endpoints

Lead management is where the API delivers the most value over the UI. Uploading leads via CSV through the dashboard means manual field mapping every time, no validation before import, and no way to programmatically control which leads enter which campaigns based on real-time qualification data.

Adding Leads to Campaigns

The POST /api/v1/campaigns/{campaign_id}/leads endpoint accepts an array of lead objects. Each lead requires at minimum an email address, but you should include every field your sequences reference.

Lead Upload Structure

Each lead object supports: email (required), first_name, last_name, company_name, and any number of custom fields as key-value pairs. Custom fields map directly to Smartlead template variables. Batch size is limited to 100 leads per request, so larger uploads require pagination logic.

The 100-lead batch limit is the constraint you will hit first when scaling. If your Clay table enriches 2,000 leads and you want to push them into a Smartlead campaign, you need 20 sequential API calls with proper rate limiting between each. Build this as a queue-based operation, not a synchronous loop, especially if you are running this inside n8n or Make where timeout behavior can be unpredictable.

Lead Status and Management

The GET /api/v1/campaigns/{campaign_id}/leads endpoint returns lead status within a campaign: queued, sent, replied, bounced, or unsubscribed. This data is essential for building closed-loop reporting. When a lead replies in Smartlead, that signal should propagate back to your CRM and enrichment systems to update the lead's status and prevent other campaigns from targeting the same person.

You can also remove leads from campaigns via DELETE /api/v1/campaigns/{campaign_id}/leads, which is useful for building exclusion logic. If a lead books a meeting through your scheduling tool, your automation should immediately remove them from all active Smartlead campaigns. This requires querying across campaigns to find where the lead exists, which means maintaining a local index or making list calls across all active campaigns.

Global Lead Operations

The GET /api/v1/leads endpoint lets you search for leads across all campaigns. This is the endpoint you use for de-duplication checks before uploading: query by email address to see if a lead already exists in another campaign, and skip the upload if they do. Teams scaling de-duplication and standardization workflows rely on this to prevent the same prospect from receiving outreach from multiple campaigns simultaneously.

Webhook Configuration

Smartlead supports outbound webhooks that fire when specific events occur: lead replies, emails bounce, leads unsubscribe, or campaign sequences complete. Webhooks turn Smartlead from a system you poll for updates into one that pushes events to you in real time.

Setting Up Webhooks

Configure webhooks through the POST /api/v1/webhooks endpoint or via Settings > Webhooks in the UI. Each webhook requires a target URL and the event types you want to subscribe to.

Event TypeFires WhenCommon Use Case
REPLY_RECEIVEDA lead replies to any email in a sequenceRoute to CRM, notify SDR via Slack, trigger qualification workflow
EMAIL_BOUNCEDAn email hard bouncesRemove from other campaigns, flag in enrichment system for re-verification
LEAD_UNSUBSCRIBEDA lead clicks the unsubscribe linkAdd to global suppression list, update CRM disposition
EMAIL_SENTAn email is successfully sentActivity logging in CRM, send-volume monitoring
LINK_CLICKEDA lead clicks a tracked linkIntent scoring, trigger follow-up sequence or task

Webhook Payload Structure

Smartlead webhook payloads include the lead's email, the campaign ID, the sequence step that triggered the event, and event-specific data (reply text for replies, bounce reason for bounces). The payload does not include the full lead record by default, which means if you need enrichment data or custom fields to process the event, you will need to make a follow-up API call to GET /api/v1/leads/{email} or maintain your own lead data store.

This is a common pain point. Your webhook handler receives a reply notification with just an email and campaign ID, but your downstream processing (CRM update, Slack notification, qualification trigger) needs the full lead context. Either enrich the payload in your webhook handler or, better yet, maintain a synchronized lead database that your handler can query locally. For teams building production webhook architectures, the decouple-ingestion-from-processing pattern applies directly here.

Webhook Reliability

Smartlead retries failed webhook deliveries up to three times with increasing delays. If your endpoint is down for an extended period, events are lost after the retry window expires. There is no built-in dead letter queue or event replay mechanism.

Reliability Pattern

For production systems, supplement webhooks with periodic polling of the lead status endpoint. Run a reconciliation job every 15-30 minutes that compares lead statuses in Smartlead against your local records. This catches any events that webhooks missed due to downtime or transient failures. It adds API call overhead but eliminates the risk of silent data loss.

Integration Patterns That Work

The API endpoints are building blocks. The real value comes from wiring them into automated workflows that connect Smartlead to the rest of your GTM infrastructure. Here are the patterns that teams actually run in production.

Pattern 1: Clay-to-Smartlead Enrichment Pipeline

This is the most common integration pattern. Clay enriches and qualifies leads, then pushes qualified leads into Smartlead campaigns based on segment or persona.

The workflow: Clay table enriches leads from your source (CRM export, Apollo list, inbound form). Qualification columns score and filter leads. A webhook or HTTP request column pushes passing leads to the appropriate Smartlead campaign via the leads endpoint. Custom fields from Clay (company size, tech stack, funding stage) map to Smartlead variables for deep personalization in sequences.

The key implementation detail is the campaign routing logic. Don't push all leads to a single campaign. Use Clay's formula columns to determine which campaign each lead should enter based on persona, company size, or intent signals. Then route the API call to the correct campaign ID.

Pattern 2: CRM Sync via Webhooks

When a lead replies in Smartlead, the REPLY_RECEIVED webhook fires. Your handler creates or updates a CRM record with the reply content, updates the lead's status, and optionally creates a task for the assigned rep. This gives reps visibility into email engagement without switching to Smartlead.

The reverse flow is equally important: when a deal closes or a lead is disqualified in your CRM, that event should trigger lead removal from active Smartlead campaigns. Build this as a CRM webhook that calls Smartlead's lead removal endpoint. Teams running CRM-to-sequencer field mapping need this bidirectional sync to keep data consistent across systems.

Pattern 3: Automated Campaign Lifecycle

For agencies or teams running high campaign volumes, automate the entire lifecycle: campaign creation, sequence configuration, lead upload, activation, monitoring, and teardown. This turns campaign launch from a 30-minute manual process into a single API call (or a short automation sequence).

Store campaign templates as JSON configurations in your codebase or a configuration database. When it's time to launch a new campaign, your automation reads the template, creates the campaign, configures sequences and settings, uploads the target leads from your enrichment pipeline, and activates sending. This approach is especially powerful for agencies managing multiple client campaigns where each client has standard campaign structures that repeat monthly.

Pattern 4: Engagement-Based Routing

Use the analytics endpoints to pull campaign performance data and feed it into routing decisions. If a particular campaign or sequence variant shows low reply rates, automatically pause it and redirect leads to a better-performing variant. This requires polling the analytics endpoint on a schedule and comparing performance against thresholds you define.

The sophistication ceiling here is high. You can build adaptive systems that A/B test sequence variants, measure results through the API, and automatically scale the winning variants, all without manual intervention. Teams exploring sequence A/B testing can use the API to automate what is otherwise a tedious manual process.

Error Handling and Debugging

Smartlead's API returns standard HTTP status codes, but the error messages vary in helpfulness. Here is what you will encounter and how to handle each case.

Common Error Codes

Status CodeMeaningWhat to Do
400Bad request: malformed JSON or missing required fieldsValidate payload structure before sending. Check for required fields like email on lead uploads.
401Unauthorized: invalid API keyVerify your API key. Check that your plan includes API access (Pro or higher).
403Forbidden: valid key but insufficient permissionsUsually means you're trying to access a resource owned by another sub-account or client space.
404Resource not found: invalid campaign_id or lead referenceVerify the ID exists. Campaign IDs change if you delete and recreate. Cache IDs locally and validate periodically.
429Rate limitedImplement exponential backoff. Read the Retry-After header. Do not immediately retry.
500Server errorRetry with backoff. If persistent, check Smartlead's status page. Log the full response for support tickets.

Silent Failures to Watch For

The most dangerous errors are the ones Smartlead doesn't tell you about. Several operations return 200 success codes while partially failing:

  • Lead uploads with invalid emails: A batch of 100 leads where 5 have malformed emails returns 200 with a success count of 95. If you don't check the response body's error array, those 5 leads disappear silently.
  • Duplicate leads: Uploading a lead that already exists in the campaign returns 200 but does not add a duplicate. This is actually correct behavior, but it means your upload count won't match your expected count if you're not deduplicating before upload.
  • Variable mismatches: Sequences referencing custom fields that don't exist in the lead data send with blank variable substitutions. There is no validation at upload or campaign activation time.
Defensive Coding Pattern

Always parse the full response body, not just the status code. For lead uploads, compare the uploaded_count in the response against your batch size. Log any discrepancy. For campaign creation, verify the returned campaign_id is valid by immediately querying it. Build your integrations to assume partial failure on every call, and your monitoring will catch the edge cases before they become pipeline gaps.

Debugging Toolkit

Build a small set of debugging utilities before you need them:

  • API call logger: Record every API request and response with timestamps. When something breaks at 2 AM, the logs tell you exactly which call failed and why.
  • Reconciliation script: A scheduled job that compares your local lead database against Smartlead's lead status API. Flags discrepancies for review.
  • Health check endpoint: A simple script that calls GET /api/v1/campaigns every 5 minutes and alerts if the response time exceeds 3 seconds or the status code is not 200. Early warning for API degradation.

Beyond Individual API Calls

Building a Smartlead API integration for a single campaign workflow is a weekend project. Making it work across 50 campaigns, three enrichment sources, a CRM, and a reporting dashboard is where things break down.

The problem is not any individual integration. It is the accumulated complexity. Your Clay-to-Smartlead pipeline works until you realize Smartlead reply webhooks need to update Salesforce, which also needs to trigger a Slack notification, which should reference the original enrichment data from Clay that is no longer easily accessible. Each connection works in isolation. The system fails as a whole because no single tool has the complete picture.

Campaign performance data lives in Smartlead. Lead enrichment context sits in Clay. Deal stage and rep assignment are in the CRM. When your webhook handler receives a reply, it needs to pull from all three to make an intelligent routing decision. So you build custom middleware. Then you maintain it. Then it breaks at 3 AM.

This is the problem that context platforms like Octave solve. Instead of building and maintaining point-to-point integrations between Smartlead, Clay, your CRM, and every other tool in the stack, Octave maintains a unified context layer that any system can query. When a Smartlead reply comes in, your handler doesn't need to make five API calls to assemble the lead's full picture. The context is already unified and available. For teams running Smartlead at the volumes where the API becomes necessary in the first place, this is the infrastructure that determines whether your automations scale gracefully or collapse under their own complexity.

FAQ

Which Smartlead plan includes API access?

API access requires the Pro Plan ($94/month) or higher. The Basic Plan ($39/month) does not include API access. If you are evaluating Smartlead specifically for API-driven workflows, factor the Pro Plan cost into your budget from the start. Attempting to build integrations on Basic and upgrading later means reconfiguring authentication across all your connections.

Can I use the Smartlead API with n8n or Make instead of writing custom code?

Yes. Both n8n and Make support HTTP request nodes that work with Smartlead's API. n8n is particularly well-suited because you can build custom HTTP request workflows with built-in error handling and retry logic. Make works for simpler flows but can be harder to debug when API calls fail. The tradeoff: no-code platforms handle the happy path well but require more effort for proper error handling and retry logic compared to a script.

How do I handle lead deduplication across campaigns?

Before uploading a lead to any campaign, query GET /api/v1/leads?email={email} to check if they exist in another active campaign. If they do, either skip the upload or remove them from the old campaign first. Smartlead does not enforce cross-campaign deduplication automatically, so this logic must live in your automation layer.

What happens to webhooks if my endpoint is down?

Smartlead retries failed webhook deliveries up to three times with increasing delays. After that, the event is dropped. There is no event replay or dead letter queue. For production systems, supplement webhooks with periodic polling of the lead status endpoint to catch missed events. A reconciliation job every 15-30 minutes provides a safety net.

Can I upload more than 100 leads per API call?

No. The lead upload endpoint has a hard cap of 100 leads per request. For larger uploads, batch your leads into groups of 100 and send sequential requests with rate-limiting delays between each. At the Pro Plan rate limit, uploading 5,000 leads takes approximately 10-15 minutes when you account for backoff. Plan your automation timing accordingly.

Does the API support A/B testing of email variants?

Yes. You can create multiple sequence variants within a campaign via the API and Smartlead will distribute leads across variants. Pull variant-level performance data from the analytics endpoints to determine winners. For automated optimization, build a scheduled job that compares variant metrics and pauses underperformers once statistical significance is reached.

Conclusion

The Smartlead API transforms the platform from a manual email tool into a programmable component of your outbound infrastructure. The endpoints are straightforward once you understand the authentication model, rate limits, and the batch constraints on lead management. The real complexity lives not in any single API call but in the integration patterns that connect Smartlead to the rest of your GTM stack.

Start with the simplest pattern that solves your immediate bottleneck. For most teams, that is automating lead uploads from an enrichment pipeline like Clay. Once that is stable, add webhook-based reply routing to your CRM. Then build out campaign lifecycle automation and performance monitoring. Each layer reduces manual work and increases the speed at which your outbound operation can iterate.

The teams that extract the most value from the API are the ones that treat error handling and monitoring as first-class concerns from day one. Build your logging, reconciliation, and health checks before you need them. When something breaks at scale, and it will, those are the systems that tell you what happened and where to fix it.

FAQ

Frequently Asked Questions

Still have questions? Get connected to our support team.