Base URL
All API calls referenced in our documentation start with a base URL. Mailgun allows the ability to send and receive email in both US and EU regions. Be sure to use the appropriate base URL based on which region you have created for your domain.
It is also important to note that Mailgun uses URI versioning for our API endpoints, and some endpoints may have different versions than others. Please reference the version stated in the URL for each endpoint.
For domains created in our US region the base URL is:
https://api.mailgun.net/
For domains created in our EU region the base URL is:
https://api.eu.mailgun.net/
Your Mailgun account may contain multiple sending domains. To avoid passing the domain name as a query parameter, most API URLs must include the name of the domain you are interested in:
https://api.mailgun.net/v3/mydomain.com
Date Format
Mailgun returns JSON for all API calls. JSON does not have a built-in date type; dates are passed as strings encoded according to RFC 2822#page-14. This format is native to JavaScript and is also supported by most programming languages out of the box:
'Thu, 13 Oct 2011 18:02:00 +0000'
Abbreviated time zones like (EST, CET, IST, HLC) may not result in the correct offset due to the ambiguous nature of abbreviated time zones. The numerical offset (+0500) or GMT/UTC is preferred.
Mailgun Regions
Using a single account and billing plan, you can choose to provision new sending domains in the EU environment. It is important to note that message data never leaves the region in which it is processed. Only a limited amount of account data is replicated globally, giving you a single account from which to manage domains in both the US and the EU.
Here are the specifics on the type of data that is replicated globally versus what is region-bound:
Global | Region-Bound (US / EU) |
---|---|
Account Information, User Accounts, Billing Details (invoices/plan information), API Keys, Domain Names | Domain Metadata (e.g., SMTP credentials), Messages, Event Logs, Suppressions, Mailing Lists, Tags, Statistics, Routes, IP Addresses |
Below are the endpoints you will use for sending/receiving/tracking messages in the EU:
Service | US Endpoint | EU Endpoint |
---|---|---|
REST API | api.mailgun.net | api.eu.mailgun.net |
Outgoing SMTP Server | smtp.mailgun.org | smtp.eu.mailgun.org |
Inbound SMTP Server (Routes) | mxa.mailgun.org | mxa.eu.mailgun.org |
Inbound SMTP Server (Routes) | mxb.mailgun.org | mxb.eu.mailgun.org |
mailgun.org | eu.mailgun.org | |
Open/Click Tracking Endpoint |