

# StartMalwareScan
<a name="API_StartMalwareScan"></a>

Initiates the malware scan. Invoking this API will automatically create the [Service-linked role](https://docs.amazonaws.cn/guardduty/latest/ug/slr-permissions-malware-protection.html) in the corresponding account if the resourceArn belongs to an EC2 instance.

When the malware scan starts, you can use the associated scan ID to track the status of the scan. For more information, see [ListMalwareScans](https://docs.amazonaws.cn/guardduty/latest/APIReference/API_ListMalwareScans.html) and [GetMalwareScan](https://docs.amazonaws.cn/guardduty/latest/APIReference/API_GetMalwareScan.html).

When you use this API, the Amazon service terms for GuardDuty Malware Protection apply. For more information, see [Amazon service terms for GuardDuty Malware Protection](http://www.amazonaws.cn/service-terms/#87._Amazon_GuardDuty).

## Request Syntax
<a name="API_StartMalwareScan_RequestSyntax"></a>

```
POST /malware-scan/start HTTP/1.1
Content-type: application/json

{
   "clientToken": "string",
   "resourceArn": "string",
   "scanConfiguration": { 
      "incrementalScanDetails": { 
         "baselineResourceArn": "string"
      },
      "recoveryPoint": { 
         "backupVaultName": "string"
      },
      "role": "string"
   }
}
```

## URI Request Parameters
<a name="API_StartMalwareScan_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_StartMalwareScan_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [clientToken](#API_StartMalwareScan_RequestSyntax) **   <a name="guardduty-StartMalwareScan-request-clientToken"></a>
The idempotency token for the create request.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 64.  
Required: No

 ** [resourceArn](#API_StartMalwareScan_RequestSyntax) **   <a name="guardduty-StartMalwareScan-request-resourceArn"></a>
Amazon Resource Name (ARN) of the resource for which you invoked the API.  
Type: String  
Pattern: `^arn:[A-Za-z-]+:[A-Za-z0-9]+:[A-Za-z0-9-]+:\d+:(([A-Za-z0-9-]+)[:\/])?[A-Za-z0-9:-]*$`   
Required: Yes

 ** [scanConfiguration](#API_StartMalwareScan_RequestSyntax) **   <a name="guardduty-StartMalwareScan-request-scanConfiguration"></a>
Contains information about the configuration to be used for the malware scan.  
Type: [StartMalwareScanConfiguration](API_StartMalwareScanConfiguration.md) object  
Required: No

## Response Syntax
<a name="API_StartMalwareScan_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "scanId": "string"
}
```

## Response Elements
<a name="API_StartMalwareScan_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [scanId](#API_StartMalwareScan_ResponseSyntax) **   <a name="guardduty-StartMalwareScan-response-scanId"></a>
A unique identifier that gets generated when you invoke the API without any error. Each malware scan has a corresponding scan ID. Using this scan ID, you can monitor the status of your malware scan.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 200.

## Errors
<a name="API_StartMalwareScan_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** BadRequestException **   
A bad request exception object.    
 ** Message **   
The error message.  
 ** Type **   
The error type.
HTTP Status Code: 400

 ** ConflictException **   
A request conflict exception object.    
 ** Message **   
The error message.  
 ** Type **   
The error type.
HTTP Status Code: 409

 ** InternalServerErrorException **   
An internal server error exception object.    
 ** Message **   
The error message.  
 ** Type **   
The error type.
HTTP Status Code: 500

## See Also
<a name="API_StartMalwareScan_SeeAlso"></a>

For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/guardduty-2017-11-28/StartMalwareScan) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/guardduty-2017-11-28/StartMalwareScan) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/guardduty-2017-11-28/StartMalwareScan) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/guardduty-2017-11-28/StartMalwareScan) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/guardduty-2017-11-28/StartMalwareScan) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/guardduty-2017-11-28/StartMalwareScan) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/guardduty-2017-11-28/StartMalwareScan) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/guardduty-2017-11-28/StartMalwareScan) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/guardduty-2017-11-28/StartMalwareScan) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/guardduty-2017-11-28/StartMalwareScan) 