Complete guide to integrating CleanMail's email verification API into your application.
All API requests require authentication using your API key via the X-API-Key header.
curl -X POST https://cleanmail.dev/api/verify \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{"email": "user@example.com"}'
Verify an email address to check if it's valid, deliverable, and not a spam trap or disposable.
{
"email": "user@example.com",
"webhookUrl": "https://yourapp.com/webhooks/cleanmail"
}
{
"email": "user@example.com",
"valid": true,
"reason": "deliverable",
"risk": "low",
"isDisposable": false,
"isRoleAccount": false,
"isFreeProvider": false,
"isCatchall": false,
"isSpamTrap": false,
"mxFound": true,
"delivery": "deliverable",
"requestId": "req_abc123"
}
Receive real-time notifications when email verifications complete.
Webhooks enable asynchronous processing. Submit verification requests and receive results at your callback URL when processing completesβperfect for high-volume applications.
1. Submit verification with your webhook URL:
POST /api/verify
{
"email": "user@example.com",
"webhookUrl": "https://yourapp.com/webhooks/cleanmail"
}
2. Receive result at your webhook:
POST https://yourapp.com/webhooks/cleanmail
{
"requestId": "req_abc123",
"email": "user@example.com",
"valid": true,
"reason": "deliverable",
...
}
{
"requestId": "req_abc123",
"email": "user@example.com",
"valid": true,
"reason": "deliverable",
"risk": "low",
"isDisposable": false,
"isRoleAccount": false,
"isFreeProvider": false,
"isCatchall": false,
"isSpamTrap": false,
"mxFound": true,
"delivery": "deliverable",
"verifiedAt": "2026-04-20T12:00:00Z"
}
200 OK immediately, then process asynchronously to avoid timeouts.
Try CleanMail without an API key! The demo endpoint is rate-limited but lets you test the service.
curl -X POST https://cleanmail.dev/api/demo/verify \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com"}'
const response = await fetch('https://cleanmail.dev/api/verify', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key'
},
body: JSON.stringify({
email: 'user@example.com',
webhookUrl: 'https://yourapp.com/webhooks/cleanmail'
})
});
const result = await response.json();
console.log(result);
// { valid: true, reason: 'deliverable', ... }
import requests
response = requests.post(
'https://cleanmail.dev/api/verify',
headers={'X-API-Key': 'your_api_key'},
json={'email': 'user@example.com'}
)
result = response.json()
print(result)
curl -X POST https://cleanmail.dev/api/verify \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key" \
-d '{"email": "user@example.com"}'
$ch = curl_init('https://cleanmail.dev/api/verify');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'X-API-Key: your_api_key'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'email' => 'user@example.com'
]));
$response = curl_exec($ch);
$result = json_decode($response, true);
Contact us at support@cleanmail.dev for technical support or sales inquiries.