openapi: 3.2.0 info: contact: email: cs@cpanel.net name: WebPros International, LLC url: https://cpanel.net/support/ description: UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings. license: name: cPanel License url: https://cpanel.net/legal-notices/ termsOfService: https://cpanel.net/legal-notices/ title: cPanel U Clam Scanner API version: 11.137.9999.106 x-api-evangelist-provenance: 'Harvested verbatim from cPanel''s developer portal on 2026-09-05 via the MCP tool get-full-api-description at https://api.docs.cpanel.net/mcp. ONE mechanical change was made before storage: example values containing PEM private-key or certificate blocks, and AWS-access-key-shaped example strings, were replaced with REDACTED_* placeholders so the file can be stored in a public git repository without tripping secret scanning. No path, operation, parameter, schema or description was altered, added or removed.' servers: - description: A server running cPanel. url: https://{host}:{port}/execute variables: host: default: cpanel-server.tld description: The hostname of a server running cPanel. port: default: '2083' description: The cPanel port. security: - BasicAuth: [] tags: - description: The ClamScanner module provides methods for ClamAV® virus scans and disinfection. name: ClamScanner paths: /ClamScanner/check_disinfection_status: get: x-readonly: true description: 'This function checks the status of the previously queued disinfection of infected files. **Note:** You must run the APIs in this order: 1. Run `ClamScanner::start_scan` to start the virus scan. 2. Run `ClamScanner::get_scan_status` in a loop until the scan is finished. 3. Run `ClamScanner::list_infected_files` to get a report of the complete list of infected files. 4. Decide how you want to handle each infected file. 5. Run `ClamScanner::disinfect_files` to queue the disinfection of the files. 6. Run `ClamScanner::check_disinfection_status` in a loop until you get a done status. If you want to display the progress, you can render the `ClamScanner::check_disinfection_status` returned ''result{data}{details}'' array where the `type` is `step`. Each `step` record indicates the action taken on a specific file in the set being processed.' operationId: ClamScanner-check_disinfection_status parameters: - description: 'The unique `id` of the message you last received from this same log. The API will return only the records after the specified `last_id`. If this parameter is not provided, the entire log is returned. **Note:** For improved performance, we recommend applications include the last record ID (last_id) from a previous call to this API, so only messages since the previous API call are returned.' in: query name: last_id schema: example: 10 minimum: 1 type: integer responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: check_disinfection_status type: string module: description: The name of the module called. example: ClamScanner type: string result: properties: data: properties: details: description: The list of events recorded in the log. If you pass the `last_id` parameter, only records in the log after that id are returned. items: oneOf: - properties: file: description: The absolute path to the file. example: /home/user/virus type: string id: description: The task processing order. example: 2 type: number message: description: Optional message that may include more information about errors. type: string state: description: 'The state of the step. It will be one of the following: * `deleted` - The file was deleted. * `error` - An error occurred while processing the file. * `mailbox-cleansed` - The mailbox was clear of viruses. * `no-action` - No action was taken on the file. * `quarantined` - The file was quarantined.' enum: - deleted - error - mailbox-cleansed - no-action - quarantined example: deleted type: string type: description: '* `step` - Record about a single file being processes.' enum: - step type: string required: - type - state type: object - properties: id: description: The task processing order. example: 2 type: number message: description: Optional message that may include more information about errors and warnings. type: string state: description: 'The state of the issue. It will be one of the following: * `error` - An error occurred while starting or finishing the disinfection. * `warning` - A non-cricitcal problem occurred while starting or finishing the disinfection.' enum: - error - warning example: warning type: string type: description: '* `issue` - Record that the disinfection is complete for all files indicated.' enum: - issue type: string required: - type - state type: object - properties: id: description: The task processing order. example: 2 type: number message: description: Optional message that may include more information about errors. type: string state: description: 'The state of the step. It will be one of the following: * `error` - An error occurred while processing the file. * `info` - The message is information only. * `success` - The disinfection was successful.' enum: - error - info - success example: success type: string type: description: '* `done` - Record that the disinfection is complete for all files indicated.' enum: - done type: string required: - type type: object type: array log: description: Path to the disinfection log file. The log file will contain a list of JSON objects one per line. If the last line includes `"type":"done"`, the file disinfection is complete. example: /home/user/.clamavconnector.disinfection.log type: string status: description: '* `done` - The disinfection is finished. * `none` - There is no disinfection scheduled. * `queued` - The disinfection is queued. * `running` - The disinfection is in progress.' enum: - done - queued - running example: done type: string type: object errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Request disinfection process status tags: - ClamScanner x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n ClamScanner \\\n check_disinfection_status\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/ClamScanner/check_disinfection_status - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ClamScanner_check_disinfection_status.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/ClamScanner_check_disinfection_status.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/ClamScanner/,\n q/check_disinfection_status/\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ClamScanner_check_disinfection_status.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/ClamScanner_check_disinfection_status.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'ClamScanner',\n 'check_disinfection_status'\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: 94 /ClamScanner/disinfect_files: post: x-readonly: false x-rollback: none description: 'This function applies the disinfection option selected by the user for each infected file. **Note:** You must run the APIs in this order: 1. Run `ClamScanner::start_scan` to start the virus scan. 2. Run `ClamScanner::get_scan_status` in a loop until the scan is finished. 3. Run `ClamScanner::list_infected_files` to get a report of the complete list of infected files. 4. Decide how you want to handle each infected file. 5. Run `ClamScanner::disinfect_files` to queue the disinfection of the files. 6. Run `ClamScanner::check_disinfection_status` in a loop until you get a done status.' operationId: ClamScanner-disinfect_files requestBody: content: application/json: schema: properties: actions: additionalProperties: description: 'The name of the property is a path to the file. The path may be either a full path to the file or a users home directory relative path to the file. The value of the property is on of the following: * `cleanse_mailbox` — Cleanse the specified mailbox. * `delete` — Delete the file. * `quarantine` — Move the file to the quarantine directory. * `ignore` - Ignore the file. **Note** Only include files that the scanner identified as containing a virus. All other file paths passed will be ignored.' enum: - cleanse_mailbox - delete - quarantine - ignore type: string description: The user provides the actions to perform on each specific infected file found in the scan. example: home/unsure: ignore home/virus1: delete home/virus2: quarantine type: object type: object responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: disinfect_files type: string module: description: The name of the module called. example: ClamScanner type: string result: properties: data: properties: log: description: 'Path to the disinfection log file. The log file will contain a list of JSON objects one per line. If the last line is: `{ "status": "done" }` the requested files with viruses have be handled as requested. Use the /ClamScanner/check_disinfection_status API to check the status of a running or finished disinfection.' example: /home/user/.clamavconnector.disinfection.log type: string task_id: description: The Task Queue system's task ID number. example: 00000000/5a9ec8dd4c345d type: string type: object errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Start disinfecting files with viruses tags: - ClamScanner x-codeSamples: - label: CLI lang: Shell source: echo '{"home/unsure":"ignore","home/virus1":"delete","home/virus2":"quarantine"}' | uapi --user=username --input=json --output=jsonpretty ClamScanner disinfect_files - label: HTTP Request (Wire Format) lang: HTTP source: 'POST /cpsess##########/execute/ClamScanner/disinfect_files HTTP/1.1 Host: example.com:2083 Cookie: ################################### Content-Type: application/json Content-Length: 74 {"home/unsure":"ignore","home/virus1":"delete","home/virus2":"quarantine"}' x-cpanel-api-version: UAPI x-cpanel-available-version: 94 /ClamScanner/get_scan_paths: get: x-readonly: true description: 'This function gets the available local paths that a cPanel account is permitted to scan. **Note**: The system determines the available scan types based on what the system administrator has set in WHM''s Configure ClamAV® page. **Note**: You must run the APIs in this order: 1. Run `ClamScanner::start_scan` to start the virus scan. 2. Run `ClamScanner::get_scan_status` in a loop until the scan is finished. 3. Run `ClamScanner::list_infected_files` to get a report of the complete list of infected files. 4. Decide how you want to handle each infected file. 5. Run `ClamScanner::disinfect_files` to queue the disinfection of the files. 6. Run `ClamScanner::check_disinfection_status` in a loop until you get a done status.' operationId: ClamScanner-get_scan_paths parameters: [] responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: get_scan_paths type: string module: description: The name of the module called. example: ClamScanner type: string result: properties: data: properties: id: description: 'The type of path * `home` — The cPanel account''s entire home directory. * `mail` — The cPanel account''s email directory. * `public_html` — The cPanel account''s web directory. * `public_ftp` — The cPanel account''s FTP directory.' enum: - home - mail - public_html - public_ftp example: home type: string message: description: Short description of the path example: Scan Entire Home Directory type: string type: object errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return virus scan types tags: - ClamScanner x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n ClamScanner \\\n get_scan_paths\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/ClamScanner/get_scan_paths - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ClamScanner_get_scan_paths.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/ClamScanner_get_scan_paths.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/ClamScanner/,\n q/get_scan_paths/\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ClamScanner_get_scan_paths.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/ClamScanner_get_scan_paths.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'ClamScanner',\n 'get_scan_paths'\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 94 /ClamScanner/get_scan_status: get: x-readonly: true description: 'This function gets the status of a ClamAV® scan on a directory. **Note**: You must run the APIs in this order: 1. Run `ClamScanner::start_scan` to start the virus scan. 2. Run `ClamScanner::get_scan_status` in a loop until the scan is finished. 3. Run `ClamScanner::list_infected_files` to get a report of the complete list of infected files. 4. Decide how you want to handle each infected file. 5. Run `ClamScanner::disinfect_files` to queue the disinfection of the files. 6. Run `ClamScanner::check_disinfection_status` in a loop until you get a done status.' operationId: ClamScanner-get_scan_status parameters: [] responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: get_scan_status type: string module: description: The name of the module called. example: ClamScanner type: string result: properties: data: properties: current_file: description: The current file being scanned. example: /home/username/afilename.txt type: string infected_files: description: List of files scanned and found to be infected. example: - /home/username/afile/witha/virus.txt - /home/username/we/gotcha.exe items: type: string type: array scan_complete: description: 'Whether the last scan has completed. * `1` - scan has completed. * `0` - scan has **not** completed.' enum: - 0 - 1 example: 1 type: integer scanned_file_count: description: The number of files already scanned. example: 135 minimum: 0 type: integer scanned_file_size: description: The number of bytes of data scanned. example: 6022 minimum: 0 type: integer time_started: description: The epoch timestamp of the beginning of the last scan. example: '1608593571' minimum: 0 type: string total_file_count: description: The total number of files found to scan. example: 135 minimum: 0 type: integer total_file_size_MiB: description: The total number of megabytes of data found to scan. example: 3640222 minimum: 0 type: integer type: object errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Request virus scan status tags: - ClamScanner x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n ClamScanner \\\n get_scan_status\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/ClamScanner/get_scan_status - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ClamScanner_get_scan_status.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/ClamScanner_get_scan_status.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/ClamScanner/,\n q/get_scan_status/\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ClamScanner_get_scan_status.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/ClamScanner_get_scan_status.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'ClamScanner',\n 'get_scan_status'\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 94 /ClamScanner/list_infected_files: get: x-readonly: true description: 'This function lists infected files from a ClamAV® virus scan. **Note**: You must run the APIs in this order: 1. Run `ClamScanner::start_scan` to start the virus scan. 2. Run `ClamScanner::get_scan_status` in a loop until the scan is finished. 3. Run `ClamScanner::list_infected_files` to get a report of the complete list of infected files. 4. Decide how you want to handle each infected file. 5. Run `ClamScanner::disinfect_files` to queue the disinfection of the files. 6. Run `ClamScanner::check_disinfection_status` in a loop until you get a done status.' operationId: ClamScanner-list_infected_files parameters: [] responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: list_infected_files type: string module: description: The name of the module called. example: ClamScanner type: string result: properties: data: items: properties: file: description: An absolute path to the infected file on the system. example: /home/username/infected_file.txt format: path type: string virus_type: description: A virus type. example: Eicar-Signature type: string type: object type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return infected file list tags: - ClamScanner x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n ClamScanner \\\n list_infected_files\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/ClamScanner/list_infected_files - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ClamScanner_list_infected_files.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/ClamScanner_list_infected_files.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/ClamScanner/,\n q/list_infected_files/\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ClamScanner_list_infected_files.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/ClamScanner_list_infected_files.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'ClamScanner',\n 'list_infected_files'\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 94 /ClamScanner/start_scan: get: x-readonly: false x-rollback: none description: 'This function starts a ClamAV® scan on a directory. **Note**: You must run the APIs in this order: 1. Run `ClamScanner::start_scan` to start the virus scan. 2. Run `ClamScanner::get_scan_status` in a loop until the scan is finished. 3. Run `ClamScanner::list_infected_files` to get a report of the complete list of infected files. 4. Decide how you want to handle each infected file. 5. Run `ClamScanner::disinfect_files` to queue the disinfection of the files. 6. Run `ClamScanner::check_disinfection_status` in a loop until you get a done status.' operationId: ClamScanner-start_scan parameters: - description: 'The type of directory to scan. * `home` — User''s entire home directory * `mail` — User''s email directory * `public_html` — User''s web directory * `public_ftp` — User''s ftp directory' in: query name: scan_type required: true schema: enum: - home - mail - public_html - public_ftp example: home responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: start_scan type: string module: description: The name of the module called. example: ClamScanner type: string result: properties: data: default: null type: - object - 'null' errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Start virus scan tags: - ClamScanner x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n ClamScanner \\\n start_scan \\\n scan_type='home'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/ClamScanner/start_scan?scan_type=home - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ClamScanner_start_scan.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/ClamScanner_start_scan.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/ClamScanner/,\n q/start_scan/,\n {\n 'scan_type' => 'home',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ClamScanner_start_scan.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/ClamScanner_start_scan.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'ClamScanner',\n 'start_scan',\n array (\n 'scan_type' => 'home',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 94 components: securitySchemes: BasicAuth: scheme: basic type: http externalDocs: url: https://cpanel.net/developers/ x-tagGroups: - name: API Development Tools tags: - API Token Management - Batch - SSE Task Management - URL Parsing - name: Authentication tags: - External Authentication - Two-Factor Settings - name: Backup Information tags: - BackupInfo - BackupInfo Status - name: Block Ip Addresses tags: - Block IP - name: Commerce Integration tags: - Market Integration - SSL Certificates - name: Contact Information tags: - Contact Information - name: cPanel Account tags: - Account Enhancements - Account Information - Account Management - AuditLog - Contact Information - cPanel Features - Disk Quotas - DomainRecommendations - Personalization - Resource Usage and Statistics - Subaccount Management - Team Roles - Team Users - name: cPanel Account Backups tags: - Backup - File Restoration - name: cPanel Plugin Framework tags: - Formbricks - Plugins - name: cPanel Theme Management tags: - Application Information - Brand Management - Branding Files - Browser Cache Management - Language - Theme Settings - name: Directory Management tags: - Directory Indexes - Directory Privacy - Directory Protection - name: DNS tags: - DNS - DNS Information - DNS Security - Dynamic DNS - Email DNS Settings - ZoneEdit - name: Domain tags: - Domain - name: Domain Management tags: - AddonDomain - Direct Link Protection (Hotlink) - Domain - Domain Information - Domain Redirection - DomainLookup - Park - SubDomain - Virtual Host Information - name: Domains tags: - Subdomains - name: Email tags: - Email Accounts - Email Filtering - Email Forwarding - Email Server Information - Email Suspensions - Mail Server Information - Mailbox Management - Mailing Lists - Signing and Encryption (GnuPG Keys) - Spam Filtering (Greylisting) - Spam Management - Spam Prevention (BoxTrapper) - Webmail Applications - Webmail Sessions - name: Extract Information tags: - ExtractInfo - ExtractInfo Status - name: File Manager tags: - Trash - name: Files tags: - FTP Accounts - FTP Server Settings - Image Tools - Jodit - Manage Files - Manage Files - WebDisk Settings - name: GIT Management tags: - Deployment Settings - Repository Management - name: InProductSurvey tags: - InProductSurvey - name: MySQL and MariaDB tags: - Database Information - Database Management - Remote Databases - User Management - name: Notifications tags: - Pushbullet - name: Optional Applications tags: - Antivirus Protection (ClamAV) - Calendar and Contacts (DAV) - Calendar and Contacts Server - WordPress Manager Backups - name: PostgreSQL tags: - PostgreSQL Database Management - PostgreSQL User Management - name: Retrieve bandwidth information tags: - Bandwidth - name: Security tags: - Known SSH Hosts Management - Login Information - name: Server Information tags: - cPanel Server Information - Notifications - Password Strength - SSH - WebPros MCP - WebProsMCP - name: ServiceProxy tags: - ServiceProxy - name: Site Quality Monitoring tags: - SiteQuality - name: SSL Certificates tags: - Auto-generated SSL Certificates - cPanel Account SSL Management - SNI Email Settings - SSL Certificate Management - Verify Domain Ownership - name: Statistics tags: - Domain Statistics - Weblog Settings - name: UserData tags: - UserData - name: Web Server Configuration tags: - EA4 - EasyApache Settings - PHP - name: Web Server Management tags: - Application Manager - ModSecurity - NginxCaching - PHP Settings - Web Apps - name: Website Configuration tags: - Handler Management - Logs - Mime Type Management - Nova - Site Information - Site Installation - Sitejet - WPX