• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Creating new subscription everytime a new domain is created with rest API

ElihuNavon

New Pleskian
Server operating system version
Plesk Obsidian Web Host Edition
Plesk version and microupdate number
18.0.53 update #2
I am using REST API to add a new domain to my plesk, but everytime I do that - the domain is added to an existing subscription.
Is there a way to make a new subscription for every new domain I add to my plesk account?
I'ts safer that way.
Thanks!
 
[...] Is there a way to make a new subscription for every new domain I add to my plesk account? [...]
Yes there is. Just omit the base_domain and parent_domain objects from the body of the API call.

So something like this should work:
JSON:
{
  "name": "example.com",
  "description": "My website",
  "hosting_type": "virtual",
  "hosting_settings": {
    "ftp_login": "test_login",
    "ftp_password": "Changeme1Q**sd23"
  },
    "owner_client": {
    "id": 2
  },
  "plan": {
    "name": "Unlimited"
  }
}
 
Last edited:
Yes there is. Just omit the base_domain and parent_domain objects from the body of the API call.

So something like should work:
JSON:
{
  "name": "example.com",
  "description": "My website",
  "hosting_type": "virtual",
  "hosting_settings": {
    "ftp_login": "test_login",
    "ftp_password": "Changeme1Q**sd23"
  },
    "owner_client": {
    "id": 2
  },
  "plan": {
    "name": "Unlimited"
  }
}

Hey! Kaspar, thank you VERY MUCH! You're a life-saver!
I'll be sure to try that!
I hope you don't mind me asking a follow-up question:
Is there also a way to add an SSL certificate using the API? After I added a new subscription and a new domain.
I assume there is, I'm just not sure exactly how to do that.
 
To my knowledge there isn't. However if you have enabled SSLit! as an additional service in the Service Plan of a domain to keep websites secured with free SSL/TLS certificates, an Let's Encrypt certificates will be issued automatically for the domain. This may take up to a couple of hours after the creation of a domain.
 
I am using REST API to add a new domain to my plesk, but everytime I do that - the domain is added to an existing subscription.
Is there a way to make a new subscription for every new domain I add to my plesk account?
I'ts safer that way.
Thanks!
can you please provide me with the json body , i want to add a domain to an active subscription
 
Back
Top