Description

This function deletes an FTP account.


We strongly recommend that you use the following UAPI function instead of this function:

Examples 




https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Ftp&cpanel_jsonapi_func=delftp&user=user&destroy=1



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Delete the FTP user "user" along with its home directory
$destroy_account = $cpanel->api2(
    'Ftp', 'delftp',
 array(
        'user' => 'user',
        'destroy' => '1',
 ) 
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Delete the FTP user "user" along with its home directory
my $destroy_account = $cpliveapi->api2(
    'Ftp', 'delftp',
{ 
        'user' => 'user',
        'destroy' => '1',
   }
);

 




cpapi2 --user=username Ftp delftp user=user destroy=1



{
  "cpanelresult": {
    "apiversion": 2,
    "func": "delftp",
    "data": [
      {
        "reason": "OK",
        "result": 1
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Ftp"
  }
}



Parameters

ParametersTypeDescriptionPossible valuesExample
userstring

Required

The FTP account's username.

Any valid username.user
domainstring

The user's associated domain.

This parameter defaults to the cPanel account's primary domain.

A domain that the cPanel account owns.example.com
destroyBoolean

Required

Whether to delete the account's FTP directory.

  • 1 — Delete the FTP directory.
  • 0 — Maintain the FTP directory.
1

Returns

Return TypeDescriptionPossible valuesExample
reasonstring

A reason for failure.

This function only returns a reason value if it failed.


A string that describes the error.

This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1