Creating Web Users
The add operation is used to create a web user on the certain site. You can specify the web user settings on creation or set them later. By default, new web user account will be created in accordance with preferences set by Plesk Administrator. For information on web user settings and preferences, refer to the Web User Settings and Preferences section.
Request Packet Structure
A request XML packet adding a new web user includes the add operation node:
<packet> <webuser > <add> ... </add> </webuser> </packet>
The add node is presented by type WebUserAddInputType (
webuser.xsd), and its graphical representation is as follows:
Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/126.96.36.199/agent_input.svg.
- The site-id node is required. It specifies the site on which you want to create a web user. Data type: integer.
- The login node is required. It specifies the login name of the web user. Data type: string.
- The password node is optional. It specifies the web user password. Data type: string (length=4..64).
- The password-type node is optional. It specifies if it is a plain or encrypted password. Data type:string. Allowed values: plain | crypt.
- The ftp-quota node is optional. It specifies the limit of disk space (in bytes) provided for the web user on the server. Data type: integer (-1 = unlimited).
- The services node is optional. It specifies if the available services. To learn more about this node, see Settings. Data type: ServicesType.
Note: The login name should begin with an alphabet character. It cannot contain white spaces. The password cannot contain quotation marks, white space, user's login name, and should be between 5 and 14 characters in length.
Note: The password field can be left blank. If so, the web user is created but cannot login until the administrator creates the password for this user.
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
You can add multiple users in a single packet. Use as many add operations as the number of web users to be added.
Response Packet Structure
The add node of the output XML packet is presented by type WebUserAddOutputType (
webuser.xsd) and structured as follows:
Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/188.8.131.52/agent_output.svg.
- The result node is required. It wraps the response retrieved from the server. Data type: resultType (
- The status node is required. It specifies the execution status of the add operation. Data type: string. Allowed values: ok | error.
- The errcode node is optional. It returns the error code if the add operation fails. Data type: unsignedInt.
- The errtext node is optional. It returns the error message if the add operation fails. Data type: string.
- The id node is optional. If the add operation succeeds it returns the ID of the added web user.
Adding a web user
The request packet adding a new web user called myWebAccount looks as follows:
<packet> <webuser> <add> <site-id>12</site-id> <login>myWebAccount</login> </add> </webuser> </packet>
<packet> <webuser> <add> <result> <status>ok</status> <id>321</id> </result> </add> </webuser> </packet>
If the site was not found on the server, the response can look as follows:
<packet> <webuser> <add> <result> <status>error</status> <errcode>1015</errcode> <errtext>Domain does not exist</errtext> </result> </add> </webuser> </packet>