Scan
Will perform a scan on the file, directory, or entire system. The scan will be performed synchronously in the case of file and folder scans and asynchronously for full scans, i.e. the scan will be executed and immediately return without waiting for the product.
Syntax
Method ID
#define WAAPI_MID_SCAN 1006
JSON Input Structure
{
"input": {
"method": 1006,
"signature": number,
"scan_type": string,
"path": string,
"clean": boolean
}
}
Input Properties
| Parameter | Type | Description |
|---|---|---|
scan_type | string | 'full' for full system scans, 'default' for a default scan (if defined) or 'path' for a scan using a system path. |
path | string | (optional) The full path to a file, or folder. Only used in the case where scan_type = 'path'. |
clean | boolean | (optional) Specifies whether an attempt should be made to clean threats detected during the scan. This is an attempt, but cleaning is not always possible. Default is false. |
JSON Output Structure
{
"result": {
"method": 1006,
"code": number,
"timing": number,
"timestamp": string,
"malware_found": boolean,
"clean": boolean,
"threats": [
{
"threat_name": string,
"path": string,
"scan_time": string,
"remediation": string
},
...
]
}
}
Output Properties
| Property | Type | Description |
|---|---|---|
result.method | number | The method ID that generated this result. |
result.code | number | The result code. See Result Codes. |
result.timing | number | The measured time for the method call in milliseconds. |
result.timestamp | string | The timestamp in seconds of when the call was made. |
result.malware_found | boolean | (optional) Returns true if the scan detected any malware. NOTE: 'malware_found' will not exist in the case of a 'full' or 'default' scan, or if the clean operation could not be performed. |
result.clean | boolean | (optional) Indicates the state of the affected area after the scan. NOTE: 'clean' will not exist in the case of a 'full' or 'default' scan, or if the clean operation could not be performed. |
result.threats | array<object> | (optional) An array of information on the threats found from this scan operation. Only used in the case where scan_type = 'path' and threats information is available. |
result.threats.threat_name | string | The name of the threat found. |
result.threats.path | string | The file path of the file where the threat was detected. |
result.threats.scan_time | string | The time the threat was found in unix time (GMT). |
result.threats.remediation | string | The type of remediation (none, cleaned, deleted, quarantined, or partial). |
Result Codes
| Code | Name | Description |
|---|---|---|
| 0 | WAAPI_OK | The operation completed successfully. |
note
Other codes may be returned. See the full Result Codes reference for the complete list.
Remarks
Error Handling
The results of this function are determined by the error code returned by the call. If successful, WAAPI_OK or a special success code will be returned. Always check both the function return value and the result.code field in the output JSON.
Examples
Examples will be added here demonstrating the usage of this method.
See Also
Last updated: 2026-10-01