JAB Creations

Active Member
Nov 21, 2009
44
7
58
I've had success testing adding a subdomain however after looking at the subdomain parent page there does not seem to be any available functionality to remove a subdomain.

Is there a UAPI function to delete subdomains or is there at least an open bug report/feature request for adding this functionality?

Edit 1: Go figure, moments later I find the cpapi2 equivalent. So my question now becomes:

Should I use cpapi2 or uapi? I know cPanel deprecates things every now and then and I'd like to future-proof as much as I can within reason.

Edit 2: So I came across this tweet and I wouldn't mind some confirmation.
 
Last edited:

cPanelTJ

Product Owner
Staff member
Jan 29, 2019
97
50
93
Houston, TX
cPanel Access Level
Root Administrator
Twitter
Hi @JAB Creations ,

There is not currently a UAPI function to delete a subdomain and, as you discovered, the API 2 operation is your best option. Regarding the tweet, API 2 is still supported as we have no intention of deprecating or removing it while useful API operation equivalents don't exist in UAPI. Our eventual goal is to upgrade API 2 to UAPI equivalents so that developers such as yourself only need to worry about using UAPI for cPanel.

If you find yourself using an API 2 call a lot throughout your code, I'd recommend creating a library or abstraction layer where your code can then use a defined function that makes the API 2 call and you'll have a singular place to replace it when it is eventually sunset. We currently do not have a timeline on API 2 yet as we are still working on removing API 1.
 

JAB Creations

Active Member
Nov 21, 2009
44
7
58
Thank you for the details. Is there at least a policy for supporting API 2 for X number of months after UAPI has 100% support equivalent? I can just set a reminder every X number of months on my calendar to spend a few minutes to update the functionality to the newer API.