[Development Guides Home](/guides) >> [Guide to the LiveAPI System](/guides/guide-to-the-liveapi-system) >> [LiveAPI Methods](/guides/guide-to-the-liveapi-system/guide-to-the-liveapi-system-liveapi-methods)

# Guide to the LiveAPI System - The api() Method

The `api()` method executes a [cPanel API 2](/cpanel-api-2) function.

Important:
We **strongly** recommend that you use the appropriate method for the chosen API, rather than this method. These API-specific methods use additional internal logic to integrate with cPanel & WHM.

## Example

### LiveAPI PHP Class


```php
// Execute the Email::listpopswithdisk function.
$cpanel->api(
    'exec','2','Email', 'listpopswithdisk',
    array(
        'domain'          => 'example.com',
        'nearquotaonly'   => '0',
        'no_validate'     => '0',
    )
);
```

### LiveAPI Perl Module


```perl
# Execute the Email::listpopswithdisk function.
$cpliveapi->api(
   'exec','2','Email','listpopswithdisk',
   {
        'domain'                 => 'example.com',
        'api2_filter'            => '1',
        'api2_filter_column'     => 'diskquota',
        'api2_filter_term'       => '350',
        'api2_filter_type'       => 'lt_handle_unlimited',
    }
);
```

## Parameters

| Parameter | Type | Description | Possible values | Example |
|  --- | --- | --- | --- | --- |
| `type` | *string* | The request type. | `exec` | `exec` |
| `version` | *integer* | The cPanel API version. | `2` | `2` |
| `module` | *string* | The module name. | A cPanel API 2 module name. | `Email` |
| `func` | *string* | The function name. | A cPanel API 2 function name. | `listpopswithdisk` |
| `arguments` | *array* **or** *hash* | The function's input parameters and values. | A hash or hash reference. | `'domain'             => 'example.com'` |


## Returns

This method returns a hash reference of the function's output.

For detailed output information, read the function's documentation.