The del operation is used to remove a subdomain from a site/subdomain.

Request Packet Structure

A request XML packet removing a subdomain from a site/subdomain includes the del operation node:

<packet version="1.5.2.0">
<subdomain>
<del>
...
</del>
</subdomain>
</packet>

The del node is presented by the SubdomainDeleteInputType (subdomain.xsd). Its graphical representation is as follows:

image 53549

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.

The filter node is required. It specifies the filtering rule. For information on filters, refer to the Available Filters section. Data type: SubdomainFilterType (subdomain.xsd).

Response Packet Structure

The del node of the output XML packet is structured as follows:

image 53553

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.

  • The result node is required. It wraps the response retrieved from the server. Data type: resultFilterType (common.xsd).
  • The status node is required. It specifies the execution status of the operation. Data type: result_status (common.xsd). Allowed values: ok|error.
  • The errcode node is required if the del operation fails. It is used to return the error code. Data type: unsignedInt.
  • The errtext node is required if the del operation fails. It is used to return the error message. Data type: string.
  • The filter-id node is required if the del operation succeeds . It returns the filtering rule parameter. For details, refer to the Available Filters section. Data type: anySimple.
  • The id node is required if the del operation succeeds. It returns the ID of a deleted subdomain. Data type: id_type (common.xsd) .

Possible Errors

  • 1006 - Permission is denied.
  • 1013 - Subdomain does not exist.
  • 1015 - Parent site/subdomain is not found.
  • 1023 - Operation failed.

Samples

Removing a single subdomain

To remove the subdomain forum. example.com:

<packet>
<subdomain>
<del>
   <filter>
      <name>forum.example.com</name>
   </filter>
</del>
</subdomain>
</packet>

Response:

<packet version="1.5.2.0">
<subdomain>
   <del>
      <result>
         <status>ok</status>
         <filter-id>13</filter-id>
         <id>13</id>
      </result>
   </del>
</subdomain>
</packet>

Removing multiple subdomains

To remove subdomains with IDs in Plesk database 2, 5 and 6:

<packet>
<subdomain>
<del>
   <filter>
      <id>2</id>
      <id>5</id>
      <id>6</id>
   </filter>
</del>
</subdomain>
</packet>