The admindomains function adds, lists and deletes addon domains and subdomains of a hosting account.
URL: https://YOUR-SERVER:2304/v1/admindomains/ — permission Domains and Subdomains.
| Parameter | Description |
|---|---|
action | add, list or del |
user | Hosting account username |
type | domain (addon domain) or subdomain |
name | The domain (example.org) or the full subdomain (blog.example.com) |
path | Document root relative to the account’s home folder, for example /public_html/example.org (for add) |
autossl | 1 = also install a free SSL certificate (for add; the name must already point to the server) |
Add an addon domain
curl -k -X POST https://203.0.113.10:2304/v1/admindomains/ \
-d "key=YOUR_API_KEY&action=add&user=john&type=domain&name=example.org&path=/public_html/example.org"
{"status":"OK","message":"Data Updated!"}
Add a subdomain
curl -k -X POST https://203.0.113.10:2304/v1/admindomains/ \
-d "key=YOUR_API_KEY&action=add&user=john&type=subdomain&name=blog.example.com&path=/public_html/blog"
{"status":"OK","message":"Data Updated!"}
List
type is required — list addon domains and subdomains separately.
curl -k -X POST https://203.0.113.10:2304/v1/admindomains/ -d "key=YOUR_API_KEY&action=list&user=john&type=domain"
{"status":"OK","msj":[{"domain":"example.org","path":"/home/john/public_html/example.org"}]}
curl -k -X POST https://203.0.113.10:2304/v1/admindomains/ -d "key=YOUR_API_KEY&action=list&user=john&type=subdomain"
{"status":"OK","msj":[{"subdomain":"blog.example.com","path":"/home/john/public_html/blog"}]}
Without type the response is empty.
Delete
curl -k -X POST https://203.0.113.10:2304/v1/admindomains/ -d "key=YOUR_API_KEY&action=del&user=john&type=subdomain&name=blog.example.com"
curl -k -X POST https://203.0.113.10:2304/v1/admindomains/ -d "key=YOUR_API_KEY&action=del&user=john&type=domain&name=example.org"
{"status":"OK","message":"SubDomain Deleted"}
{"status":"OK","message":"Domain Deleted"}
Deleting a domain does not delete its files.