API Reference
Complete documentation for integrating MailCannon's powerful email tools into your application.
Getting Started
MailCannon's API allows you to automate your communication workflows. Whether you need to trigger a campaign after a user action or verify an email address during signup, our RESTful API has you covered.
Base URL
https://mailcannon.pro/api/v1Formats
JSON requests & responses
Authentication
API Key Management
All API requests must be authenticated using an API key.
Your API Key should be passed in the X-API-KEY header for every request.
Security Note: Never share your API key or commit it to version control. If a key is compromised, revoke it immediately in the dashboard.
How to get your API Key:
- Log in to your MailCannon Dashboard.
- Navigate to Settings and click on the API Keys tab.
- Click Generate New Key, give it a name, and copy the secret key.
Send Email
/send-email-campaign-by-id
Trigger a campaign to a specific recipient.
POST
Request Parameters
| Field | Type | Description |
|---|---|---|
| campaign_id | String | Required The ID of the campaign to send. |
| String | Required Recipient's email address. | |
| username | String | Optional Recipient's name for personalization. |
Implementation Examples
curl -X POST https://mailcannon.pro/api/v1/send-email-campaign-by-id \
-H "X-API-KEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"name": "User Name",
"campaign_id": "your_campaign_id_here"
}'Email Checker
/email-checker
Verify if an email address exists and is reachable.
POST
Request Parameters
| Field | Type | Description |
|---|---|---|
| String | Required Email to verify. |
Implementation Examples
curl -X POST https://mailcannon.pro/api/v1/email-checker \
-H "X-API-KEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"email": "verify@example.com"
}'Response Structure
The API returns a detailed reachability report including syntax check, SMTP handshake, and Gravatar data.
{
"success": true,
"data": {
"is_reachable": "safe",
"syntax": { "is_valid_syntax": true },
"smtp": { "can_connect_smtp": true, "is_deliverable": true }
}
}