• 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.

Question Add plan with api

colubian

New Pleskian
Server operating system version
centos 7
Plesk version and microupdate number
last
Hello to all friends! I had a small question how to add a plan to a client with api because with api I can create clients but not assign them a plan?

thanks
 
In Plesk you don't assign a Service Plan to a customer, but to a subscription. On the REST API you can use the /domains endpoint and specify the Service Plan in the body. See example bellow.
JSON:
{
  "name": "example.com",
  "hosting_type": "virtual",
  "hosting_settings": {
    "ftp_login": "test_login",
    "ftp_password": "changeme1Q**"
  },
  "owner_client": {
    "id": 7,
    "login": "owner",
    "guid": "b623e93d-dc72-4102-b5f0-ded427cf0fb1",
    "external_id": "b623e93d-dc72-4102-b5f0-ded427cf0fb1"
  },
  "ip_addresses": [
    "93.184.216.34",
    "2606:2800:220:1:248:1893:25c8:1946"
  ],
  "plan": {
    "name": "Unlimited"
  }
}

On the XML API you'd use the webspace descriptor to create a subscription on which you can specify a Service Plan.
 
Back
Top