• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • Our UX team believes in the in the power of direct feedback and would like to invite you to participate in interviews, tests, and surveys.
    To stay in the loop and never miss an opportunity to share your thoughts, please subscribe to our UX research program. If you were previously part of the Plesk UX research program, please re-subscribe to continue receiving our invitations.
  • 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.

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