curl -X POST "https://server.smartlead.ai/api/v1/campaigns/123/send-test-email?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"leadId": 789,
"sequenceNumber": 1,
"customEmailAddress": "test@mycompany.com"
}'
import requests
API_KEY = "YOUR_API_KEY"
def send_test_email(campaign_id, lead_id, sequence_num, test_email=None):
payload = {
"leadId": lead_id,
"sequenceNumber": sequence_num
}
if test_email:
payload["customEmailAddress"] = test_email
response = requests.post(
f"https://server.smartlead.ai/api/v1/campaigns/{campaign_id}/send-test-email",
params={"api_key": API_KEY},
json=payload
)
if response.status_code == 200:
print(f"✅ Test email sent to {test_email or 'lead email'}")
return response.json()
# Send test to yourself
send_test_email(123, 789, 1, "myself@mycompany.com")
const API_KEY = 'YOUR_API_KEY';
async function sendTestEmail(campaignId, leadId, sequenceNum, testEmail) {
const payload = {
leadId,
sequenceNumber: sequenceNum,
customEmailAddress: testEmail
};
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/${campaignId}/send-test-email?api_key=${API_KEY}`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
}
);
return response.json();
}
await sendTestEmail(123, 789, 1, 'test@mycompany.com');
{
"success": true,
"message": "Test email sent successfully"
}
Campaign Management
Send Test Email
Send a test email from a specific sequence to verify content and deliverability
POST
/
api
/
v1
/
campaigns
/
{campaign_id}
/
send-test-email
curl -X POST "https://server.smartlead.ai/api/v1/campaigns/123/send-test-email?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"leadId": 789,
"sequenceNumber": 1,
"customEmailAddress": "test@mycompany.com"
}'
import requests
API_KEY = "YOUR_API_KEY"
def send_test_email(campaign_id, lead_id, sequence_num, test_email=None):
payload = {
"leadId": lead_id,
"sequenceNumber": sequence_num
}
if test_email:
payload["customEmailAddress"] = test_email
response = requests.post(
f"https://server.smartlead.ai/api/v1/campaigns/{campaign_id}/send-test-email",
params={"api_key": API_KEY},
json=payload
)
if response.status_code == 200:
print(f"✅ Test email sent to {test_email or 'lead email'}")
return response.json()
# Send test to yourself
send_test_email(123, 789, 1, "myself@mycompany.com")
const API_KEY = 'YOUR_API_KEY';
async function sendTestEmail(campaignId, leadId, sequenceNum, testEmail) {
const payload = {
leadId,
sequenceNumber: sequenceNum,
customEmailAddress: testEmail
};
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/${campaignId}/send-test-email?api_key=${API_KEY}`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
}
);
return response.json();
}
await sendTestEmail(123, 789, 1, 'test@mycompany.com');
{
"success": true,
"message": "Test email sent successfully"
}
Test your email sequences before launching. Send to yourself or team to review content, formatting, and personalization.
Path Parameters
number
required
Campaign ID
Query Parameters
string
required
Your SmartLead API key
Request Body
number
required
Lead ID to use for personalization variables
number
required
Which sequence to test (1, 2, 3, etc.)
number
Specific email account to send from (optional)
string
Custom recipient email (if different from lead’s email)
curl -X POST "https://server.smartlead.ai/api/v1/campaigns/123/send-test-email?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"leadId": 789,
"sequenceNumber": 1,
"customEmailAddress": "test@mycompany.com"
}'
import requests
API_KEY = "YOUR_API_KEY"
def send_test_email(campaign_id, lead_id, sequence_num, test_email=None):
payload = {
"leadId": lead_id,
"sequenceNumber": sequence_num
}
if test_email:
payload["customEmailAddress"] = test_email
response = requests.post(
f"https://server.smartlead.ai/api/v1/campaigns/{campaign_id}/send-test-email",
params={"api_key": API_KEY},
json=payload
)
if response.status_code == 200:
print(f"✅ Test email sent to {test_email or 'lead email'}")
return response.json()
# Send test to yourself
send_test_email(123, 789, 1, "myself@mycompany.com")
const API_KEY = 'YOUR_API_KEY';
async function sendTestEmail(campaignId, leadId, sequenceNum, testEmail) {
const payload = {
leadId,
sequenceNumber: sequenceNum,
customEmailAddress: testEmail
};
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/${campaignId}/send-test-email?api_key=${API_KEY}`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
}
);
return response.json();
}
await sendTestEmail(123, 789, 1, 'test@mycompany.com');
Response Example
{
"success": true,
"message": "Test email sent successfully"
}
Related Endpoints
⌘I
