# cPanel

> Inspect domains, mailboxes, databases, usage and hosting settings in cPanel.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/cpanel

## Actions

### Count email accounts

Count email accounts.

**Inputs**: None.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": 1,
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {
        "transformed": 1
      },
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### Get default PHP version

Get default PHP version.

**Inputs**: None.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": {
        "version": "example"
      },
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {},
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### Get disk quota

Get disk quota.

**Inputs**: None.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": {
        "inode_limit": "example",
        "inodes_remain": "example",
        "inodes_used": "example",
        "megabyte_limit": "example",
        "megabytes_remain": "example",
        "megabytes_used": "example",
        "under_inode_limit": 1,
        "under_megabyte_limit": 1,
        "under_quota_overall": 1
      },
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {},
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### Get domain settings

Get domain settings.

**Inputs**

- Domain (`domain`, text, required): The domain on the cPanel account.
- Hide temporary domains (`hide_temporary_domains`, number): Whether to hide temporary domains from the returned values. One of: `1`, `0`.
- Return HTTPS redirect status (`return_https_redirect_status`, number): Whether to return the secure redirect status of the addon domains. * 1 - Return status. * 0 - Do **not** return status. One of: `0`, `1`.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": {
        "all_aliases_valid": 1,
        "can_https_redirect": 1,
        "customlog": {
          "domain": "example",
          "target": "example"
        },
        "documentroot": "example",
        "domain": "example",
        "group": "example",
        "hascgi": 1,
        "homedir": "example",
        "ifmodulemodsuphpc": {
          "group": "example"
        },
        "ip": "example",
        "is_https_redirecting": 1,
        "is_temporary": 1,
        "options": "example",
        "owner": "example",
        "phpopenbasedirprotect": 1,
        "port": 1,
        "scriptalias": {
          "path": "example",
          "url": "example"
        },
        "serveradmin": "example",
        "serveralias": "example",
        "servername": "example",
        "type": "example",
        "usecanonicalname": "example",
        "user": "example",
        "userdirprotect": 1
      },
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {},
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### Get MySQL server information

Get MySQL server information.

**Inputs**: None.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": {
        "host": "example",
        "is_remote": 1,
        "version": "example"
      },
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {},
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### Get primary domain

Get primary domain.

**Inputs**

- Hide temporary domains (`hide_temporary_domains`, number): Whether to hide temporary domains from the response. One of: `1`, `0`.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": {
        "primary_domain": "example"
      },
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {
        "transformed": 1
      },
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### Get resource usage

Get resource usage.

**Inputs**: None.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": [
        {
          "description": "example",
          "error": "example",
          "formatter": "example",
          "id": "example",
          "maximum": 1,
          "url": "example",
          "usage": 1
        }
      ],
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {},
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### List domain mail forwarders

List domain mail forwarders.

**Inputs**

- Domain (`domain`, text): The domain name to query. If you do not use this parameter, the function returns all domain-level forwarders on the cPanel account.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": [
        {
          "dest": "example",
          "forward": "example"
        }
      ],
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {
        "transformed": 1
      },
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### List domain PHP versions

List domain PHP versions.

**Inputs**

- Vhost (`vhost`, text): The PHP Virtual Hostname.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": [
        {
          "account": "example",
          "account_owner": "example",
          "documentroot": "example",
          "homedir": "example",
          "main_domain": 1,
          "php_fpm": 1,
          "php_fpm_pool_parms": {},
          "phpversion_source": [
            {}
          ],
          "version": "example",
          "vhost": "example"
        }
      ],
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {
        "transformed": 1
      },
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### List domain settings

List domain settings.

**Inputs**

- Format (`format`, text): The function's return format. One of: `hash`, `list`.
- Hide temporary domains (`hide_temporary_domains`, number): Whether to hide temporary domains from the response arrays. One of: `1`, `0`.
- Return HTTPS redirects status (`return_https_redirects_status`, number): Whether to return the secure redirect status of the addon domains. One of: `1`, `0`.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": "example",
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {},
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### List domains

List domains.

**Inputs**

- Hide temporary domains (`hide_temporary_domains`, number): Whether to hide temporary domains from the response arrays. One of: `1`, `0`.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": {
        "addon_domains": [
          "example"
        ],
        "is_temporary": {},
        "main_domain": "example",
        "parked_domains": [
          "example"
        ],
        "sub_domains": [
          "example"
        ]
      },
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {},
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### List email accounts

List email accounts.

**Inputs**

- No validate (`no_validate`, number): Whether to skip the email database's validation check. * 1 ; Skip the validation check. * 0 ; Run the validation check. One of: `0`, `1`.
- Regex (`regex`, text): A [Perl Compatible Regular Expression (PCRE)](https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions) that filters the results.
- Skip main (`skip_main`, number): Whether to exclude the cPanel account's main account from the results. * 1 ; Exclude the main account. * 0 ; Include the main account. One of: `0`, `1`.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": [
        {
          "email": "example",
          "login": "example",
          "suspended_incoming": 1,
          "suspended_login": 1
        }
      ],
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {
        "transformed": 1
      },
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### List email domains

List email domains.

**Inputs**

- Add www (`add_www`, number): Whether to list www. addresses. * 1 ; List www. addresses. * 0 ; Do **not** list www. addresses. For example, if you specify 1, the function's output would include both example.com and www.example.com. If you specify 0, the output would include **only** example.com. One of: `0`, `1`.
- Include wildcard (`include_wildcard`, number): Whether to list wildcard addresses. * 1 ; List wildcard addresses. * 0 ; Do **not** list wildcard addresses. For example, if you specify 1, the function's output would include both example.com and *.example.com. If you specify 0, the output would include **only** example.com. One of: `0`, `1`.
- Return temporary domain (`return_temporary_domain`, true/false): Whether to include temporary domains (*.cpanel.site) in the output. By default, temporary domains are excluded.
- Select (`select`, text): The name of the domain that the function returns with the select output parameter. If you do **not** use this parameter, the function will **not** return the select parameter with any domains.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": [
        {
          "domain": "example",
          "select": 1
        }
      ],
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {
        "transformed": 1
      },
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### List Git repositories

List Git repositories.

**Inputs**

- Fields (`fields`, text): A comma-separated list of desired return values.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": [
        {
          "available_branches": [
            "example"
          ],
          "branch": "example",
          "clone_urls": {},
          "deployable": 1,
          "last_deployment": {},
          "last_update": {},
          "name": "example",
          "repository_root": "example",
          "source_repository": {},
          "tasks": [
            {}
          ],
          "type": "example"
        }
      ],
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {
        "transformed": 1
      },
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### List installed PHP versions

List installed PHP versions.

**Inputs**: None.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": {
        "versions": [
          "example"
        ]
      },
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {},
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### List mail exchanger records

List mail exchanger records.

**Inputs**

- Domain (`domain`, text): The domain to query. If you do **not** use this parameter, the function returns MX records for all of the cPanel account's domains.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": [
        {
          "alwaysaccept": 1,
          "detected": "example",
          "domain": "example",
          "entries": [
            {}
          ],
          "local": 1,
          "mx": "example",
          "mxcheck": "example",
          "remote": 1,
          "secondary": 1,
          "status": 1,
          "statusmsg": "example"
        }
      ],
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {
        "transformed": 1
      },
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### List mailbox storage usage

List mailbox storage usage.

**Inputs**

- Domain (`domain`, text): A domain name to filter the results by. If you do **not** use this parameter, the function returns **all** of the cPanel account's email addresses.
- Email (`email`, text): The cPanel user account to query. If you do **not** use this parameter, the function returns the email addresses for **all** cPanel accounts that the user owns.
- Get restrictions (`get_restrictions`, number): Whether to display restriction status for each of the email addresses. * 1 ; Display. * 0 ; Do **not** display. One of: `0`, `1`.
- Infinityimg (`infinityimg`, text): An image to display for email addresses with an unlimited quota. If you specify an infinityimg value, the function returns HTML code to display that image as the diskquota parameter's value.
- Infinitylang (`infinitylang`, number): Whether to return the ∞ character for email addresses with an unlimited quota. * 1 ; Return the ∞ character for unlimited diskquota values. * 0 ; Return the string unlimited for unlimited diskquota values. One of: `0`, `1`.
- Maxaccounts (`maxaccounts`, number): The maximum number of email addresses to return. If you do not use this parameter, the function returns an unlimited number of email addresses. At least 1.
- No disk (`no_disk`, number): Whether to skip the collection of disk usage information. * 1 ; Do **not** collect. * 0 ; Collect. One of: `0`, `1`.
- No validate (`no_validate`, number): Whether to skip email database validation. * 1 ; Skip validation. * 0 ; Perform the validation. One of: `0`, `1`.
- Regex (`regex`, text): A [Perl Compatible Regular Expression (PCRE)](https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions) that filters the results. For example, /^[a-z0-9_-]{6,18}$/ matches the local portion of an email address, if it contains between six and 18 characters.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": [
        {
          "_diskquota": 1,
          "_diskused": 1,
          "diskquota": "example",
          "diskused": 1,
          "diskusedpercent": 1,
          "diskusedpercent20": 1,
          "diskusedpercent_float": 1,
          "domain": "example",
          "email": "example",
          "has_suspended": 1,
          "hold_outgoing": 1,
          "humandiskquota": "example",
          "humandiskused": "example",
          "login": "example",
          "mtime": 1,
          "suspended_incoming": 1,
          "suspended_login": 1,
          "suspended_outgoing": 1,
          "txtdiskquota": "example",
          "user": "example"
        }
      ],
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {
        "transformed": 1
      },
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### List MySQL databases

List MySQL databases.

**Inputs**: None.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": [
        {
          "database": "example",
          "disk_usage": 1,
          "users": [
            "example"
          ]
        }
      ],
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {
        "transformed": 1
      },
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### List MySQL users

List MySQL users.

**Inputs**: None.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": [
        {
          "databases": [
            "example"
          ],
          "shortuser": "example",
          "user": "example"
        }
      ],
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {
        "transformed": 1
      },
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```

### List Passenger applications

List Passenger applications.

**Inputs**: None.

**Outputs**

- `data` (object): The response from cPanel.

**Example output**

```json
{
  "data": {
    "apiversion": 1,
    "func": "example",
    "module": "example",
    "result": {
      "data": {},
      "errors": [
        "example"
      ],
      "messages": [
        "example"
      ],
      "metadata": {},
      "status": 1,
      "warnings": [
        "example"
      ]
    }
  }
}
```
