Use the add operation to create a role.

Request Packet Structure

A request XML packet adding a new role includes the add operation node:

<packet>
<role>
   <add>
   ...
   </add>
</role>
</packet>

The add node is nested within the RoleAddInput type (role.xsd). The add node has the following graphics representation:

image 66661

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.

  • name, required

    It defines a role name. Data type: string.

  • owner-guid, optional

    It specifies the GUID of a role owner (a customer or the Administrator). If you do not specify this node, the role owner will be the request packet sender. Data type: string. For details on how to get a customer GUID, see the Getting Information About Client Accounts section.

  • permissions, optional

    It specifies a collection of permissions granted to a role. Data type: RolePermissions (role.xsd) . See the structure of this node in the Permissions Granted to Roles section.

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 66666

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

    Is used to return the error code when the operation fails. Data type: unsignedInt.

  • errtext, optional

    Can be used to return an error message if the operation fails. Data type: string.

  • id, optional

    It is required If the operation succeeds. Returns the ID of a new role. Data type: integer.

Samples

The following packet adds a role to the customer with GUID ff5e2685-6f44-490f-bdc8-9a46fb2f0308:

<packet version="1.6.3.0">
  <role>
    <add>
    <name>GalaxySpy</name>
    <owner-guid>ff5e2685-6f44-490f-bdc8-9a46fb2f0308</owner-guid>
    </add>
  </role>
</packet>

Reponse:

<packet version="1.6.3.0">
  <role>
    <add>
      <result>
        <status>ok</status>
        <id>61</id>
      </result>
    </add>
  </role>
</packet>