• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    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.

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