curl -X POST "https://server.smartlead.ai/api/v1/email-accounts/save?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"from_name": "John Doe",
"from_email": "john@example.com",
"user_name": "john@example.com",
"password": "your_app_password",
"smtp_host": "smtp.gmail.com",
"smtp_port": 587,
"imap_host": "imap.gmail.com",
"imap_port": 993,
"warmup_enabled": true,
"total_warmup_per_day": 20,
"daily_rampup": 2,
"max_email_per_day": 50,
"time_to_wait_in_mins": 5,
"type": "GMAIL"
}'
import requests
API_KEY = "YOUR_API_KEY"
payload = {
"from_name": "John Doe",
"from_email": "john@example.com",
"user_name": "john@example.com",
"password": "your_app_password",
"smtp_host": "smtp.gmail.com",
"smtp_port": 587,
"imap_host": "imap.gmail.com",
"imap_port": 993,
"warmup_enabled": True,
"total_warmup_per_day": 20,
"daily_rampup": 2,
"max_email_per_day": 50,
"time_to_wait_in_mins": 5,
"type": "GMAIL",
"signature": "<p>Best regards,<br>John</p>"
}
response = requests.post(
"https://server.smartlead.ai/api/v1/email-accounts/save",
params={"api_key": API_KEY},
json=payload
)
result = response.json()
if result.get('ok'):
print(f"Email account added successfully. ID: {result['data']['id']}")
else:
print(f"Error: {result.get('message')}")
const API_KEY = 'YOUR_API_KEY';
const payload = {
from_name: 'John Doe',
from_email: 'john@example.com',
user_name: 'john@example.com',
password: 'your_app_password',
smtp_host: 'smtp.gmail.com',
smtp_port: 587,
imap_host: 'imap.gmail.com',
imap_port: 993,
warmup_enabled: true,
total_warmup_per_day: 20,
daily_rampup: 2,
max_email_per_day: 50,
time_to_wait_in_mins: 5,
type: 'GMAIL',
signature: '<p>Best regards,<br>John</p>'
};
const response = await fetch(
`https://server.smartlead.ai/api/v1/email-accounts/save?api_key=${API_KEY}`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
}
);
const result = await response.json();
if (result.ok) {
console.log(`Email account added successfully. ID: ${result.data.id}`);
} else {
console.log(`Error: ${result.message}`);
}
{
"ok": true,
"message": "Email account added successfully",
"data": {
"id": 123,
"from_email": "john@example.com",
"is_smtp_success": true,
"is_imap_success": true,
"warmup_details": {
"status": "ACTIVE",
"total_warmup_per_day": 20
}
}
}
{
"ok": false,
"message": "SMTP connection failed",
"error": "Invalid credentials"
}
{
"message": "Invalid API Key"
}
{
"error": "from_name is required"
}
Email Account Management
Add SMTP Email Account
Add new SMTP/IMAP email account with connection validation and optional warmup configuration
POST
/
api
/
v1
/
email-accounts
/
save
curl -X POST "https://server.smartlead.ai/api/v1/email-accounts/save?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"from_name": "John Doe",
"from_email": "john@example.com",
"user_name": "john@example.com",
"password": "your_app_password",
"smtp_host": "smtp.gmail.com",
"smtp_port": 587,
"imap_host": "imap.gmail.com",
"imap_port": 993,
"warmup_enabled": true,
"total_warmup_per_day": 20,
"daily_rampup": 2,
"max_email_per_day": 50,
"time_to_wait_in_mins": 5,
"type": "GMAIL"
}'
import requests
API_KEY = "YOUR_API_KEY"
payload = {
"from_name": "John Doe",
"from_email": "john@example.com",
"user_name": "john@example.com",
"password": "your_app_password",
"smtp_host": "smtp.gmail.com",
"smtp_port": 587,
"imap_host": "imap.gmail.com",
"imap_port": 993,
"warmup_enabled": True,
"total_warmup_per_day": 20,
"daily_rampup": 2,
"max_email_per_day": 50,
"time_to_wait_in_mins": 5,
"type": "GMAIL",
"signature": "<p>Best regards,<br>John</p>"
}
response = requests.post(
"https://server.smartlead.ai/api/v1/email-accounts/save",
params={"api_key": API_KEY},
json=payload
)
result = response.json()
if result.get('ok'):
print(f"Email account added successfully. ID: {result['data']['id']}")
else:
print(f"Error: {result.get('message')}")
const API_KEY = 'YOUR_API_KEY';
const payload = {
from_name: 'John Doe',
from_email: 'john@example.com',
user_name: 'john@example.com',
password: 'your_app_password',
smtp_host: 'smtp.gmail.com',
smtp_port: 587,
imap_host: 'imap.gmail.com',
imap_port: 993,
warmup_enabled: true,
total_warmup_per_day: 20,
daily_rampup: 2,
max_email_per_day: 50,
time_to_wait_in_mins: 5,
type: 'GMAIL',
signature: '<p>Best regards,<br>John</p>'
};
const response = await fetch(
`https://server.smartlead.ai/api/v1/email-accounts/save?api_key=${API_KEY}`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
}
);
const result = await response.json();
if (result.ok) {
console.log(`Email account added successfully. ID: ${result.data.id}`);
} else {
console.log(`Error: ${result.message}`);
}
{
"ok": true,
"message": "Email account added successfully",
"data": {
"id": 123,
"from_email": "john@example.com",
"is_smtp_success": true,
"is_imap_success": true,
"warmup_details": {
"status": "ACTIVE",
"total_warmup_per_day": 20
}
}
}
{
"ok": false,
"message": "SMTP connection failed",
"error": "Invalid credentials"
}
{
"message": "Invalid API Key"
}
{
"error": "from_name is required"
}
Creates a new email account with SMTP and IMAP configuration. SmartLead will validate the connection and optionally enable email warmup. Supports both standard SMTP accounts and OAuth providers (Gmail, Outlook).
Query Parameters
Request Body
curl -X POST "https://server.smartlead.ai/api/v1/email-accounts/save?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"from_name": "John Doe",
"from_email": "john@example.com",
"user_name": "john@example.com",
"password": "your_app_password",
"smtp_host": "smtp.gmail.com",
"smtp_port": 587,
"imap_host": "imap.gmail.com",
"imap_port": 993,
"warmup_enabled": true,
"total_warmup_per_day": 20,
"daily_rampup": 2,
"max_email_per_day": 50,
"time_to_wait_in_mins": 5,
"type": "GMAIL"
}'
import requests
API_KEY = "YOUR_API_KEY"
payload = {
"from_name": "John Doe",
"from_email": "john@example.com",
"user_name": "john@example.com",
"password": "your_app_password",
"smtp_host": "smtp.gmail.com",
"smtp_port": 587,
"imap_host": "imap.gmail.com",
"imap_port": 993,
"warmup_enabled": True,
"total_warmup_per_day": 20,
"daily_rampup": 2,
"max_email_per_day": 50,
"time_to_wait_in_mins": 5,
"type": "GMAIL",
"signature": "<p>Best regards,<br>John</p>"
}
response = requests.post(
"https://server.smartlead.ai/api/v1/email-accounts/save",
params={"api_key": API_KEY},
json=payload
)
result = response.json()
if result.get('ok'):
print(f"Email account added successfully. ID: {result['data']['id']}")
else:
print(f"Error: {result.get('message')}")
const API_KEY = 'YOUR_API_KEY';
const payload = {
from_name: 'John Doe',
from_email: 'john@example.com',
user_name: 'john@example.com',
password: 'your_app_password',
smtp_host: 'smtp.gmail.com',
smtp_port: 587,
imap_host: 'imap.gmail.com',
imap_port: 993,
warmup_enabled: true,
total_warmup_per_day: 20,
daily_rampup: 2,
max_email_per_day: 50,
time_to_wait_in_mins: 5,
type: 'GMAIL',
signature: '<p>Best regards,<br>John</p>'
};
const response = await fetch(
`https://server.smartlead.ai/api/v1/email-accounts/save?api_key=${API_KEY}`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
}
);
const result = await response.json();
if (result.ok) {
console.log(`Email account added successfully. ID: ${result.data.id}`);
} else {
console.log(`Error: ${result.message}`);
}
Response Codes
{
"ok": true,
"message": "Email account added successfully",
"data": {
"id": 123,
"from_email": "john@example.com",
"is_smtp_success": true,
"is_imap_success": true,
"warmup_details": {
"status": "ACTIVE",
"total_warmup_per_day": 20
}
}
}
{
"ok": false,
"message": "SMTP connection failed",
"error": "Invalid credentials"
}
{
"message": "Invalid API Key"
}
{
"error": "from_name is required"
}
Configuration Examples
Gmail Configuration
Gmail Configuration
{
"from_name": "Your Name",
"from_email": "your.email@gmail.com",
"user_name": "your.email@gmail.com",
"password": "your_app_specific_password",
"smtp_host": "smtp.gmail.com",
"smtp_port": 587,
"imap_host": "imap.gmail.com",
"imap_port": 993,
"type": "GMAIL",
"warmup_enabled": true
}
Outlook/Office 365 Configuration
Outlook/Office 365 Configuration
{
"from_name": "Your Name",
"from_email": "your.email@outlook.com",
"user_name": "your.email@outlook.com",
"password": "your_password",
"smtp_host": "smtp.office365.com",
"smtp_port": 587,
"imap_host": "outlook.office365.com",
"imap_port": 993,
"type": "OUTLOOK",
"warmup_enabled": true
}
Custom SMTP Configuration
Custom SMTP Configuration
{
"from_name": "Your Name",
"from_email": "you@yourdomain.com",
"user_name": "you@yourdomain.com",
"password": "your_password",
"smtp_host": "smtp.yourdomain.com",
"smtp_port": 587,
"imap_host": "imap.yourdomain.com",
"imap_port": 993,
"type": "SMTP",
"warmup_enabled": false
}
Usage Notes
For Gmail accounts, you must use an App Password rather than your regular Gmail password. Enable 2-factor authentication first, then generate an app password.
SmartLead automatically validates SMTP and IMAP connections upon adding an account. If validation fails, the account is still created but marked with connection errors that you can fix later.
Enable warmup for new email accounts to gradually build sender reputation. Set
total_warmup_per_day to start with 10-20 emails and use daily_rampup of 2-5 to increase daily volume gradually.Related Endpoints
- Add OAuth Email Account - For OAuth-based Gmail/Outlook
- Get All Email Accounts
- Update Warmup Settings
