curl -X DELETE "https://server.smartlead.ai/api/v1/email-accounts/123?api_key=YOUR_KEY"
import requests
API_KEY = "YOUR_API_KEY"
account_id = 123
response = requests.delete(
f"https://server.smartlead.ai/api/v1/email-accounts/{account_id}",
params={"api_key": API_KEY}
)
result = response.json()
if result.get('ok'):
print(f"Email account {account_id} deleted successfully")
else:
print(f"Error: {result.get('message')}")
const API_KEY = 'YOUR_API_KEY';
const accountId = 123;
const response = await fetch(
`https://server.smartlead.ai/api/v1/email-accounts/${accountId}?api_key=${API_KEY}`,
{ method: 'DELETE' }
);
const result = await response.json();
if (result.ok) {
console.log(`Email account ${accountId} deleted successfully`);
} else {
console.log(`Error: ${result.message}`);
}
{
"ok": true,
"message": "Email account deleted successfully!",
"emailAccountId": 123
}
{
"message": "Invalid API Key"
}
{
"ok": false,
"message": "Email account not found!",
"errorCode": "ACCOUNT_NOT_FOUND",
"emailAccountId": 123
}
Email Account Management
Delete Email Account
Delete an email account and remove it from all campaigns
DELETE
/
api
/
v1
/
email-accounts
/
{email_account_id}
curl -X DELETE "https://server.smartlead.ai/api/v1/email-accounts/123?api_key=YOUR_KEY"
import requests
API_KEY = "YOUR_API_KEY"
account_id = 123
response = requests.delete(
f"https://server.smartlead.ai/api/v1/email-accounts/{account_id}",
params={"api_key": API_KEY}
)
result = response.json()
if result.get('ok'):
print(f"Email account {account_id} deleted successfully")
else:
print(f"Error: {result.get('message')}")
const API_KEY = 'YOUR_API_KEY';
const accountId = 123;
const response = await fetch(
`https://server.smartlead.ai/api/v1/email-accounts/${accountId}?api_key=${API_KEY}`,
{ method: 'DELETE' }
);
const result = await response.json();
if (result.ok) {
console.log(`Email account ${accountId} deleted successfully`);
} else {
console.log(`Error: ${result.message}`);
}
{
"ok": true,
"message": "Email account deleted successfully!",
"emailAccountId": 123
}
{
"message": "Invalid API Key"
}
{
"ok": false,
"message": "Email account not found!",
"errorCode": "ACCOUNT_NOT_FOUND",
"emailAccountId": 123
}
Deleting an email account removes it from all campaigns and deactivates warmup. This action cannot be undone. Ensure no active campaigns rely on this account before deletion.
Path Parameters
number
required
The email account ID to delete
Query Parameters
string
required
Your SmartLead API key
curl -X DELETE "https://server.smartlead.ai/api/v1/email-accounts/123?api_key=YOUR_KEY"
import requests
API_KEY = "YOUR_API_KEY"
account_id = 123
response = requests.delete(
f"https://server.smartlead.ai/api/v1/email-accounts/{account_id}",
params={"api_key": API_KEY}
)
result = response.json()
if result.get('ok'):
print(f"Email account {account_id} deleted successfully")
else:
print(f"Error: {result.get('message')}")
const API_KEY = 'YOUR_API_KEY';
const accountId = 123;
const response = await fetch(
`https://server.smartlead.ai/api/v1/email-accounts/${accountId}?api_key=${API_KEY}`,
{ method: 'DELETE' }
);
const result = await response.json();
if (result.ok) {
console.log(`Email account ${accountId} deleted successfully`);
} else {
console.log(`Error: ${result.message}`);
}
Response Codes
Success
Email account deleted successfully
Unauthorized
Invalid or missing API key
Not Found
Email account not found or you don’t have access to it
Internal Server Error
Server error occurred
{
"ok": true,
"message": "Email account deleted successfully!",
"emailAccountId": 123
}
{
"message": "Invalid API Key"
}
{
"ok": false,
"message": "Email account not found!",
"errorCode": "ACCOUNT_NOT_FOUND",
"emailAccountId": 123
}
Deletion Behavior
When an email account is deleted:
- Removed from all campaign associations
- Warmup status set to
INACTIVEwith reason “Email account is deleted by user action” - Smart sender domain mappings are deleted
- Account is soft-deleted (not permanently removed from database)
Before deleting an email account, ensure:
- No active campaigns depend solely on this account
- You have alternative email accounts configured
- All scheduled emails from this account have been sent or rescheduled
Related Endpoints
- Get All Email Accounts
- Suspend Email Account - Temporarily disable without deleting
- Add SMTP Email Account
