Everything you need to integrate MailJunky into your application.
Install the official SDK for your language:
npm install @mailjunky/sdk
# or
pnpm add @mailjunky/sdk
# or
yarn add @mailjunky/sdkimport { MailJunky } from '@mailjunky/sdk'
const client = new MailJunky({
apiKey: 'mj_live_your_api_key'
})await client.emails.send({
from: '[email protected]',
to: '[email protected]',
subject: 'Welcome!',
html: '<h1>Welcome aboard!</h1>'
})await client.emails.send({
from: '[email protected]',
to: ['[email protected]', '[email protected]'],
cc: '[email protected]',
bcc: ['[email protected]'],
subject: 'Team Update',
html: '<p>Important announcement...</p>'
})Send personalized emails to multiple recipients efficiently:
await client.emails.sendBatch([
{
from: '[email protected]',
to: '[email protected]',
subject: 'Welcome, John!',
html: '<h1>Hi John, welcome aboard!</h1>'
},
{
from: '[email protected]',
to: '[email protected]',
subject: 'Welcome, Sarah!',
html: '<h1>Hi Sarah, welcome aboard!</h1>'
}
]){
"id": "email_abc123",
"message_id": "<[email protected]>",
"status": "sent"
}Store and manage your recipient list with custom properties for personalization in emails and workflows.
The upsert endpoint creates a new contact or updates an existing one if the email already exists:
await client.contacts.upsert({
email: '[email protected]',
first_name: 'John',
last_name: 'Doe',
phone: '+1 555 123 4567',
properties: {
company: 'Acme Inc',
plan: 'pro',
signup_source: 'website'
},
tags: ['customer', 'newsletter']
})Retrieve contacts with optional filtering:
const { data, pagination } = await client.contacts.list({
page: 1,
limit: 25,
status: 'active',
tag: 'customer'
})
// data contains array of contacts
// pagination: { page, limit, total, has_more }await client.contacts.update('contact_id', {
tags: ['customer', 'vip'],
properties: { plan: 'enterprise' },
status: 'active' // or 'unsubscribed'
})Import up to 1,000 contacts at once:
const result = await client.contacts.batch({
contacts: [
{ email: '[email protected]', first_name: 'User', last_name: 'One' },
{ email: '[email protected]', first_name: 'User', last_name: 'Two' },
// ... up to 1000 contacts
]
})
// result: { created: 150, updated: 50, failed: [] }Contact properties can be used as variables in your email templates:
In your email template HTML:
Hi __contact.first_name__,<br>
Your __contact.properties.plan__ plan is active. Track user behavior to trigger smart email workflows.
Event tracking has volume limits based on your plan tier.
await client.events.track({
event: 'product_viewed',
user: '[email protected]',
properties: {
product_id: 'prod_123',
price: 49.99
}
})user_signed_upNew user registrationpage_viewUser viewed a pagecart_addedItem added to cartcheckout_completedPurchase completedCreate automated email sequences triggered by user behavior.
Describe your workflow in plain English and our AI will build it for you!
Event-triggered workflows consume event quota each time they're triggered. High-volume workflows can quickly use your monthly event allocation.
Example: A "cart_abandoned" workflow triggered 10,000 times/month = 10k events consumed. On the Free plan (2k events), this would exceed your limit. Consider upgrading to Starter (50k events) or Pro (250k events) for high-traffic workflows.
Send a reminder email 30 minutes after cart addition if no checkout occurs.
{
"name": "Cart Abandonment - 30min",
"trigger_type": "EVENT",
"trigger_config": {
"eventName": "cart_added",
"delay": 30
},
"conditions": [
{
"type": "event_not_occurred",
"event": "checkout_completed",
"within_minutes": 30
}
],
"actions": [
{
"type": "send_email",
"config": {
"from": "[email protected]",
"subject": "You left something in your cart!",
"template": "cart_reminder"
}
}
]
}Use MailJunky directly from AI assistants like Claude Code and ChatGPT via the Model Context Protocol (MCP).
The Model Context Protocol allows AI assistants to use external tools. With MailJunky's MCP server, you can send emails, track events, and manage contacts through natural language.
https://mcp.mailjunky.ai/sseRun this command to add MailJunky as an MCP server:
claude mcp add --transport sse mailjunky https://mcp.mailjunky.ai/sse \
--header "Authorization: Bearer YOUR_API_KEY" Add to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"mailjunky": {
"url": "https://mcp.mailjunky.ai/sse",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}In ChatGPT, go to Settings → Connections → MCP Servers and add:
MailJunkyhttps://mcp.mailjunky.ai/sseOnce connected, your AI assistant can use these tools:
| Tool | Description |
|---|---|
send_email | Send emails to one or more recipients |
track_event | Track user events for workflows |
list_contacts | List and search contacts |
get_contact | Get a specific contact by ID |
create_contact | Create or update a contact (upsert) |
update_contact | Update an existing contact |
delete_contact | Delete a contact |
Once configured, just ask your AI assistant naturally:
All requests must include your API key:
Authorization: Bearer mj_live_your_api_key_here| Permission | Description |
|---|---|
send | Send emails |
track | Track user events |
contacts | Manage contacts (create, update, delete) |
read | Read analytics, logs, and contacts |
* | All permissions |
API requests are rate limited based on your plan tier and endpoint type. These limits protect our infrastructure and ensure fair usage.
All rate limits are negotiable. If your application requires higher throughput, contact us to discuss your needs. We're happy to work with high-volume senders.
Daily and monthly limits ensure reliable delivery:
| Plan | Per Day | Per Month | Overage |
|---|---|---|---|
| Free | 50 | 200 | — |
| Hobby | 50 | 500 | $1.00/1k (max $4) |
| Starter | 500 | 10,000 | $0.50/1k |
| Pro | 5,000 | 50,000 | $0.40/1k |
| Enterprise | Custom | Custom | Negotiated |
Per API key, per minute:
| Endpoint | Limit |
|---|---|
POST /emails/send | 60 requests/min |
POST /emails/batch | 10 requests/min |
POST /events/track | Quota-based* |
/contacts/* | 100 requests/min |
*Volume-Based Pricing - Event tracking is a premium feature with monthly volume limits based on your plan.
Exceeding your quota on the Free plan returns 429 errors. Paid plans allow overages.
| Plan | Events/Month | Overage |
|---|---|---|
| Free | 2,000 | — |
| Hobby | 5,000 | $0.02/1k events |
| Starter | 50,000 | $0.01/1k events |
| Pro | 250,000 | $0.005/1k events |
| Enterprise | Custom | Negotiated |
Every API response includes rate limit information:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 847
X-RateLimit-Reset: 1640995200When you exceed the rate limit, you'll receive a 429 status code:
try {
await client.emails.send({ /* ... */ })
} catch (error) {
if (error.status === 429) {
// Rate limit exceeded
const retryAfter = error.headers['retry-after']
console.log(\`Rate limited. Retry after \${retryAfter} seconds\`)
}
}Start sending emails and building AI-powered workflows today.