Follow the steps 1 and 2 of the official Cloudways tutorial to obtain an API key for your account (Read the tutorial). Copy the API Key as we will need it in the following steps.
The next piece of information we will need is the server ID of the server hosting your WordPress install on Cloudways. To discover the server ID, visit the Server Management screen of the server. The server ID will be present on the URL of that page after the “/server/” portion of it.
The URL takes the form of https://platform.cloudways.com/server/SERVER_ID_HERE/access_detail
We’ll need to do a similar thing to obtain the App ID for your WordPress installation. Go to Application Management screen of your WordPress app and the App ID will be present on the URL, after the “/apps/” portion of it.
The same thing happens here: the URL takes the form of https://platform.cloudways.com/apps/YOUR_APP_ID_HERE/access_detail
The Cloudways API is a bit strange in that it doesn’t offer a way to add or remove just one domain, only a way to update the whole domain list. That means that WP Multisite WaaS will replace all domains you might have there with the list of mapped domains of the network every time a new domain is added.
If there are domains you want to keep on the list, use the WU_CLOUDWAYS_EXTRA_DOMAINS as demonstrated below, with a comma-separated list of the domains you wanna keep (this is useful if you need a wildcard setting, for example, that needs to be on that list at all times).
define('WU_CLOUDWAYS_EXTRA_DOMAINS', '*.yourdomain.com,extradomain1.com,extradomain2.com');
Here’s how it should look on your wp-config.php (fake values used below):
You’re all set!
Now, every time a new domain is mapped in the network (via the Aliases tab by the network admin or via the custom domain meta-box on the user’s Account page) will be added to the Cloudways platform automatically.
The same is true for domain removals. Every time a domain is deleted from the network, that change will be communicated to your Cloudways account instantly!