• We value your experience with Plesk during 2025
    Plesk strives to perform even better in 2026. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2025.
    Please take this short survey:

    https://survey.webpros.com/

Setting up domains via API

J

Jamesman

Guest
I am having issues creating new domains on Plesk 9.5.2

I can create domains with minimal settings but once I try to add the <user> section I get this error:

error 1014 Parser error: Request is invalid

I have tried several configurations but none work where I can sett all the extra settings.

Any thing wrong with this packet?

Code:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.4.2.0">
<domain>
<add>
   <gen_setup>
      <name>example.com</name>
      <client_id>1</client_id>
      <htype>vrt_hst</htype>
      <ip_address>xxx.xxx.xxx.xxx</ip_address>
      <status>0</status>
   </gen_setup>
  <hosting>
     <vrt_hst>
         <ftp_login>example</ftp_login>
         <ftp_password>qweqwe</ftp_password>
         <ip_address>xxx.xxx.xxx.xxx</ip_address>
      </vrt_hst>
   </hosting>   
   <user>
      <enabled>true</enabled>
      <password>qweqwe</password>
      <cname>Mega Company</cname>
      <pname>John Doe</pname>
      <phone>2121342526</phone>
      <fax>2121342527</fax>
      <email>[email protected]</email>
      <address>Gray Lake Road, 12</address>
      <city>Naples</city>
      <state>FL</state>
      <pcode>34203</pcode>
      <country>US</country>
      <multiply_login>true</multiply_login>
      <permissions>
          <manage_quota>false</manage_quota>
          <manage_subdomains>false</manage_subdomains>
          <manage_anonftp>false</manage_anonftp>
          <manage_webapps>false</manage_webapps>
          <manage_maillists>false</manage_maillists>
          <make_dumps>true</make_dumps>
          <manage_ftp_password>true</manage_ftp_password>
          <manage_performance>true</manage_performance>
          <manage_domain_aliases>false</manage_domain_aliases>
          <dashboard>true</dashboard>
          <manage_dashboard>true</manage_dashboard>
          <manage_subftp>false</manage_subftp>
          <allow_ftp_backups>true</allow_ftp_backups>
      </permissions>
   </user>
   <prefs>
	<www>true</www>
   </prefs>
   <template-name>Standard Plan</template-name>
</add>
</domain>
</packet>
 
I tried without the permissions set and it still gave me the same error.

All the user tags are optional so I tried with just

Code:
   <user>
     <enabled>true</enabled>
   </user>

Same error. But once I remove the <user> set it works.
 
Developers have informed me that the documentation example is wrong. The text correctly specifies the the node name is perms. Bug has been submitted.
Also, <user> must follow after <prefs> - the order is strictly fixed.
You can use the following command to validate request XML

$ xmllint --schema /usr/local/psa/admin/htdocs/schemas/rpc/1.4.2.0/agent_input.xsd myrequest.xml
 
Back
Top