• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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