[The Hub] Programmatic Domain Management via Hosting API & CLI

0

FEATURE REQUEST: Programmatic Domain Management via Hosting API & CLI

Category: Hosting API / CLI Tooling
Target Platform: WPMU DEV Hosting & The Hub

————————————————–

SUMMARY
Requesting the ability to add, configure, and map domains/subdomains to WPMU DEV hosted sites programmatically via the Hosting API and CLI. Currently, domain assignment is strictly restricted to manual input inside The Hub UI.

————————————————–

USE CASE & PROBLEM STATEMENT
When scaling single-tenant client deployments (e.g., automated onboarding where each subscriber gets their own dedicated hosting instance running a pre-configured template), the entire provisioning workflow can be scripted—except for the domain mapping step.

Because domain configuration is currently unavailable in the API/CLI:

• Every new purchase or signup requires a human admin to manually log into The Hub, navigate to the site, and add the custom domain or client subdomain.
• Automated checkout funnels (Landing Page → Checkout → Instance Provisioned → Instant App Login) break at the very last mile.
• Clients are either stuck using default tempurl.host URLs or must wait for manual intervention before accessing their branded instance.

This manual bottleneck directly limits our ability to scale dedicated hosting volume on WPMU DEV.

————————————————–

PROPOSED SOLUTION

1. WPMU CLI Commands
Expose domain management via the CLI tool:

# Add a new custom domain or subdomain to a hosted instance
wpmu hosting domain add <site-id> <domain.com> [--primary]

# List active domains mapped to a site
wpmu hosting domain list <site-id>

# Set an existing domain as primary
wpmu hosting domain set-primary <site-id> <domain.com>

# Remove a mapped domain
wpmu hosting domain remove <site-id> <domain.com>

2. Hosting REST API Endpoints
Complement CLI access with REST endpoints for headless automation workflows:

• POST /v1/hosting/sites/{site_id}/domains
Payload: {"domain": "sub.clientdomain.com", "primary": true}
Function: Adds domain mapping and queues automated SSL certificate provisioning.

• GET /v1/hosting/sites/{site_id}/domains
Function: Returns status, DNS verification status, and SSL provisioning state.

• DELETE /v1/hosting/sites/{site_id}/domains/{domain_id}
Function: Unbinds domain from the host.

————————————————–

BUSINESS & PLATFORM IMPACT
• Drives Hosting Growth: Allows partners, agencies, and SaaS creators to programmatically sell dozens or hundreds of dedicated WPMU DEV hosting instances without ballooning DevOps overhead.
• Flawless End-User Experience: Enables immediate, hands-off onboarding where end-users land directly on their branded setup post-purchase.