Hi BaiHe,
This is not feasible if you host your domain at Office 365. If you need to manage your domains via programmatically, you may consider changing to a third party domain hosting provider which supports this feature.
Additionally, I’d like to mention that you can add, verify, and remove domains in bulk in Office 365 using the Office 365 Domain Manger or via PowerShell.
Best Regards,
Eric Yang