The operation add operation lets you create a user account.
A request XML packet adding a new user account to Plesk includes the add operation node:
<packet>
<user>
<add>
...
</add>
</user>
</packet>
The add node is of type UserAddInput type (user.xsd
). It has the following graphics representation:
It specifies the general information about the new account. Data type: UserAddGenInfo (user.xsd
).
It specifies the username to log in to Plesk. The login can be an e-mail address or word containing alphanumeric, dash, dot and underscore symbolsData type: string.
It specifies the password of the account. Data type: string.
It specifies the GUID of an account owner. Data type: string.
It specifies the ID of an owner of user accounts in the Plesk components. Data type: string.
It specifies the user name. Data type: string.
It specifies contact information for this user account. Data type: ContactInfoAdd (user.xsd
). To see the node definition, refer to section User Contact Information.
It specifies the account status. Data type: string. Allowed values: 0
| 1
| enabled
| disabled
Value 0 is equal to disabled, 1 is equal to enabled.
It specifies the ID of the user account in the Plesk components. Data type: string.
It specifies the email address of the user account. Data type: string.
It specifies the subscription id to which the user will have access. If not specified or the value is 0, it grants the user access to all subscriptions within your hosting account. Data type: string.
It specifies the user account role settings. Data type: UserAddRoles (user.xsd
).
It specifies the name of a role assigned to the account. Data type: string.
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
The add node of the response packet is structured as follows:
It wraps the result of the requested operation. Data type: resultType (common.xsd
).
It returns the execution status of the operation. Data type: string. Allowed values: ok | error.
It is required if the creation fails. Returns the error code. Data type: unsignedInt.
It is required if the creation fails. Returns the error message. Data type: string.
It is required if the operation succeeds. Returns a unique identifier of the user account just added to the Panel. Data type: integer.
It is required if the operation succeeds. Returns a GUID of the user account just added to the Panel. Data type: string.
A request packet to create a user account can look as follows:
<packet>
<user>
<add>
<gen-info>
<login>admin2@adams.com</login>
<passwd>123123</passwd>
<name>Eugene Grin</name>
</gen-info>
<roles>
<name>Admin</name>
</roles>
</add>
</user>
</packet>
Response:
<packet version="1.6.3.0">
<user>
<add>
<result>
<status>ok</status>
<id>21</id>
<guid>8712cd03-14e2-9e16-95af-c67e3ffc2696</guid>
</result>
</add>
</user>
</packet>