Mailgun REST API
Powerful email API for developers
Mailgun is a transactional email API service built for developers. It provides powerful sending infrastructure, advanced analytics, and email validation to ensure reliable email delivery at scale. Developers use Mailgun for transactional emails, marketing campaigns, email validation, and comprehensive tracking of email performance.
https://api.mailgun.net/v3
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /messages | Send an email message with HTML content, attachments, and custom headers |
| GET | /events | Retrieve email events including delivered, opened, clicked, bounced, and failed |
| POST | /messages.mime | Send a MIME-formatted email message for full control over email structure |
| GET | /domains | List all domains configured in your Mailgun account |
| POST | /domains | Add a new domain to your Mailgun account for sending emails |
| GET | /domains/{domain}/credentials | Get SMTP credentials for a specific domain |
| POST | /address/validate | Validate email addresses to check syntax and deliverability |
| GET | /stats/total | Get aggregate statistics for emails sent, delivered, opened, and clicked |
| POST | /lists | Create a mailing list for managing email recipients |
| GET | /lists/{list}/members | Retrieve all members of a specific mailing list |
| POST | /lists/{list}/members | Add a new member to a mailing list with optional custom variables |
| GET | /bounces | Retrieve the list of bounced email addresses |
| DELETE | /bounces/{address} | Remove an email address from the bounce list |
| POST | /routes | Create a route to forward or store incoming emails based on patterns |
| GET | /webhooks | List all configured webhooks for email event notifications |
Sponsor this page
AvailableReach developers actively building with Mailgun. See live pageview data and self-serve checkout — your slot goes live in minutes.
View inventory & pricing →Code Examples
curl -s --user 'api:YOUR_API_KEY' \
https://api.mailgun.net/v3/YOUR_DOMAIN/messages \
-F from='Sender <sender@YOUR_DOMAIN>' \
-F to='recipient@example.com' \
-F subject='Hello from Mailgun' \
-F text='This is a test email sent via Mailgun API' \
-F html='<html><body><h1>Hello!</h1><p>This is a test email.</p></body></html>'
Use Mailgun from Claude / Cursor / ChatGPT
Get a hosted MCP endpoint for Mailgun. Paste your Mailgun API key, copy back one URL, drop it into Claude Desktop, Cursor, or any AI client that supports remote MCP. Your AI calls Mailgun directly with your credentials — no local install, works on mobile.
send_email
Send transactional emails with custom content, recipients, and attachments via Mailgun API
validate_email
Validate email addresses for syntax and deliverability before sending messages
get_email_events
Retrieve email delivery events including opens, clicks, bounces, and failures for tracking
manage_mailing_list
Create and manage mailing lists, add/remove members, and retrieve subscriber information
check_email_stats
Fetch aggregate email statistics including delivery rates, open rates, and click rates
Connect in 60 seconds
Paste your Mailgun key → get an MCP URL → paste into Claude/Cursor. Hosted by IOX, encrypted at rest.
Connect Mailgun to your AI →