The operation add operation lets you create a user account.

Request Packet Structure

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:

image 71825

Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.

  • gen-info, required

    It specifies the general information about the new account. Data type: UserAddGenInfo (user.xsd).

  • login, required

    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.

  • passwd, required

    It specifies the password of the account. Data type: string.

  • owner-guid, optional

    It specifies the GUID of an account owner. Data type: string.

  • owner-external-id, optional

    It specifies the ID of an owner of user accounts in the Plesk components. Data type: string.

  • name, required

    It specifies the user name. Data type: string.

  • contact-info, optional

    It specifies contact information for this user account. Data type: ContactInfoAdd (user.xsd). To see the node definition, refer to section User Contact Information.

  • status, optional

    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.

  • external-id, optional

    It specifies the ID of the user account in the Plesk components. Data type: string.

  • email, optional

    It specifies the email address of the user account. Data type: string.

  • subscription-domain-id, optional

    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.

  • roles, required

    It specifies the user account role settings. Data type: UserAddRoles (user.xsd).

  • name, required

    It specifies the name of a role assigned to the account. Data type: string.

Note: When creating request packets, put nodes and elements in the order they follow in the packet structure.

Response Packet Structure

The add node of the response packet is structured as follows:

image 66720

Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.

  • result, required

    It wraps the result of the requested operation. Data type: resultType (common.xsd).

  • status, required

    It returns the execution status of the operation. Data type: string. Allowed values: ok | error.

  • errcode, optional

    It is required if the creation fails. Returns the error code. Data type: unsignedInt.

  • errtext, optional

    It is required if the creation fails. Returns the error message. Data type: string.

  • id, optional

    It is required if the operation succeeds. Returns a unique identifier of the user account just added to the Panel. Data type: integer.

  • guid, optional

    It is required if the operation succeeds. Returns a GUID of the user account just added to the Panel. Data type: string.

Samples

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>