# Mailgun API **Provider:** Mailgun **Category:** communication **Base URL:** `https://api.mailgun.net/v3` **Auth:** basic — `Authorization: Basic base64(api:YOUR_API_KEY)` **Rate Limit:** 100 messages/sec (per domain) **Free Tier:** Yes — [object Object] **Pricing:** Free tier available (freemium) **Docs:** https://documentation.mailgun.com ## Description Mailgun is a developer-focused email service provider with powerful sending, receiving, and validation capabilities. Send transactional and marketing emails at scale, receive inbound email to an HTTP webhook, validate email addresses before sending, parse incoming email messages, and access detailed delivery analytics. Features DKIM/SPF/DMARC auto-setup, email templates, scheduled sending, and click/open tracking. Trusted by 150,000+ businesses. ## Endpoints | Method | Endpoint | Description | |--------|----------|-------------| | POST | `https://api.mailgun.net/v3/{domain}/messages` | Send an email message | | GET | `https://api.mailgun.net/v3/{domain}/events` | Query email delivery events (sent, opened, clicked) | | GET | `https://api.mailgun.net/v3/address/validate` | Validate an email address for deliverability | | POST | `https://api.mailgun.net/v3/{domain}/routes` | Create inbound email routing rules | | GET | `https://api.mailgun.net/v3/{domain}/stats/total` | Get aggregate delivery statistics | | GET | `https://api.mailgun.net/v3/{domain}/bounces` | List bounced email addresses | ## Authentication Use HTTP Basic Auth with username "api" and your API key as the password. Your base URL includes your region (api.mailgun.net for US, api.eu.mailgun.net for EU). ``` Authorization: Basic base64(api:YOUR_API_KEY) ``` ## Sample Request ```bash curl "https://api.mailgun.net/v3/sandboxabc.mailgun.org/messages" \ -u "api:$MAILGUN_API_KEY" \ -F from='Sender ' \ -F to='user@example.com' \ -F subject='Hello from Mailgun' \ -F text='Testing email delivery!' ``` ## Sample Response ```json { "id": "<20240315100000.abc123@sandboxabc.mailgun.org>", "message": "Queued. Thank you." } ``` ## Pricing Details Foundation: $35/mo (50k emails). Scale: $90/mo (100k emails). Custom enterprise pricing available. --- *Source: [API Map](https://apimap.dev/apis/mailgun/) — CC BY 4.0*