• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • 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.

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