Posted by Sushmit Goswami, Product Manager, Google Apps for Work, and Wesley Chun, Developer Advocate, Google Apps
To provide developers and administrators with more fine-grained control, the Google Apps Admin SDK now includes new domain management features. These new APIs let you programmatically manage domains for your Google Apps account, similar to other RESTful resources like Users, Groups, etc., providing a superset of the domain management capabilities available on the Domains page in the Admin console today.
Change your primary domain
The Customers API gives enterprise developers and administrators the ability to swap the current primary domain with a selected secondary domain for a Google Apps installation. The “change primary” operation is essentially transparent to the user, but users moved to the secondary domain will be subject to certain restrictions (refer to this Help Center article for details). Customers who want to rebrand their business with a new primary domain can follow this up by renaming users from the old (now secondary) to the new (now primary) domain using the Users API.
Add and remove domains and aliases
The Domains API lets developers create tools for administrators to add and remove domains, similar to the functionality available on the Domains page in the Admin console. In addition, the API lets you programmatically add aliases for any domain, primary or secondary, but aliases for secondary domains can only be added via the API.