curl "https://server.smartlead.ai/api/v1/email-accounts/fetch-email-account-details?api_key=YOUR_KEY&email=john@example.com"
import requests
API_KEY = "YOUR_API_KEY"
response = requests.get(
"https://server.smartlead.ai/api/v1/email-accounts/fetch-email-account-details",
params={
"api_key": API_KEY,
"email": "john@example.com",
"fetch_campaigns": True
}
)
if response.status_code == 404:
print("No email account with that address")
else:
account = response.json()
print(f"Account ID: {account['id']}")
print(f"SMTP Status: {'Connected' if account['is_smtp_success'] else 'Failed'}")
const API_KEY = 'YOUR_API_KEY';
const params = new URLSearchParams({
api_key: API_KEY,
email: 'john@example.com',
fetch_campaigns: true
});
const response = await fetch(
`https://server.smartlead.ai/api/v1/email-accounts/fetch-email-account-details?${params}`
);
if (response.status === 404) {
console.log('No email account with that address');
} else {
const account = await response.json();
console.log(`Account ID: ${account.id}`);
}
{
"id": 123,
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-11-26T08:00:00.000Z",
"user_id": 456,
"from_name": "John Doe",
"from_email": "john@example.com",
"username": "john@example.com",
"password": "decrypted_password",
"smtp_host": "smtp.gmail.com",
"smtp_port": 587,
"smtp_port_type": "TLS",
"message_per_day": 50,
"is_smtp_success": true,
"is_imap_success": true,
"type": "GMAIL",
"daily_sent_count": 25,
"client_id": null,
"warmup_details": {
"id": 789,
"status": "ACTIVE",
"created_at": "2025-01-15T10:30:00.000Z",
"reply_rate": 15,
"warmup_key_id": 1001,
"blocked_reason": null,
"total_sent_count": 450,
"total_spam_count": 2,
"warmup_max_count": 30,
"warmup_min_count": 10,
"is_warmup_blocked": false,
"max_email_per_day": 50,
"warmup_reputation": 95
},
"campaign_ids": [101, 102, 103]
}
{
"statusCode": 400,
"error": "Bad Request",
"message": "\"email\" must be a valid email",
"validation": {
"source": "query",
"keys": ["email"]
}
}
{
"error": "Email account not found"
}
Email Account Management
Get Email Account by Email Address
Look up a single email account by its email address instead of paging through every account
GET
/
api
/
v1
/
email-accounts
/
fetch-email-account-details
curl "https://server.smartlead.ai/api/v1/email-accounts/fetch-email-account-details?api_key=YOUR_KEY&email=john@example.com"
import requests
API_KEY = "YOUR_API_KEY"
response = requests.get(
"https://server.smartlead.ai/api/v1/email-accounts/fetch-email-account-details",
params={
"api_key": API_KEY,
"email": "john@example.com",
"fetch_campaigns": True
}
)
if response.status_code == 404:
print("No email account with that address")
else:
account = response.json()
print(f"Account ID: {account['id']}")
print(f"SMTP Status: {'Connected' if account['is_smtp_success'] else 'Failed'}")
const API_KEY = 'YOUR_API_KEY';
const params = new URLSearchParams({
api_key: API_KEY,
email: 'john@example.com',
fetch_campaigns: true
});
const response = await fetch(
`https://server.smartlead.ai/api/v1/email-accounts/fetch-email-account-details?${params}`
);
if (response.status === 404) {
console.log('No email account with that address');
} else {
const account = await response.json();
console.log(`Account ID: ${account.id}`);
}
{
"id": 123,
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-11-26T08:00:00.000Z",
"user_id": 456,
"from_name": "John Doe",
"from_email": "john@example.com",
"username": "john@example.com",
"password": "decrypted_password",
"smtp_host": "smtp.gmail.com",
"smtp_port": 587,
"smtp_port_type": "TLS",
"message_per_day": 50,
"is_smtp_success": true,
"is_imap_success": true,
"type": "GMAIL",
"daily_sent_count": 25,
"client_id": null,
"warmup_details": {
"id": 789,
"status": "ACTIVE",
"created_at": "2025-01-15T10:30:00.000Z",
"reply_rate": 15,
"warmup_key_id": 1001,
"blocked_reason": null,
"total_sent_count": 450,
"total_spam_count": 2,
"warmup_max_count": 30,
"warmup_min_count": 10,
"is_warmup_blocked": false,
"max_email_per_day": 50,
"warmup_reputation": 95
},
"campaign_ids": [101, 102, 103]
}
{
"statusCode": 400,
"error": "Bad Request",
"message": "\"email\" must be a valid email",
"validation": {
"source": "query",
"keys": ["email"]
}
}
{
"error": "Email account not found"
}
Returns the same payload as Get Email Account by ID. Use this when you know the address but not the account ID, so you don’t have to page through Get All Email Accounts to find it.
Query Parameters
string
required
Your SmartLead API key
string
required
The email address to look up, matched against the account’s
from_email. Case-insensitive for addresses stored in lowercase; otherwise pass the address exactly as it appears in from_email.boolean
default:"false"
If
true, includes array of campaign IDs using this email accountboolean
default:"false"
If
true, includes the tags assigned to this email accountcurl "https://server.smartlead.ai/api/v1/email-accounts/fetch-email-account-details?api_key=YOUR_KEY&email=john@example.com"
import requests
API_KEY = "YOUR_API_KEY"
response = requests.get(
"https://server.smartlead.ai/api/v1/email-accounts/fetch-email-account-details",
params={
"api_key": API_KEY,
"email": "john@example.com",
"fetch_campaigns": True
}
)
if response.status_code == 404:
print("No email account with that address")
else:
account = response.json()
print(f"Account ID: {account['id']}")
print(f"SMTP Status: {'Connected' if account['is_smtp_success'] else 'Failed'}")
const API_KEY = 'YOUR_API_KEY';
const params = new URLSearchParams({
api_key: API_KEY,
email: 'john@example.com',
fetch_campaigns: true
});
const response = await fetch(
`https://server.smartlead.ai/api/v1/email-accounts/fetch-email-account-details?${params}`
);
if (response.status === 404) {
console.log('No email account with that address');
} else {
const account = await response.json();
console.log(`Account ID: ${account.id}`);
}
Response Fields
Identical to Get Email Account by ID, including
warmup_details and the optional campaign_ids and tags arrays.Response Codes
Success
Email account retrieved successfully
Bad Request
email is missing or not a valid email addressUnauthorized
Invalid or missing API key
Not Found
No email account with that address exists on your account
Internal Server Error
Server error occurred
{
"id": 123,
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-11-26T08:00:00.000Z",
"user_id": 456,
"from_name": "John Doe",
"from_email": "john@example.com",
"username": "john@example.com",
"password": "decrypted_password",
"smtp_host": "smtp.gmail.com",
"smtp_port": 587,
"smtp_port_type": "TLS",
"message_per_day": 50,
"is_smtp_success": true,
"is_imap_success": true,
"type": "GMAIL",
"daily_sent_count": 25,
"client_id": null,
"warmup_details": {
"id": 789,
"status": "ACTIVE",
"created_at": "2025-01-15T10:30:00.000Z",
"reply_rate": 15,
"warmup_key_id": 1001,
"blocked_reason": null,
"total_sent_count": 450,
"total_spam_count": 2,
"warmup_max_count": 30,
"warmup_min_count": 10,
"is_warmup_blocked": false,
"max_email_per_day": 50,
"warmup_reputation": 95
},
"campaign_ids": [101, 102, 103]
}
{
"statusCode": 400,
"error": "Bad Request",
"message": "\"email\" must be a valid email",
"validation": {
"source": "query",
"keys": ["email"]
}
}
{
"error": "Email account not found"
}
Usage Notes
This endpoint returns decoded passwords in plain text. Use HTTPS and secure storage when handling this sensitive data.
A 404 is the cheapest way to check whether an address is already connected, so you can use this endpoint to test for existence before calling Add SMTP Account.
