1. Home
  2. Docs
  3. Developer Guide
  4. API
  5. Domains and Subdomains

Domains and Subdomains

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.

ParameterDescription
actionadd, list or del
userHosting account username
typedomain (addon domain) or subdomain
nameThe domain (example.org) or the full subdomain (blog.example.com)
pathDocument root relative to the account’s home folder, for example /public_html/example.org (for add)
autossl1 = 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.

Related

Was this article helpful to you? No Yes