# Antivirus Protection (ClamAV)

Optional Applications / Antivirus Protection (ClamAV)

## Request disinfection process status

 - [GET /ClamScanner/check_disinfection_status](https://api.docs.cpanel.net/specifications/cpanel.openapi/antivirus-protection-(clamav)/clamscanner::check_disinfection_status.md): 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.

## Start disinfecting files with viruses

 - [POST /ClamScanner/disinfect_files](https://api.docs.cpanel.net/specifications/cpanel.openapi/antivirus-protection-(clamav)/disinfect_files.md): 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.

## Return virus scan types

 - [GET /ClamScanner/get_scan_paths](https://api.docs.cpanel.net/specifications/cpanel.openapi/antivirus-protection-(clamav)/clamscanner::get_scan_paths.md): 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.

## Request virus scan status

 - [GET /ClamScanner/get_scan_status](https://api.docs.cpanel.net/specifications/cpanel.openapi/antivirus-protection-(clamav)/clamscanner::get_scan_status.md): 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.

## Return infected file list

 - [GET /ClamScanner/list_infected_files](https://api.docs.cpanel.net/specifications/cpanel.openapi/antivirus-protection-(clamav)/clamscanner::list_infected_files.md): 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.

## Start virus scan

 - [GET /ClamScanner/start_scan](https://api.docs.cpanel.net/specifications/cpanel.openapi/antivirus-protection-(clamav)/clamscanner::start_scan.md): 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.

