Email API SMTP User
Create SMTP User
Creates a new SMTP user credential that can be used for sending emails through SendClean. Each SMTP
user acts as an independent sending identity with its own limits, quotas, and tracking.
SMTP users allow you to:
- Segregate email traffic by application, department, or customer
- Apply different sending limits to different use cases
- Track delivery metrics separately for each use case
- Implement granular access control
When creating an SMTP user, you must configure:
- Total email limit: Maximum number of emails this user can send overall
- Hourly limit: Maximum emails per hour to control sending rate and prevent spam flags
Best practices suggest creating separate SMTP users for different email types (transactional vs. marketing) to maintain
better deliverability and easier troubleshooting.
Endpoint Details
| HTTP Method | POST |
|---|---|
| Endpoint Path | v1.0/settings/addSmtp |
| API Version | Single API (v1.0) |
| Content-Type | application/json |
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| owner_id | String | Yes | Your unique SendClean account identifier | user_12345 |
| token | String | Yes | Your API authentication token for secure access | sk_live_abc123... |
| total_limit | Integer | Yes | Maximum total emails allowed for this SMTP user. Acts as overall quota | 10000 |
| hourly_limit | Integer | Yes | Maximum emails per hour for this SMTP user. Controls sending rate | 100 |
Request Example
Below is a complete example of the request body. Replace placeholder values with your actual credentials and data.
{
"owner_id": "{{owner_id}}",
"token": "{{oken}}",
"total_limit": 10,
"hourly_limit": 1
}Response Format
Successful Response:
{
"status": "success",
"code": 200,
"message": "Resource created successfully",
"data": {
"id": "resource_abc123",
"created_at": "2026-04-17T10:30:00Z"
}
}Common Use Cases
- Create separate SMTP users for each microservice
- Set up dedicated credentials for staging vs production
- Provision SMTP access for third-party integrations
- Create isolated credentials for each client in multi-tenant systems
Best Practices
- • Set conservative limits initially and increase based on actual usage
- • Use descriptive usernames that indicate purpose (e.g., 'app-notifications')
- • Create separate SMTP users for different email types (transactional vs marketing)
- • Document SMTP user purpose and usage in your internal systems
- • Monitor usage regularly to optimize limit allocation
Common Errors & Troubleshooting
400 - Invalid limits: Hourly limit exceeds total limit
Solution: Ensure hourly_limit is less than total_limit. Hourly limit should be realistic fraction of daily capacity.
403 - Quota exceeded: Account SMTP user limit reached
Solution: Upgrade your plan to increase SMTP user allowance or remove unused SMTP users.
401 - Unauthorized: Authentication credentials are missing or invalid
Solution: Verify owner_id and token are correct. Ensure they match your account credentials exactly with no extra whitespace.
500 - Internal server error: Unexpected server error occurred
Solution: Retry the request after a brief delay. If error persists, contact SendClean support with the request details and timestamp.
Implementation Examples
curl -X POST \
https://api.sendclean.com/v1.0/settings/addSmtp \
-H 'Content-Type: application/json' \
-d '{
"owner_id": "{{owner_id}}",
"token": "{{oken}}",
"total_limit": 10,
"hourly_limit": 1
}'const axios = require('axios');
const url = 'https://api.sendclean.com/v1.0/settings/addSmtp';
const payload = {
"owner_id":"{{owner_id}}",
"token":"{{oken}}",
"total_limit":10,
"hourly_limit":1
} ;
axios.post(url, payload, {
headers: {
'Content-Type': 'application/json'
}
})
.then(response => {
console.log('Success:', response.data);
})
.catch(error => {
console.error('Error:', error.response ? error.response.data : error.message);
});<?php
$url = 'https://api.sendclean.com/v1.0/settings/addSmtp';
$payload = json_decode('{
"owner_id":"{{owner_id}}",
"token":"{{oken}}",
"total_limit":10,
"hourly_limit":1
} ', true);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode == 200) {
$result = json_decode($response, true);
print_r($result);
} else {
echo "Error: $httpCode - $response";
}
?>Update SMTP User
Modifies the configuration of an existing SMTP user. This endpoint allows you to update sending limits,
enable or disable the user, and adjust other settings without creating a new credential.
Common scenarios for editing SMTP users:
- Increasing limits during high-traffic periods
- Temporarily disabling a compromised credential
- Adjusting hourly limits to optimize deliverability
- Updating status based on sender reputation changes
Changes to SMTP configuration take effect immediately, so use caution when modifying production credentials.
Endpoint Details
| HTTP Method | POST |
|---|---|
| Endpoint Path | v1.0/settings/editSmtp |
| API Version | Single API (v1.0) |
| Content-Type | application/json |
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| owner_id | String | Yes | Your unique SendClean account identifier | user_12345 |
| token | String | Yes | Your API authentication token for secure access | sk_live_abc123... |
| smtp_user_name | String | Yes | The SMTP username to use for sending this email | smtp_user_001 |
| total_limit | Integer | Yes | Maximum total emails allowed for this SMTP user. Acts as overall quota | 10000 |
| hourly_limit | Integer | Yes | Maximum emails per hour for this SMTP user. Controls sending rate | 100 |
| status | String | No | SMTP user status. Values: "Enable" to activate, "Disable" to pause | Enable |
Request Example
Below is a complete example of the request body. Replace placeholder values with your actual credentials and data.
{
"owner_id": "{{owner_id}}",
"token": "{{token}}",
"smtp_user_name": "{{smtp_user_name}}",
"total_limit": 80,
"hourly_limit": 15,
"status": "Enable"
}Response Format
Successful Response:
{
"status": "success",
"code": 200,
"message": "Resource updated successfully",
"data": {
"updated_at": "2026-04-17T10:30:00Z"
}
}Common Errors & Troubleshooting
401 - Unauthorized: Authentication credentials are missing or invalid
Solution: Verify owner_id and token are correct. Ensure they match your account credentials exactly with no extra whitespace.
500 - Internal server error: Unexpected server error occurred
Solution: Retry the request after a brief delay. If error persists, contact SendClean support with the request details and timestamp.
Implementation Examples
curl -X POST \
https://api.sendclean.com/v1.0/settings/editSmtp \
-H 'Content-Type: application/json' \
-d '{
"owner_id": "{{owner_id}}",
"token": "{{token}}",
"smtp_user_name": "{{smtp_user_name}}",
"total_limit": 80,
"hourly_limit": 15,
"status": "Enable"
}'const axios = require('axios');
const url = 'https://api.sendclean.com/v1.0/settings/editSmtp';
const payload = {
"owner_id":"{{owner_id}}",
"token":"{{token}}",
"smtp_user_name":"{{smtp_user_name}}",
"total_limit":80,
"hourly_limit":15,
"status":"Enable"
} ;
axios.post(url, payload, {
headers: {
'Content-Type': 'application/json'
}
})
.then(response => {
console.log('Success:', response.data);
})
.catch(error => {
console.error('Error:', error.response ? error.response.data : error.message);
});<?php
$url = 'https://api.sendclean.com/v1.0/settings/editSmtp';
$payload = json_decode('{
"owner_id":"{{owner_id}}",
"token":"{{token}}",
"smtp_user_name":"{{smtp_user_name}}",
"total_limit":80,
"hourly_limit":15,
"status":"Enable"
} ', true);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode == 200) {
$result = json_decode($response, true);
print_r($result);
} else {
echo "Error: $httpCode - $response";
}
?>List SMTP Users
Retrieves a complete list of all SMTP users configured in your account along with their current status,
limits, and usage statistics.
The response includes for each SMTP user:
- Username and creation date
- Current status (Enabled/Disabled)
- Total and hourly limits
- Current usage against limits
- Recent activity summary
Use this endpoint to:
- Build admin dashboards showing all SMTP credentials
- Monitor usage across different applications
- Identify unused or underutilized credentials
- Audit access and permissions
Endpoint Details
| HTTP Method | POST |
|---|---|
| Endpoint Path | v1.0/settings/listSmtp |
| API Version | Single API (v1.0) |
| Content-Type | application/json |
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| owner_id | String | Yes | Your unique SendClean account identifier | user_12345 |
| token | String | Yes | Your API authentication token for secure access | sk_live_abc123... |
Request Example
Below is a complete example of the request body. Replace placeholder values with your actual credentials and data.
{
"owner_id": "{{owner_id}}",
"token": "{{token}}"
}Response Format
Successful Response:
{
"status": "success",
"code": 200,
"data": {
"items": [
{
"id": "item_001",
"created_at": "2026-04-01T09:00:00Z",
"status": "active"
}
],
"total": 1,
"page": 0
}
}Common Errors & Troubleshooting
401 - Unauthorized: Authentication credentials are missing or invalid
Solution: Verify owner_id and token are correct. Ensure they match your account credentials exactly with no extra whitespace.
500 - Internal server error: Unexpected server error occurred
Solution: Retry the request after a brief delay. If error persists, contact SendClean support with the request details and timestamp.
Implementation Examples
curl -X POST \
https://api.sendclean.com/v1.0/settings/listSmtp \
-H 'Content-Type: application/json' \
-d '{
"owner_id": "{{owner_id}}",
"token": "{{token}}"
}'const axios = require('axios');
const url = 'https://api.sendclean.com/v1.0/settings/listSmtp';
const payload = {
"owner_id":"{{owner_id}}",
"token":"{{token}}"
} ;
axios.post(url, payload, {
headers: {
'Content-Type': 'application/json'
}
})
.then(response => {
console.log('Success:', response.data);
})
.catch(error => {
console.error('Error:', error.response ? error.response.data : error.message);
});<?php
$url = 'https://api.sendclean.com/v1.0/settings/listSmtp';
$payload = json_decode('{
"owner_id":"{{owner_id}}",
"token":"{{token}}"
} ', true);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode == 200) {
$result = json_decode($response, true);
print_r($result);
} else {
echo "Error: $httpCode - $response";
}
?>Updated 4 days ago