Weekly product update: Try our new domains API, now in private beta

While the domain API beta launch is long closed, read more to see how we implemented this launch. Read more...



Recently, we’ve been working on our newest API to make it easier for customers to automate their email. After working with a select set of alpha customers, today we’re ready to extend the API to a larger group of beta testers. So, say hello the Domains API.

Using multiple domains in your Mailgun account

Many of our customers are buildings applications on top of Mailgun that allow their end customers to send email. Since you can operate multiple domains in a single Mailgun account, one of the things these customers can do is isolate one customer from another so that they each have their own whitelabel domain, their own sending queue, and their own SPF & DKIM records. Each customer’s sending reputation is also isolated, so if one customer gets the bad idea to buy an email list and send out spam, Mailgun can disable just that domain to protect your repuation, leaving other customers unaffected.

If you don’t want to give each customer their own domain, you could create buckets of domains for customers and manage reputation isolation that way. For example, you can have one domain that you use to send our your own transactional email and three buckets for your customers that you want to isolate. For example:

  • My transactional email: “”

  • My new customers: “”

  • My verified transactional customers: “”

  • My verified bulk sending customers: “”

Before the Domains API, each of these domains had to be created manually through the Mailgun control panel. That’s ok if you only have four domains like in this example, but what about if you have 4000? That’s a lot of clicking. Enter the Domains API…

Create and manage domains programatically with the Domains API

With our newest API, you can do the following programmatically:

  • Retrieve list of domains: Returns list of domains under your account in JSON.

  • Retrieve details about a particular domain: Returns details for a single domain, including SMTP credentials and DNS records.

  • Create a new domain

  • Delete a domain

Will there be a charge for using the domain’s API?

We are still finalizing pricing for when the Domains API is released in general availability, but our current thinking is to charge a reasonable per-domain fee. We welcome feedback on this and we will keep our beta-testers well informed of the final pricing details prior to general availability.

How can I try out the new Domains API?

If you want to test out the Domains API, or provide feedback on anything else, just email We’ll give you access and give you the documentation so you can start managing your own domains programmatically.

Please let us know what else you would like to see in the Domains API and thank you to everyone who has already provided feedback.

Happy emailing, The Mailgunners

Related readings

The basics of email subdomains

When it comes to email sending, sometimes you need more than the press of a button to get your message across. You may have heard of email subdomains, but you may be...

Read more

Learning to improve Gmail deliverability

The inbox is a crowded arena, but you can’t compete if you don’t even make the cut. Any email sender will tell you email deliverability is a key success indicator and a surefire...

Read more

Catch-all domain support is now available in email verifications

Here at Mailgun, our focus has always been on creating solutions that solve problems big...

Read more

Popular posts

Email inbox.

Build Laravel 10 email authentication with Mailgun and Digital Ocean

When it was first released, Laravel version 5.7 added a new capability to verify user’s emails. If you’ve ever run php artisan make:auth within a Laravel app you’ll know the...

Read more

Mailgun statistics.

Sending email using the Mailgun PHP API

It’s been a while since the Mailgun PHP SDK came around, and we’ve seen lots of changes: new functionalities, new integrations built on top, new API endpoints…yet the core of PHP...

Read more

Statistics on deliverability.

Here’s everything you need to know about DNS blocklists

The word “blocklist” can almost seem like something out of a movie – a little dramatic, silly, and a little unreal. Unfortunately, in the real world, blocklists are definitely something you...

Read more

Mailgun iconSee what you can accomplish with the world's best email delivery platform. It's easy to get started.Let's get sending
CTA icon Mailgun Icon