API/Programmatically creating subsite from template

I would like to create a multisite from template using New Blog Templates programmatically.
Is there any API or a function I can call from my PHP code?

Thanks,
D.