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
Display name for outgoing emails (e.g., “John Doe”)
Email address (must be valid email format)
SMTP username (usually the email address)
SMTP password or app-specific password
SMTP server hostname (e.g., “smtp.gmail.com”)
SMTP server port (common ports: 587 for TLS, 465 for SSL, 25 for plain)
IMAP server hostname (e.g., “imap.gmail.com”)
IMAP server port (common ports: 993 for SSL, 143 for plain)
Whether to enable email warmup for this account
Email account ID (only for updates, null for new accounts)
Email provider type. Valid values: GMAIL, OUTLOOK, SMTP
OAuth token object (for Gmail/Outlook OAuth accounts)
different_reply_to_address
Custom reply-to email address (if different from from_email)
IMAP username (if different from SMTP username)
IMAP password (if different from SMTP password)
Maximum emails allowed per day (including warmup and campaign emails)
Custom domain for tracking links
BCC email address for all outgoing emails
Minimum time to wait between emails in minutes
Number of warmup emails to send per day (if warmup_enabled is true)
Daily increase in warmup email count
Target reply rate percentage for warmup emails
Client ID for multi-tenant accounts
Whether the account should be suspended upon creation
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"
}'
Response Codes
Email account added successfully with connection validation
SMTP or IMAP connection failed - check credentials and server settings
Invalid or missing API key
Missing required fields or invalid field values
200 - Success
400 - Connection Failed
401 - Unauthorized
422 - Validation Error
{
"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
}
}
}
Configuration Examples
{
"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
{
"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
{
"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.