UAPI Functions - Ftp::add_ftp

Description

This function creates an FTP account.

Examples 


 cPanel or Webmail Session URL

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

 LiveAPI PHP Class

$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',
    )
);

 LiveAPI Perl Module

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',
    }
);

 cPanel Template Toolkit

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

 Command Line

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

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 Output (JSON)

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

 

Note:

Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.

 

Parameters

 Parameter 

Type

Description

Possible values

Example

user

string

Required

The new FTP account username.

A valid FTP username.

weeones

pass

string

Required

The new FTP account password.

A secure password.

12345luggage

homedir

string

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 rootdirectory, relative to the cPanel account's home directory.

weeoneftp

quota

integer

The FTP account's quota.

This parameter defaults to 0, which grants an unlimited quota.

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

disallowdot

 Boolean 

Whether to strip dots (.) from the username.

This parameter defaults to 1.

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

1

domain

string

The user's associated domain.

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

Note:

We introduced this parameter in cPanel & WHM version 54.

A domain that the cPanel account owns.

example.com

pass_hash

string

The account's password hash.

This parameter defaults to a blank string.

Note:

 

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

 

 

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

Note:

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

 

 

 

Returns

This function only returns metadata.

  • 10 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....