

For similar capabilities to Amazon Timestream for LiveAnalytics, consider Amazon Timestream for InfluxDB. It offers simplified data ingestion and single-digit millisecond query response times for real-time analytics. Learn more [here](https://docs.aws.amazon.com//timestream/latest/developerguide/timestream-for-influxdb.html).

# CancelQuery
<a name="API_query_CancelQuery"></a>

 Cancels a query that has been issued. Cancellation is provided only if the query has not completed running before the cancellation request was issued. Because cancellation is an idempotent operation, subsequent cancellation requests will return a `CancellationMessage`, indicating that the query has already been canceled. See [code sample](https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.cancel-query.html) for details. 

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

```
{
   "QueryId": "string"
}
```

## Request Parameters
<a name="API_query_CancelQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [QueryId](#API_query_CancelQuery_RequestSyntax) **   <a name="timestream-query_CancelQuery-request-QueryId"></a>
 The ID of the query that needs to be cancelled. `QueryID` is returned as part of the query result.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `[a-zA-Z0-9]+`   
Required: Yes

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

```
{
   "CancellationMessage": "string"
}
```

## Response Elements
<a name="API_query_CancelQuery_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.

 ** [CancellationMessage](#API_query_CancelQuery_ResponseSyntax) **   <a name="timestream-query_CancelQuery-response-CancellationMessage"></a>
 A `CancellationMessage` is returned when a `CancelQuery` request for the query specified by `QueryId` has already been issued.   
Type: String

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

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

 ** AccessDeniedException **   
You do not have the necessary permissions to access the account settings.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request.  
HTTP Status Code: 400

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

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

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/CancelQuery) 