# cPanel API 2 Functions - Ftp::listftpwithdisk

Warning:
The cPanel API 2 system is deprecated. We **strongly** recommend that you use [UAPI](/cpanel/introduction) instead of cPanel API 2.

## Description

This function lists FTP users and their home directory's disk
information.

Warning:
We **strongly** recommend that you use the following [UAPI](/cpanel/introduction/) function instead of this function:

- [`Ftp::list_ftp_with_disk`](/openapi/cpanel/operation/list_ftp_with_disk) — This function lists FTP account and disk usage information.


Important:
When you disable the [*FTP* role](https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-use-server-profiles/#roles), the system **disables** this function.

## Examples

WHM API (JSON)


```undefined syntaxhighlighter-pre
https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Ftp&cpanel_jsonapi_func=listftpwithdisk&include_acct_types=main
```

Note:
For more information, read our [Calls from the WHM API](/whm/use-whm-api-to-call-cpanel-api-and-uapi) documentation.

LiveAPI PHP Class


```undefined syntaxhighlighter-pre
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.

// List the account's FTP users.
$list_ftpdisk = $cpanel->api2(
    'Ftp', 'listftpwithdisk',
 array(
        'include_acct_types' => 'main',
    )
);
```

Note:
For more information, read our [Guide to the LiveAPI System](/guides/guide-to-the-liveapi-system/#guide-to-the-liveapi-system).

LiveAPI Perl Module


```undefined syntaxhighlighter-pre
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.

# List the account's FTP users and disk information.
my $list_ftpdisk = $cpliveapi->api2(
    'Ftp', 'listftpwithdisk',
{
        'include_acct_types' => 'main',
    }
);
```

Note:
For more information, read our [Guide to the LiveAPI System](/guides/guide-to-the-liveapi-system/#guide-to-the-liveapi-system).

cPanel Tag System (deprecated)

Warnings:
- cPanel tags are **deprecated**. We **strongly** recommend that you **only** use the [LiveAPI](/guides/guide-to-the-liveapi-system) system to call the cPanel APIs. Examples are **only** present in order to help developers move from the old cPanel tag system to our [LiveAPI](/guides/guide-to-the-liveapi-system).
- cPanel API 2 calls that use cPanel tags vary in code syntax and in their output.
- For more information, read our [Deprecated cPanel Tag Usage](/cpanel-api-2/cpanel-api-2-deprecate-cpanel-tag-usage/) documentation.


Command Line


```undefined syntaxhighlighter-pre
cpapi2 --user=username Ftp listftpwithdisk include_acct_types=main
```

div
Notes:

- You **must** URI-encode values.
- `username` represents your account-level username.
- You **must** include the `--user=username` option.
- For more information and additional output options, read our [Guide to cPanel API 2](/cpanel-api-2/) documentation or run the `cpapi2 --help` command.
- If you run CloudLinux™, you **must** use the full path of the `cpapi2` command:

```undefined syntaxhighlighter-pre
/usr/local/cpanel/bin/cpapi2
```


br
Output (JSON)


```undefined syntaxhighlighter-pre
{
  "cpanelresult": {
    "apiversion": 2,
    "func": "listftpwithdisk",
    "data": [
      {
        "diskquota": "unlimited",
        "diskusedpercent": 0,
        "diskused": 0,
        "humandiskquota": "None",
        "accttype": "main",
        "reldir": "",
        "_diskused": 0,
        "login": "example",
        "dir": "/home/example",
        "deleteable": 1,
        "serverlogin": "example",
        "htmldir": null,
        "humandiskused": "None",
        "diskusedpercent20": 0,
        "_diskquota": 0
      },
      {
        "diskquota": "unlimited",
        "diskusedpercent": 0,
        "diskused": 0,
        "humandiskquota": "None",
        "accttype": "logaccess",
        "reldir": "usr/local/apache/domlogs/example",
        "_diskused": 0,
        "login": "example_logs",
        "dir": "/usr/local/apache/domlogs/example",
        "deleteable": 1,
        "serverlogin": "example_logs",
        "htmldir": null,
        "humandiskused": "None",
        "diskusedpercent20": 0,
        "_diskquota": 0
      },
      {
        "diskquota": "unlimited",
        "diskusedpercent": 0,
        "diskused": 0,
        "humandiskquota": "None",
        "accttype": "sub",
        "reldir": "public_html/user",
        "_diskused": 0,
        "login": "user",
        "dir": "/home/example/public_html/user",
        "deleteable": 1,
        "serverlogin": "user@example.com",
        "htmldir": null,
        "humandiskused": "None",
        "diskusedpercent20": 0,
        "_diskquota": 0
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Ftp"
  }
}
```

Note:
Use cPanel's *[API Shell](https://docs.cpanel.net/cpanel/advanced/api-shell-for-cpanel)* interface (*cPanel >> Home >> Advanced >> API Shell*) to directly test cPanel API calls.

## Parameters

table
thead
tr
th
Parameters
th
strong
Type
th
strong
Description
th
strong
Possible values
th
strong
Example
tbody
tr
td
code
dirhtml
td
em
string
td
p
A string to prepend to the 
code
dir
 return value.
p
This parameter defaults to the account's 
code
/home
 directory.
td
A valid string.
td
code
example.com/
tr
td
code
include_acct_types
td
em
string
td
p
The types of account to view.
p
If you do not use this parameter, the function returns all FTP account types.
td
ul
li
code
main
 — This is the main FTP account.
li
code
sub
 — This is a sub-user FTP account.
li
code
logaccess
 — This account is for logfile access.
p
Separate multiple types with the pipe (
code
|
) character.
td
code
main
tr
td
code
skip_acct_types
td
em
string
td
p
The types of account to exclude.
p
span
If you do not use this parameter, the function does 
strong
not
 exclude any FTP account types.
td
ul
li
code
main
 — This is the main FTP account.
li
code
sub
 — This is a sub-user FTP account.
li
code
logaccess
 — This account is for logfile access.
p
Separate multiple types with the pipe (
code
|
) character.
td
code
main
## Returns

table
thead
tr
th
strong
strong
Return
th
strong
Type
th
strong
Description
th
strong
Possible values
th
strong
Example
tbody
tr
td
code
diskquota
td
em
string
td
The account's disk quota, in megabytes (MB).
td
A positive integer value, or 
code
unlimited
.
td
code
unlimited
tr
td
code
diskusedpercent
td
em
integer
td
The percentage of space that the account uses.
td
A positive integer value.
td
code
0
tr
td
code
diskused
td
em
integer
td
The amount of space that the account uses, in megabytes (MB).
td
A positive integer value.
td
code
0
tr
td
code
humandiskquota
td
em
string
td
The amount of space that the account may use in a human-readable format, in megabytes (MB).
td
ul
li
code
None
 — For no space used.
li
A positive integer value, followed by 
code
MB
.
td
code
None
tr
td
code
accttype
td
em
string
td
The type of FTP account.
td
ul
li
code
main
 — This is the main FTP account.
li
code
sub
 — This is a sub-user FTP account.
li
code
logaccess
 — This account is for logfile access.
td
code
sub
tr
td
code
reldir
td
em
string
td
The relative path to the FTP user's document root.
td
A valid relative path.
td
code
public_html/user
tr
td
code
_diskused
td
em
integer
td
The amount of space that the account uses, in bytes.
td
A positive integer value.
td
code
0
tr
td
code
login
td
em
string
td
The FTP account's username.
td
A valid username.
td
code
user
tr
td
code
dir
td
em
string
td
The path to the FTP user's document root.
td
A valid absolute path.
td
code
/home/example/public_html/user
tr
td
code
deleteable
td
em
Boolean
td
Whether you can delete the account.
td
ul
li
code
1
 — You can delete this account.
li
code
0
 — You 
strong
cannot
 delete this account.
td
code
1
tr
td
code
serverlogin
td
em
string
td
The full FTP login name.
td
A username, at symbol (
code
@
), and the domain name
td
code
user@example.com
tr
td
code
htmldir
td
em
string
td
A 
code
null
 value.
td
code
null
 is the only possible value.
td
code
null
tr
td
code
humandiskused
td
em
string
td
The amount of space that the account uses in a human-readable format, in megabytes (MB).
td
ul
li
code
None
 — The account uses no disk space.
li
A positive integer, a space, and the string 
code
MB
.
td
code
None
tr
td
code
diskusedpercent20
td
em
integer
td
The percentage of space that the account uses.
td
A positive integer value.
td
code
0
tr
td
code
_diskquota
td
em
integer
td
The amount of space that the account may use, in bytes.
td
A positive integer value.
td
code
0
tr
td
code
reason
td
em
string
td
p
A reason for failure.
p
This function only returns a 
code
reason
 value if it failed.
td
p
A string that describes the error.
td
code
This is an error message.
tr
td
code
result
td
em
Boolean
td
p
Whether the function succeeded.
td
ul
li
code
1
 — The function succeeded.
li
code
0
 — The function failed.
td
code
1