Integrate MailQA's powerful email testing and validation tools into your application
To use the MailQA API, you'll need an API key. You can generate one from your dashboard.
All API requests must include your API key in the Authorization header as a Bearer token:
Authorization: Bearer YOUR_API_KEY
All API endpoints require authentication using Bearer tokens. Include your API key in the Authorization header of every request.
curl -X POST https://api.mailqa.com/v1/verify-email \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json"
/api/v1/verify-emailVerify if an email address is valid and deliverable
{
"valid": true,
"email": "user@example.com",
"disposable": false,
"role_based": false,
"smtp_check": {
"valid": true,
"deliverable": true
},
"mx_records": ["mx1.example.com", "mx2.example.com"],
"credits_remaining": 95
}curl -X POST https://api.mailqa.com/v1/verify-email \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com"}'const axios = require('axios');
const response = await axios.post(
'https://api.mailqa.com/v1/verify-email',
{ email: 'user@example.com' },
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
console.log(response.data);import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
data = {'email': 'user@example.com'}
response = requests.post(
'https://api.mailqa.com/v1/verify-email',
headers=headers,
json=data
)
print(response.json())/api/v1/spam-testAnalyze an email for spam triggers and get a deliverability score
{
"spam_score": 2.5,
"rating": "good",
"deliverability": 92,
"issues": [
{
"type": "warning",
"message": "Subject line contains ALL CAPS",
"impact": "low"
}
],
"recommendations": [
"Add unsubscribe link",
"Include physical address"
],
"credits_remaining": 94
}curl -X POST https://api.mailqa.com/v1/spam-test \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": "Your Newsletter",
"body": "<html>...</html>",
"from_email": "newsletter@example.com"
}'const axios = require('axios');
const response = await axios.post(
'https://api.mailqa.com/v1/spam-test',
{
subject: 'Your Newsletter',
body: '<html>...</html>',
from_email: 'newsletter@example.com'
},
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
console.log(response.data);import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
data = {
'subject': 'Your Newsletter',
'body': '<html>...</html>',
'from_email': 'newsletter@example.com'
}
response = requests.post(
'https://api.mailqa.com/v1/spam-test',
headers=headers,
json=data
)
print(response.json())/api/v1/dns-checkCheck SPF, DKIM, and DMARC records for a domain
{
"domain": "example.com",
"spf": {
"valid": true,
"record": "v=spf1 include:_spf.google.com ~all",
"status": "pass"
},
"dkim": {
"valid": true,
"selector": "default",
"status": "pass"
},
"dmarc": {
"valid": true,
"record": "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com",
"policy": "quarantine",
"status": "pass"
},
"mx_records": ["mx1.example.com", "mx2.example.com"],
"credits_remaining": 93
}curl -X POST https://api.mailqa.com/v1/dns-check \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domain": "example.com"}'const axios = require('axios');
const response = await axios.post(
'https://api.mailqa.com/v1/dns-check',
{ domain: 'example.com' },
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
console.log(response.data);import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
data = {'domain': 'example.com'}
response = requests.post(
'https://api.mailqa.com/v1/dns-check',
headers=headers,
json=data
)
print(response.json())The MailQA API uses standard HTTP status codes to indicate success or failure:
| Status Code | Description |
|---|---|
200 | Success - Request completed successfully |
400 | Bad Request - Invalid parameters or missing required fields |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - Insufficient credits or plan limitations |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Something went wrong on our end |
Rate limits vary by plan:
When you exceed your rate limit, the API will return a 429 status code. Check the X-RateLimit-Reset header to see when your limit resets.
Need help? Check out our support page or email us at support@mailqa.com
Join thousands of developers and teams who trust MailQA to test, validate, and optimize their email infrastructure.