Description

This function creates an FTP account.

Examples 




https://hostname.example.com:2083/cpsess##########/execute/Ftp/add_ftp?user=weeones&pass=12345luggage&quota=42



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Create a new FTP user.
$new_ftp = $cpanel->uapi(
    'Ftp', 'add_ftp',
    array(
        'user'    => 'weeones',
        'pass'    => '12345luggage',
        'quota'   => '42',
    )
);



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Create a new FTP user.
my $new_ftp = $cpliveapi->uapi(
    'Ftp', 'add_ftp',
    {
        'user'    => 'weeones',
        'pass'    => '12345luggage',
        'quota'   => '42',
    }
);



<!-- Create a new FTP account. -->
[% execute( 'Ftp', 'add_ftp', { 'user' => 'weeones', 'pass' => '12345luggage', 'quota' => '42' } ); %]



uapi --user=username Ftp add_ftp user=weeones pass=12345luggage quota=42


 



{  
   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{  

   },
   "data":null
}



Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The new FTP account username.

A valid FTP username.

weeones
passstring

Required

The new FTP account password.

A secure password.12345luggage
homedirstring

The path to the FTP account's root directory.

If you do not specify this parameter, the FTP account uses the cPanel account's home directory.

The path to the FTP account's root directory, relative to the cPanel account's home directory.weeoneftp
quotainteger

The FTP account's quota.

This parameter defaults to 0.

  • An integer that represents the FTP account's maximum disk usage, in Megabytes (MB).
  • A value of 0 grants the FTP account unlimited disk space.
42
disallowdotBoolean

Whether to strip dots (.) from the username.

This parameter defaults to 1.

  • 1 — Strip dots.
  • 0 — Do not strip dots.
1
domainstring

The user's associated domain.

We introduced this parameter in cPanel & WHM version 54.

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


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

The account's password hash.

  • You can use this parameter in place of the pass parameter. However, you cannot use both pass and pass_hash parameters in the same request.
  • We introduced this parameter in cPanel & WHM version 54.

This parameter defaults to a blank string.


A valid password hash that uses your server's cryptographic hash function.

You can find your server's hash type in the /etc/sysconfig/authconfig file.



$6$1sOyHP5ZDYp3pGUz$R0TSgfPRHfDjT5PP5RJGv39FhiGTNNPvM7IFpCBjXijMmlMZk9yI8T3LqGuntc9fdKb5eX.lGL7wBS9e4DAWn/


Returns

This function only returns metadata.