EHCP API Setup subdomain

Hi,

is there a possibility that I can create a subdomain trough an API?

---
Kind regards,

Robin

If you have some php knowledge, you can write it by looking at existing api and classapp.php (core file).