Overview
The SmartLead API uses standard HTTP status codes and structured error responses to communicate what went wrong. This guide covers how to interpret errors, implement robust retry logic, and debug the most common issues.HTTP Status Codes
| Code | Meaning | Action |
|---|---|---|
200 | Success | Request completed successfully |
201 | Created | Resource created successfully |
400 | Bad Request | Fix the request payload — check required fields and data types |
401 | Unauthorized | Check your API key |
403 | Forbidden | You don’t have access to this resource |
404 | Not Found | The resource (campaign, lead, etc.) doesn’t exist |
409 | Conflict | Duplicate resource — the lead or campaign already exists |
422 | Unprocessable Entity | Validation failed — check field values |
429 | Too Many Requests | Rate limited — slow down and retry after the delay |
500 | Internal Server Error | SmartLead server issue — retry with exponential backoff |
503 | Service Unavailable | Temporary outage — retry after a short delay |
Error Response Format
Error responses follow a consistent JSON structure:Implementing Error Handling
Basic Error Handler
Retry with Exponential Backoff
For transient errors (429, 500, 503), implement automatic retries:Python
Common Errors and Solutions
401 — Invalid API key
401 — Invalid API key
Cause: The
api_key parameter is missing, expired, or incorrect.Fix: Verify your API key in SmartLead Settings → API Keys. Regenerate if needed. Ensure the key is passed as a query parameter: ?api_key=YOUR_KEY.400 — email field is required
400 — email field is required
Cause: One or more leads in your
lead_list are missing the email field.Fix: Validate your data before sending. Every lead object must have an email field with a valid email address.400 — Lead list exceeds maximum size
400 — Lead list exceeds maximum size
Cause: You’re trying to import more than 400 leads in a single request.Fix: Batch your imports into groups of 400 or fewer. See the Lead Management Guide for a batching example.
404 — Campaign not found
404 — Campaign not found
Cause: The campaign ID doesn’t exist or belongs to a different account.Fix: Verify the campaign ID by listing your campaigns first:
409 — Lead already exists in campaign
409 — Lead already exists in campaign
Cause: A lead with the same email address is already in this campaign.Fix: This isn’t necessarily an error — SmartLead prevents duplicate sends. Check the
skipped_leads array in the import response for details.429 — Rate limit exceeded
429 — Rate limit exceeded
Cause: Too many requests in a short time period.Fix: Implement exponential backoff (see above). Check the
Retry-After header for the recommended wait time. See the Rate Limits Guide for details.500 — Internal server error
500 — Internal server error
Cause: An unexpected error on SmartLead’s servers.Fix: Retry with exponential backoff. If the error persists, check the SmartLead status page and contact support with the request details.
Debugging Tips
Log Every Request and Response
Python
Validate Data Before Sending
Python
