

# AWS Cost Explorer
<a name="API_Operations_AWS_Cost_Explorer_Service"></a>

The following actions are supported by AWS Cost Explorer:
+  [CreateAnomalyMonitor](API_CreateAnomalyMonitor.md) 
+  [CreateAnomalySubscription](API_CreateAnomalySubscription.md) 
+  [CreateCostCategoryDefinition](API_CreateCostCategoryDefinition.md) 
+  [DeleteAnomalyMonitor](API_DeleteAnomalyMonitor.md) 
+  [DeleteAnomalySubscription](API_DeleteAnomalySubscription.md) 
+  [DeleteCostCategoryDefinition](API_DeleteCostCategoryDefinition.md) 
+  [DescribeCostCategoryDefinition](API_DescribeCostCategoryDefinition.md) 
+  [GetAnomalies](API_GetAnomalies.md) 
+  [GetAnomalyMonitors](API_GetAnomalyMonitors.md) 
+  [GetAnomalySubscriptions](API_GetAnomalySubscriptions.md) 
+  [GetApproximateUsageRecords](API_GetApproximateUsageRecords.md) 
+  [GetCommitmentPurchaseAnalysis](API_GetCommitmentPurchaseAnalysis.md) 
+  [GetCostAndUsage](API_GetCostAndUsage.md) 
+  [GetCostAndUsageComparisons](API_GetCostAndUsageComparisons.md) 
+  [GetCostAndUsageWithResources](API_GetCostAndUsageWithResources.md) 
+  [GetCostCategories](API_GetCostCategories.md) 
+  [GetCostComparisonDrivers](API_GetCostComparisonDrivers.md) 
+  [GetCostForecast](API_GetCostForecast.md) 
+  [GetDimensionValues](API_GetDimensionValues.md) 
+  [GetReservationCoverage](API_GetReservationCoverage.md) 
+  [GetReservationPurchaseRecommendation](API_GetReservationPurchaseRecommendation.md) 
+  [GetReservationUtilization](API_GetReservationUtilization.md) 
+  [GetRightsizingRecommendation](API_GetRightsizingRecommendation.md) 
+  [GetSavingsPlanPurchaseRecommendationDetails](API_GetSavingsPlanPurchaseRecommendationDetails.md) 
+  [GetSavingsPlansCoverage](API_GetSavingsPlansCoverage.md) 
+  [GetSavingsPlansPurchaseRecommendation](API_GetSavingsPlansPurchaseRecommendation.md) 
+  [GetSavingsPlansUtilization](API_GetSavingsPlansUtilization.md) 
+  [GetSavingsPlansUtilizationDetails](API_GetSavingsPlansUtilizationDetails.md) 
+  [GetTags](API_GetTags.md) 
+  [GetUsageForecast](API_GetUsageForecast.md) 
+  [ListCommitmentPurchaseAnalyses](API_ListCommitmentPurchaseAnalyses.md) 
+  [ListCostAllocationTagBackfillHistory](API_ListCostAllocationTagBackfillHistory.md) 
+  [ListCostAllocationTags](API_ListCostAllocationTags.md) 
+  [ListCostCategoryDefinitions](API_ListCostCategoryDefinitions.md) 
+  [ListCostCategoryResourceAssociations](API_ListCostCategoryResourceAssociations.md) 
+  [ListSavingsPlansPurchaseRecommendationGeneration](API_ListSavingsPlansPurchaseRecommendationGeneration.md) 
+  [ListTagsForResource](API_ListTagsForResource.md) 
+  [ProvideAnomalyFeedback](API_ProvideAnomalyFeedback.md) 
+  [StartCommitmentPurchaseAnalysis](API_StartCommitmentPurchaseAnalysis.md) 
+  [StartCostAllocationTagBackfill](API_StartCostAllocationTagBackfill.md) 
+  [StartSavingsPlansPurchaseRecommendationGeneration](API_StartSavingsPlansPurchaseRecommendationGeneration.md) 
+  [TagResource](API_TagResource.md) 
+  [UntagResource](API_UntagResource.md) 
+  [UpdateAnomalyMonitor](API_UpdateAnomalyMonitor.md) 
+  [UpdateAnomalySubscription](API_UpdateAnomalySubscription.md) 
+  [UpdateCostAllocationTagsStatus](API_UpdateCostAllocationTagsStatus.md) 
+  [UpdateCostCategoryDefinition](API_UpdateCostCategoryDefinition.md) 

# CreateAnomalyMonitor
<a name="API_CreateAnomalyMonitor"></a>

Creates a new cost anomaly detection monitor with the requested type and monitor specification. 

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

```
{
   "AnomalyMonitor": { 
      "CreationDate": "string",
      "DimensionalValueCount": number,
      "LastEvaluatedDate": "string",
      "LastUpdatedDate": "string",
      "MonitorArn": "string",
      "MonitorDimension": "string",
      "MonitorName": "string",
      "MonitorSpecification": { 
         "And": [ 
            "Expression"
         ],
         "CostCategories": { 
            "Key": "string",
            "MatchOptions": [ "string" ],
            "Values": [ "string" ]
         },
         "Dimensions": { 
            "Key": "string",
            "MatchOptions": [ "string" ],
            "Values": [ "string" ]
         },
         "Not": "Expression",
         "Or": [ 
            "Expression"
         ],
         "Tags": { 
            "Key": "string",
            "MatchOptions": [ "string" ],
            "Values": [ "string" ]
         }
      },
      "MonitorType": "string"
   },
   "ResourceTags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ]
}
```

## Request Parameters
<a name="API_CreateAnomalyMonitor_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.

 ** [AnomalyMonitor](#API_CreateAnomalyMonitor_RequestSyntax) **   <a name="awscostmanagement-CreateAnomalyMonitor-request-AnomalyMonitor"></a>
The cost anomaly detection monitor object that you want to create.  
Type: [AnomalyMonitor](API_AnomalyMonitor.md) object  
Required: Yes

 ** [ResourceTags](#API_CreateAnomalyMonitor_RequestSyntax) **   <a name="awscostmanagement-CreateAnomalyMonitor-request-ResourceTags"></a>
An optional list of tags to associate with the specified [https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_AnomalyMonitor.html](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_AnomalyMonitor.html). You can use resource tags to control access to your `monitor` using IAM policies.  
Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions apply to resource tags:  
+ Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource. The remaining are reserved for AWS use
+ The maximum length of a key is 128 characters
+ The maximum length of a value is 256 characters
+ Keys and values can only contain alphanumeric characters, spaces, and any of the following: `_.:/=+@-` 
+ Keys and values are case sensitive
+ Keys and values are trimmed for any leading or trailing whitespaces
+ Don’t use `aws:` as a prefix for your keys. This prefix is reserved for AWS use
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 200 items.  
Required: No

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

```
{
   "MonitorArn": "string"
}
```

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

 ** [MonitorArn](#API_CreateAnomalyMonitor_ResponseSyntax) **   <a name="awscostmanagement-CreateAnomalyMonitor-response-MonitorArn"></a>
The unique identifier of your newly created cost anomaly detection monitor.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*` 

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## Examples
<a name="API_CreateAnomalyMonitor_Examples"></a>

The following are sample requests and responses of the `CreateAnomalyMonitor` operation.

### Example 1
<a name="API_CreateAnomalyMonitor_Example_1"></a>

The following example for the `CreateAnomalyMonitor` operation creates an AWS managed services monitor with resource tags.

#### Sample Request
<a name="API_CreateAnomalyMonitor_Example_1_Request"></a>

```
{
    "AnomalyMonitor": {
        "MonitorName": "Monitor name",
        "MonitorType": "DIMENSIONAL",
        "MonitorDimension": "SERVICE"
    },
    "ResourceTags": [
        {
            "Key": "tag key",
            "Value": "tag value"
        }
    ]
}
```

#### Sample Response
<a name="API_CreateAnomalyMonitor_Example_1_Response"></a>

```
{
    "MonitorArn": "arn:${partition}:ce::${account-id}:anomalymonitor/${monitor-id}"
}
```

### Example 2
<a name="API_CreateAnomalyMonitor_Example_2"></a>

The following example for the `CreateAnomalyMonitor` operation creates an AWS managed linked account monitor.

#### Sample Request
<a name="API_CreateAnomalyMonitor_Example_2_Request"></a>

```
{
    "AnomalyMonitor": {
        "MonitorName": "Monitor name",
        "MonitorType": "DIMENSIONAL",
        "MonitorDimension": "LINKED_ACCOUNT"
    }
}
```

#### Sample Response
<a name="API_CreateAnomalyMonitor_Example_2_Response"></a>

```
{
    "MonitorArn": "arn:${partition}:ce::${account-id}:anomalymonitor/${monitor-id}"
}
```

### Example 3
<a name="API_CreateAnomalyMonitor_Example_3"></a>

The following example for the `CreateAnomalyMonitor` operation creates an AWS managed cost allocation tag monitor.

#### Sample Request
<a name="API_CreateAnomalyMonitor_Example_3_Request"></a>

```
{
    "AnomalyMonitor": {
        "MonitorName": "Monitor name",
        "MonitorType": "DIMENSIONAL",
        "MonitorDimension": "TAG",
        "MonitorSpecification": {
            "Tags": {
                "Key": "tag key"
            }
        }
    }
}
```

#### Sample Response
<a name="API_CreateAnomalyMonitor_Example_3_Response"></a>

```
{
    "MonitorArn": "arn:${partition}:ce::${account-id}:anomalymonitor/${monitor-id}"
}
```

### Example 4
<a name="API_CreateAnomalyMonitor_Example_4"></a>

The following example for the `CreateAnomalyMonitor` operation creates an AWS managed cost category monitor.

#### Sample Request
<a name="API_CreateAnomalyMonitor_Example_4_Request"></a>

```
{
    "AnomalyMonitor": {
        "MonitorName": "Monitor name",
        "MonitorType": "DIMENSIONAL",
        "MonitorDimension": "COST_CATEGORY",
        "MonitorSpecification": {
            "CostCategories": {
                "Key": "cost category key"
            }
        }
    }
}
```

#### Sample Response
<a name="API_CreateAnomalyMonitor_Example_4_Response"></a>

```
{
    "MonitorArn": "arn:${partition}:ce::${account-id}:anomalymonitor/${monitor-id}"
}
```

### Example 5
<a name="API_CreateAnomalyMonitor_Example_5"></a>

The following example for the `CreateAnomalyMonitor` operation creates a customer managed linked account monitor. You can track up to ten linked accounts with a single monitor.

#### Sample Request
<a name="API_CreateAnomalyMonitor_Example_5_Request"></a>

```
{
    "AnomalyMonitor": {
        "MonitorName": "Monitor name",
        "MonitorType": "CUSTOM",
        "MonitorSpecification": {
            "Dimensions": {
                "Key": "LINKED_ACCOUNT",
                "Values": [
                    "000011112222",
                    "111122223333"
                ]
            }
        }
    }
}
```

#### Sample Response
<a name="API_CreateAnomalyMonitor_Example_5_Response"></a>

```
{
    "MonitorArn": "arn:${partition}:ce::${account-id}:anomalymonitor/${monitor-id}"
}
```

### Example 6
<a name="API_CreateAnomalyMonitor_Example_6"></a>

The following example for the `CreateAnomalyMonitor` operation creates a customer managed cost allocation tag monitor. You can track up to ten tag values with a single monitor.

#### Sample Request
<a name="API_CreateAnomalyMonitor_Example_6_Request"></a>

```
{
    "AnomalyMonitor": {
        "MonitorName": "Monitor name",
        "MonitorType": "CUSTOM",
        "MonitorSpecification": {
            "Tags": {
                "Key": "tag key",
                "Values": [
                    "tag value 1",
                    "tag value 2"
                ]
            }
        }
    }
}
```

#### Sample Response
<a name="API_CreateAnomalyMonitor_Example_6_Response"></a>

```
{
    "MonitorArn": "arn:${partition}:ce::${account-id}:anomalymonitor/${monitor-id}"
}
```

### Example 7
<a name="API_CreateAnomalyMonitor_Example_7"></a>

The following example for the `CreateAnomalyMonitor` operation creates a customer managed cost category monitor. You can track one value with a single monitor. 

#### Sample Request
<a name="API_CreateAnomalyMonitor_Example_7_Request"></a>

```
{
    "AnomalyMonitor": {
        "MonitorName": "Monitor name",
        "MonitorType": "CUSTOM",
        "MonitorSpecification": {
            "CostCategories": {
                "Key": "cost category key",
                "Values": [ "cost category value" ]
            }
        }
    }
}
```

#### Sample Response
<a name="API_CreateAnomalyMonitor_Example_7_Response"></a>

```
{
    "MonitorArn": "arn:${partition}:ce::${account-id}:anomalymonitor/${monitor-id}"
}
```

## See Also
<a name="API_CreateAnomalyMonitor_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/ce-2017-10-25/CreateAnomalyMonitor) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/CreateAnomalyMonitor) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/CreateAnomalyMonitor) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/CreateAnomalyMonitor) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/CreateAnomalyMonitor) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/CreateAnomalyMonitor) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/CreateAnomalyMonitor) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/CreateAnomalyMonitor) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/CreateAnomalyMonitor) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/CreateAnomalyMonitor) 

# CreateAnomalySubscription
<a name="API_CreateAnomalySubscription"></a>

Adds an alert subscription to a cost anomaly detection monitor. You can use each subscription to define subscribers with email or SNS notifications. Email subscribers can set an absolute or percentage threshold and a time frequency for receiving notifications. 

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

```
{
   "AnomalySubscription": { 
      "AccountId": "string",
      "Frequency": "string",
      "MonitorArnList": [ "string" ],
      "Subscribers": [ 
         { 
            "Address": "string",
            "Status": "string",
            "Type": "string"
         }
      ],
      "SubscriptionArn": "string",
      "SubscriptionName": "string",
      "Threshold": number,
      "ThresholdExpression": { 
         "And": [ 
            "Expression"
         ],
         "CostCategories": { 
            "Key": "string",
            "MatchOptions": [ "string" ],
            "Values": [ "string" ]
         },
         "Dimensions": { 
            "Key": "string",
            "MatchOptions": [ "string" ],
            "Values": [ "string" ]
         },
         "Not": "Expression",
         "Or": [ 
            "Expression"
         ],
         "Tags": { 
            "Key": "string",
            "MatchOptions": [ "string" ],
            "Values": [ "string" ]
         }
      }
   },
   "ResourceTags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ]
}
```

## Request Parameters
<a name="API_CreateAnomalySubscription_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.

 ** [AnomalySubscription](#API_CreateAnomalySubscription_RequestSyntax) **   <a name="awscostmanagement-CreateAnomalySubscription-request-AnomalySubscription"></a>
The cost anomaly subscription object that you want to create.   
Type: [AnomalySubscription](API_AnomalySubscription.md) object  
Required: Yes

 ** [ResourceTags](#API_CreateAnomalySubscription_RequestSyntax) **   <a name="awscostmanagement-CreateAnomalySubscription-request-ResourceTags"></a>
An optional list of tags to associate with the specified [https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_AnomalySubscription.html](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_AnomalySubscription.html). You can use resource tags to control access to your `subscription` using IAM policies.  
Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions apply to resource tags:  
+ Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource. The remaining are reserved for AWS use
+ The maximum length of a key is 128 characters
+ The maximum length of a value is 256 characters
+ Keys and values can only contain alphanumeric characters, spaces, and any of the following: `_.:/=+@-` 
+ Keys and values are case sensitive
+ Keys and values are trimmed for any leading or trailing whitespaces
+ Don’t use `aws:` as a prefix for your keys. This prefix is reserved for AWS use
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 200 items.  
Required: No

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

```
{
   "SubscriptionArn": "string"
}
```

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

 ** [SubscriptionArn](#API_CreateAnomalySubscription_ResponseSyntax) **   <a name="awscostmanagement-CreateAnomalySubscription-response-SubscriptionArn"></a>
The unique identifier of your newly created cost anomaly subscription.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*` 

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** UnknownMonitorException **   
The cost anomaly monitor does not exist for the account.   
HTTP Status Code: 400

## See Also
<a name="API_CreateAnomalySubscription_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/ce-2017-10-25/CreateAnomalySubscription) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/CreateAnomalySubscription) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/CreateAnomalySubscription) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/CreateAnomalySubscription) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/CreateAnomalySubscription) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/CreateAnomalySubscription) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/CreateAnomalySubscription) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/CreateAnomalySubscription) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/CreateAnomalySubscription) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/CreateAnomalySubscription) 

# CreateCostCategoryDefinition
<a name="API_CreateCostCategoryDefinition"></a>

Creates a new cost category with the requested name and rules.

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

```
{
   "DefaultValue": "string",
   "EffectiveStart": "string",
   "Name": "string",
   "ResourceTags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ],
   "Rules": [ 
      { 
         "InheritedValue": { 
            "DimensionKey": "string",
            "DimensionName": "string"
         },
         "Rule": { 
            "And": [ 
               "Expression"
            ],
            "CostCategories": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            },
            "Dimensions": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            },
            "Not": "Expression",
            "Or": [ 
               "Expression"
            ],
            "Tags": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            }
         },
         "Type": "string",
         "Value": "string"
      }
   ],
   "RuleVersion": "string",
   "SplitChargeRules": [ 
      { 
         "Method": "string",
         "Parameters": [ 
            { 
               "Type": "string",
               "Values": [ "string" ]
            }
         ],
         "Source": "string",
         "Targets": [ "string" ]
      }
   ]
}
```

## Request Parameters
<a name="API_CreateCostCategoryDefinition_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.

 ** [DefaultValue](#API_CreateCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-CreateCostCategoryDefinition-request-DefaultValue"></a>
The default value for the cost category.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 50.  
Pattern: `^(?! )[\p{L}\p{N}\p{Z}-_]*(?<! )$`   
Required: No

 ** [EffectiveStart](#API_CreateCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-CreateCostCategoryDefinition-request-EffectiveStart"></a>
The cost category's effective start date. It can only be a billing start date (first day of the month). If the date isn't provided, it's the first day of the current month. Dates can't be before the previous twelve months, or in the future.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$`   
Required: No

 ** [Name](#API_CreateCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-CreateCostCategoryDefinition-request-Name"></a>
The unique name of the cost category.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 50.  
Pattern: `^(?! )[\p{L}\p{N}\p{Z}-_]*(?<! )$`   
Required: Yes

 ** [ResourceTags](#API_CreateCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-CreateCostCategoryDefinition-request-ResourceTags"></a>
An optional list of tags to associate with the specified [https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_CostCategory.html](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_CostCategory.html). You can use resource tags to control access to your `cost category` using IAM policies.  
Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions apply to resource tags:  
+ Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource. The remaining are reserved for AWS use
+ The maximum length of a key is 128 characters
+ The maximum length of a value is 256 characters
+ Keys and values can only contain alphanumeric characters, spaces, and any of the following: `_.:/=+@-` 
+ Keys and values are case sensitive
+ Keys and values are trimmed for any leading or trailing whitespaces
+ Don’t use `aws:` as a prefix for your keys. This prefix is reserved for AWS use
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 200 items.  
Required: No

 ** [Rules](#API_CreateCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-CreateCostCategoryDefinition-request-Rules"></a>
The cost category rules used to categorize costs. For more information, see [CostCategoryRule](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_CostCategoryRule.html).  
Type: Array of [CostCategoryRule](API_CostCategoryRule.md) objects  
Array Members: Minimum number of 1 item. Maximum number of 500 items.  
Required: Yes

 ** [RuleVersion](#API_CreateCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-CreateCostCategoryDefinition-request-RuleVersion"></a>
The rule schema version in this particular cost category.  
Type: String  
Valid Values: `CostCategoryExpression.v1`   
Required: Yes

 ** [SplitChargeRules](#API_CreateCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-CreateCostCategoryDefinition-request-SplitChargeRules"></a>
 The split charge rules used to allocate your charges between your cost category values.   
Type: Array of [CostCategorySplitChargeRule](API_CostCategorySplitChargeRule.md) objects  
Array Members: Minimum number of 1 item. Maximum number of 10 items.  
Required: No

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

```
{
   "CostCategoryArn": "string",
   "EffectiveStart": "string"
}
```

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

 ** [CostCategoryArn](#API_CreateCostCategoryDefinition_ResponseSyntax) **   <a name="awscostmanagement-CreateCostCategoryDefinition-response-CostCategoryArn"></a>
The unique identifier for your newly created cost category.   
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+` 

 ** [EffectiveStart](#API_CreateCostCategoryDefinition_ResponseSyntax) **   <a name="awscostmanagement-CreateCostCategoryDefinition-response-EffectiveStart"></a>
The cost category's effective start date. It can only be a billing start date (first day of the month).  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$` 

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
 You've reached the limit on the number of resources you can create, or exceeded the size of an individual resource.   
HTTP Status Code: 400

## See Also
<a name="API_CreateCostCategoryDefinition_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/ce-2017-10-25/CreateCostCategoryDefinition) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/CreateCostCategoryDefinition) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/CreateCostCategoryDefinition) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/CreateCostCategoryDefinition) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/CreateCostCategoryDefinition) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/CreateCostCategoryDefinition) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/CreateCostCategoryDefinition) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/CreateCostCategoryDefinition) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/CreateCostCategoryDefinition) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/CreateCostCategoryDefinition) 

# DeleteAnomalyMonitor
<a name="API_DeleteAnomalyMonitor"></a>

Deletes a cost anomaly monitor. 

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

```
{
   "MonitorArn": "string"
}
```

## Request Parameters
<a name="API_DeleteAnomalyMonitor_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.

 ** [MonitorArn](#API_DeleteAnomalyMonitor_RequestSyntax) **   <a name="awscostmanagement-DeleteAnomalyMonitor-request-MonitorArn"></a>
The unique identifier of the cost anomaly monitor that you want to delete.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: Yes

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

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

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** UnknownMonitorException **   
The cost anomaly monitor does not exist for the account.   
HTTP Status Code: 400

## See Also
<a name="API_DeleteAnomalyMonitor_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/ce-2017-10-25/DeleteAnomalyMonitor) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/DeleteAnomalyMonitor) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/DeleteAnomalyMonitor) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/DeleteAnomalyMonitor) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/DeleteAnomalyMonitor) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/DeleteAnomalyMonitor) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/DeleteAnomalyMonitor) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/DeleteAnomalyMonitor) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/DeleteAnomalyMonitor) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/DeleteAnomalyMonitor) 

# DeleteAnomalySubscription
<a name="API_DeleteAnomalySubscription"></a>

Deletes a cost anomaly subscription. 

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

```
{
   "SubscriptionArn": "string"
}
```

## Request Parameters
<a name="API_DeleteAnomalySubscription_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.

 ** [SubscriptionArn](#API_DeleteAnomalySubscription_RequestSyntax) **   <a name="awscostmanagement-DeleteAnomalySubscription-request-SubscriptionArn"></a>
The unique identifier of the cost anomaly subscription that you want to delete.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: Yes

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

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

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** UnknownSubscriptionException **   
The cost anomaly subscription does not exist for the account.   
HTTP Status Code: 400

## See Also
<a name="API_DeleteAnomalySubscription_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/ce-2017-10-25/DeleteAnomalySubscription) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/DeleteAnomalySubscription) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/DeleteAnomalySubscription) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/DeleteAnomalySubscription) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/DeleteAnomalySubscription) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/DeleteAnomalySubscription) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/DeleteAnomalySubscription) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/DeleteAnomalySubscription) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/DeleteAnomalySubscription) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/DeleteAnomalySubscription) 

# DeleteCostCategoryDefinition
<a name="API_DeleteCostCategoryDefinition"></a>

Deletes a cost category. Expenses from this month going forward will no longer be categorized with this cost category.

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

```
{
   "CostCategoryArn": "string"
}
```

## Request Parameters
<a name="API_DeleteCostCategoryDefinition_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.

 ** [CostCategoryArn](#API_DeleteCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-DeleteCostCategoryDefinition-request-CostCategoryArn"></a>
The unique identifier for your cost category.   
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+`   
Required: Yes

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

```
{
   "CostCategoryArn": "string",
   "EffectiveEnd": "string"
}
```

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

 ** [CostCategoryArn](#API_DeleteCostCategoryDefinition_ResponseSyntax) **   <a name="awscostmanagement-DeleteCostCategoryDefinition-response-CostCategoryArn"></a>
The unique identifier for your cost category.   
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+` 

 ** [EffectiveEnd](#API_DeleteCostCategoryDefinition_ResponseSyntax) **   <a name="awscostmanagement-DeleteCostCategoryDefinition-response-EffectiveEnd"></a>
The effective end date of the cost category as a result of deleting it. No costs after this date is categorized by the deleted cost category.   
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$` 

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

## See Also
<a name="API_DeleteCostCategoryDefinition_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/ce-2017-10-25/DeleteCostCategoryDefinition) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/DeleteCostCategoryDefinition) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/DeleteCostCategoryDefinition) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/DeleteCostCategoryDefinition) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/DeleteCostCategoryDefinition) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/DeleteCostCategoryDefinition) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/DeleteCostCategoryDefinition) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/DeleteCostCategoryDefinition) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/DeleteCostCategoryDefinition) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/DeleteCostCategoryDefinition) 

# DescribeCostCategoryDefinition
<a name="API_DescribeCostCategoryDefinition"></a>

Returns the name, Amazon Resource Name (ARN), rules, definition, and effective dates of a cost category that's defined in the account.

You have the option to use `EffectiveOn` to return a cost category that's active on a specific date. If there's no `EffectiveOn` specified, you see a Cost Category that's effective on the current date. If cost category is still effective, `EffectiveEnd` is omitted in the response. 

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

```
{
   "CostCategoryArn": "string",
   "EffectiveOn": "string"
}
```

## Request Parameters
<a name="API_DescribeCostCategoryDefinition_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.

 ** [CostCategoryArn](#API_DescribeCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-DescribeCostCategoryDefinition-request-CostCategoryArn"></a>
The unique identifier for your cost category.   
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+`   
Required: Yes

 ** [EffectiveOn](#API_DescribeCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-DescribeCostCategoryDefinition-request-EffectiveOn"></a>
The date when the cost category was effective.   
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$`   
Required: No

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

```
{
   "CostCategory": { 
      "CostCategoryArn": "string",
      "DefaultValue": "string",
      "EffectiveEnd": "string",
      "EffectiveStart": "string",
      "Name": "string",
      "ProcessingStatus": [ 
         { 
            "Component": "string",
            "Status": "string"
         }
      ],
      "Rules": [ 
         { 
            "InheritedValue": { 
               "DimensionKey": "string",
               "DimensionName": "string"
            },
            "Rule": { 
               "And": [ 
                  "Expression"
               ],
               "CostCategories": { 
                  "Key": "string",
                  "MatchOptions": [ "string" ],
                  "Values": [ "string" ]
               },
               "Dimensions": { 
                  "Key": "string",
                  "MatchOptions": [ "string" ],
                  "Values": [ "string" ]
               },
               "Not": "Expression",
               "Or": [ 
                  "Expression"
               ],
               "Tags": { 
                  "Key": "string",
                  "MatchOptions": [ "string" ],
                  "Values": [ "string" ]
               }
            },
            "Type": "string",
            "Value": "string"
         }
      ],
      "RuleVersion": "string",
      "SplitChargeRules": [ 
         { 
            "Method": "string",
            "Parameters": [ 
               { 
                  "Type": "string",
                  "Values": [ "string" ]
               }
            ],
            "Source": "string",
            "Targets": [ "string" ]
         }
      ]
   }
}
```

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

 ** [CostCategory](#API_DescribeCostCategoryDefinition_ResponseSyntax) **   <a name="awscostmanagement-DescribeCostCategoryDefinition-response-CostCategory"></a>
The structure of Cost Categories. This includes detailed metadata and the set of rules for the `CostCategory` object.  
Type: [CostCategory](API_CostCategory.md) object

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

## See Also
<a name="API_DescribeCostCategoryDefinition_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/ce-2017-10-25/DescribeCostCategoryDefinition) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/DescribeCostCategoryDefinition) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/DescribeCostCategoryDefinition) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/DescribeCostCategoryDefinition) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/DescribeCostCategoryDefinition) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/DescribeCostCategoryDefinition) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/DescribeCostCategoryDefinition) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/DescribeCostCategoryDefinition) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/DescribeCostCategoryDefinition) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/DescribeCostCategoryDefinition) 

# GetAnomalies
<a name="API_GetAnomalies"></a>

Retrieves all of the cost anomalies detected on your account during the time period that's specified by the `DateInterval` object. Anomalies are available for up to 90 days.

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

```
{
   "DateInterval": { 
      "EndDate": "string",
      "StartDate": "string"
   },
   "Feedback": "string",
   "MaxResults": number,
   "MonitorArn": "string",
   "NextPageToken": "string",
   "TotalImpact": { 
      "EndValue": number,
      "NumericOperator": "string",
      "StartValue": number
   }
}
```

## Request Parameters
<a name="API_GetAnomalies_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.

 ** [DateInterval](#API_GetAnomalies_RequestSyntax) **   <a name="awscostmanagement-GetAnomalies-request-DateInterval"></a>
Assigns the start and end dates for retrieving cost anomalies. The returned anomaly object will have an `AnomalyEndDate` in the specified time range.   
Type: [AnomalyDateInterval](API_AnomalyDateInterval.md) object  
Required: Yes

 ** [Feedback](#API_GetAnomalies_RequestSyntax) **   <a name="awscostmanagement-GetAnomalies-request-Feedback"></a>
Filters anomaly results by the feedback field on the anomaly object.   
Type: String  
Valid Values: `YES | NO | PLANNED_ACTIVITY`   
Required: No

 ** [MaxResults](#API_GetAnomalies_RequestSyntax) **   <a name="awscostmanagement-GetAnomalies-request-MaxResults"></a>
The number of entries a paginated response contains.   
Type: Integer  
Required: No

 ** [MonitorArn](#API_GetAnomalies_RequestSyntax) **   <a name="awscostmanagement-GetAnomalies-request-MonitorArn"></a>
Retrieves all of the cost anomalies detected for a specific cost anomaly monitor Amazon Resource Name (ARN).   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

 ** [NextPageToken](#API_GetAnomalies_RequestSyntax) **   <a name="awscostmanagement-GetAnomalies-request-NextPageToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [TotalImpact](#API_GetAnomalies_RequestSyntax) **   <a name="awscostmanagement-GetAnomalies-request-TotalImpact"></a>
Filters anomaly results by the total impact field on the anomaly object. For example, you can filter anomalies `GREATER_THAN 200.00` to retrieve anomalies, with an estimated dollar impact greater than 200.   
Type: [TotalImpactFilter](API_TotalImpactFilter.md) object  
Required: No

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

```
{
   "Anomalies": [ 
      { 
         "AnomalyEndDate": "string",
         "AnomalyId": "string",
         "AnomalyScore": { 
            "CurrentScore": number,
            "MaxScore": number
         },
         "AnomalyStartDate": "string",
         "DimensionValue": "string",
         "Feedback": "string",
         "Impact": { 
            "MaxImpact": number,
            "TotalActualSpend": number,
            "TotalExpectedSpend": number,
            "TotalImpact": number,
            "TotalImpactPercentage": number
         },
         "MonitorArn": "string",
         "RootCauses": [ 
            { 
               "Impact": { 
                  "Contribution": number
               },
               "LinkedAccount": "string",
               "LinkedAccountName": "string",
               "Region": "string",
               "Service": "string",
               "UsageType": "string"
            }
         ]
      }
   ],
   "NextPageToken": "string"
}
```

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

 ** [Anomalies](#API_GetAnomalies_ResponseSyntax) **   <a name="awscostmanagement-GetAnomalies-response-Anomalies"></a>
A list of cost anomalies.   
Type: Array of [Anomaly](API_Anomaly.md) objects

 ** [NextPageToken](#API_GetAnomalies_ResponseSyntax) **   <a name="awscostmanagement-GetAnomalies-response-NextPageToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

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

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

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## See Also
<a name="API_GetAnomalies_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/ce-2017-10-25/GetAnomalies) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetAnomalies) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetAnomalies) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetAnomalies) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetAnomalies) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetAnomalies) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetAnomalies) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetAnomalies) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetAnomalies) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetAnomalies) 

# GetAnomalyMonitors
<a name="API_GetAnomalyMonitors"></a>

Retrieves the cost anomaly monitor definitions for your account. You can filter using a list of cost anomaly monitor Amazon Resource Names (ARNs). 

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

```
{
   "MaxResults": number,
   "MonitorArnList": [ "string" ],
   "NextPageToken": "string"
}
```

## Request Parameters
<a name="API_GetAnomalyMonitors_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.

 ** [MaxResults](#API_GetAnomalyMonitors_RequestSyntax) **   <a name="awscostmanagement-GetAnomalyMonitors-request-MaxResults"></a>
The number of entries that a paginated response contains.   
Type: Integer  
Required: No

 ** [MonitorArnList](#API_GetAnomalyMonitors_RequestSyntax) **   <a name="awscostmanagement-GetAnomalyMonitors-request-MonitorArnList"></a>
A list of cost anomaly monitor ARNs.   
Type: Array of strings  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

 ** [NextPageToken](#API_GetAnomalyMonitors_RequestSyntax) **   <a name="awscostmanagement-GetAnomalyMonitors-request-NextPageToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

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

```
{
   "AnomalyMonitors": [ 
      { 
         "CreationDate": "string",
         "DimensionalValueCount": number,
         "LastEvaluatedDate": "string",
         "LastUpdatedDate": "string",
         "MonitorArn": "string",
         "MonitorDimension": "string",
         "MonitorName": "string",
         "MonitorSpecification": { 
            "And": [ 
               "Expression"
            ],
            "CostCategories": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            },
            "Dimensions": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            },
            "Not": "Expression",
            "Or": [ 
               "Expression"
            ],
            "Tags": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            }
         },
         "MonitorType": "string"
      }
   ],
   "NextPageToken": "string"
}
```

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

 ** [AnomalyMonitors](#API_GetAnomalyMonitors_ResponseSyntax) **   <a name="awscostmanagement-GetAnomalyMonitors-response-AnomalyMonitors"></a>
A list of cost anomaly monitors that includes the detailed metadata for each monitor.   
Type: Array of [AnomalyMonitor](API_AnomalyMonitor.md) objects

 ** [NextPageToken](#API_GetAnomalyMonitors_ResponseSyntax) **   <a name="awscostmanagement-GetAnomalyMonitors-response-NextPageToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

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

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

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** UnknownMonitorException **   
The cost anomaly monitor does not exist for the account.   
HTTP Status Code: 400

## See Also
<a name="API_GetAnomalyMonitors_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/ce-2017-10-25/GetAnomalyMonitors) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetAnomalyMonitors) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetAnomalyMonitors) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetAnomalyMonitors) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetAnomalyMonitors) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetAnomalyMonitors) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetAnomalyMonitors) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetAnomalyMonitors) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetAnomalyMonitors) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetAnomalyMonitors) 

# GetAnomalySubscriptions
<a name="API_GetAnomalySubscriptions"></a>

Retrieves the cost anomaly subscription objects for your account. You can filter using a list of cost anomaly monitor Amazon Resource Names (ARNs). 

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

```
{
   "MaxResults": number,
   "MonitorArn": "string",
   "NextPageToken": "string",
   "SubscriptionArnList": [ "string" ]
}
```

## Request Parameters
<a name="API_GetAnomalySubscriptions_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.

 ** [MaxResults](#API_GetAnomalySubscriptions_RequestSyntax) **   <a name="awscostmanagement-GetAnomalySubscriptions-request-MaxResults"></a>
The number of entries a paginated response contains.   
Type: Integer  
Required: No

 ** [MonitorArn](#API_GetAnomalySubscriptions_RequestSyntax) **   <a name="awscostmanagement-GetAnomalySubscriptions-request-MonitorArn"></a>
Cost anomaly monitor ARNs.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

 ** [NextPageToken](#API_GetAnomalySubscriptions_RequestSyntax) **   <a name="awscostmanagement-GetAnomalySubscriptions-request-NextPageToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [SubscriptionArnList](#API_GetAnomalySubscriptions_RequestSyntax) **   <a name="awscostmanagement-GetAnomalySubscriptions-request-SubscriptionArnList"></a>
A list of cost anomaly subscription ARNs.   
Type: Array of strings  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

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

```
{
   "AnomalySubscriptions": [ 
      { 
         "AccountId": "string",
         "Frequency": "string",
         "MonitorArnList": [ "string" ],
         "Subscribers": [ 
            { 
               "Address": "string",
               "Status": "string",
               "Type": "string"
            }
         ],
         "SubscriptionArn": "string",
         "SubscriptionName": "string",
         "Threshold": number,
         "ThresholdExpression": { 
            "And": [ 
               "Expression"
            ],
            "CostCategories": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            },
            "Dimensions": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            },
            "Not": "Expression",
            "Or": [ 
               "Expression"
            ],
            "Tags": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            }
         }
      }
   ],
   "NextPageToken": "string"
}
```

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

 ** [AnomalySubscriptions](#API_GetAnomalySubscriptions_ResponseSyntax) **   <a name="awscostmanagement-GetAnomalySubscriptions-response-AnomalySubscriptions"></a>
A list of cost anomaly subscriptions that includes the detailed metadata for each one.   
Type: Array of [AnomalySubscription](API_AnomalySubscription.md) objects

 ** [NextPageToken](#API_GetAnomalySubscriptions_ResponseSyntax) **   <a name="awscostmanagement-GetAnomalySubscriptions-response-NextPageToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

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

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

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** UnknownSubscriptionException **   
The cost anomaly subscription does not exist for the account.   
HTTP Status Code: 400

## See Also
<a name="API_GetAnomalySubscriptions_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/ce-2017-10-25/GetAnomalySubscriptions) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetAnomalySubscriptions) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetAnomalySubscriptions) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetAnomalySubscriptions) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetAnomalySubscriptions) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetAnomalySubscriptions) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetAnomalySubscriptions) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetAnomalySubscriptions) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetAnomalySubscriptions) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetAnomalySubscriptions) 

# GetApproximateUsageRecords
<a name="API_GetApproximateUsageRecords"></a>

Retrieves estimated usage records for hourly granularity or resource-level data at daily granularity.

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

```
{
   "ApproximationDimension": "string",
   "Granularity": "string",
   "Services": [ "string" ]
}
```

## Request Parameters
<a name="API_GetApproximateUsageRecords_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.

 ** [ApproximationDimension](#API_GetApproximateUsageRecords_RequestSyntax) **   <a name="awscostmanagement-GetApproximateUsageRecords-request-ApproximationDimension"></a>
The service to evaluate for the usage records. You can choose resource-level data at daily granularity, or hourly granularity with or without resource-level data.  
Type: String  
Valid Values: `SERVICE | RESOURCE`   
Required: Yes

 ** [Granularity](#API_GetApproximateUsageRecords_RequestSyntax) **   <a name="awscostmanagement-GetApproximateUsageRecords-request-Granularity"></a>
How granular you want the data to be. You can enable data at hourly or daily granularity.  
Type: String  
Valid Values: `DAILY | MONTHLY | HOURLY`   
Required: Yes

 ** [Services](#API_GetApproximateUsageRecords_RequestSyntax) **   <a name="awscostmanagement-GetApproximateUsageRecords-request-Services"></a>
The service metadata for the service or services you want to query. If not specified, all elements are returned.  
Type: Array of strings  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

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

```
{
   "LookbackPeriod": { 
      "End": "string",
      "Start": "string"
   },
   "Services": { 
      "string" : number 
   },
   "TotalRecords": number
}
```

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

 ** [LookbackPeriod](#API_GetApproximateUsageRecords_ResponseSyntax) **   <a name="awscostmanagement-GetApproximateUsageRecords-response-LookbackPeriod"></a>
The lookback period that's used for the estimation.  
Type: [DateInterval](API_DateInterval.md) object

 ** [Services](#API_GetApproximateUsageRecords_ResponseSyntax) **   <a name="awscostmanagement-GetApproximateUsageRecords-response-Services"></a>
The service metadata for the service or services in the response.  
Type: String to long map  
Key Length Constraints: Minimum length of 0. Maximum length of 1024.  
Key Pattern: `[\S\s]*`   
Valid Range: Minimum value of 0.

 ** [TotalRecords](#API_GetApproximateUsageRecords_ResponseSyntax) **   <a name="awscostmanagement-GetApproximateUsageRecords-response-TotalRecords"></a>
The total number of usage records for all services in the services list.  
Type: Long  
Valid Range: Minimum value of 0.

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

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

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## Examples
<a name="API_GetApproximateUsageRecords_Examples"></a>

### The following is a sample request of the GetApproximateUsageRecords operation.
<a name="API_GetApproximateUsageRecords_Example_1"></a>

This example illustrates one usage of GetApproximateUsageRecords.

#### Sample Request
<a name="API_GetApproximateUsageRecords_Example_1_Request"></a>

```
{
    "ApproximationDimension":"SERVICE",
    "Granularity": "HOURLY"
 }
```

### The following is a sample response of the GetApproximateUsageRecords operation.
<a name="API_GetApproximateUsageRecords_Example_2"></a>

This example illustrates one usage of GetApproximateUsageRecords.

#### Sample Response
<a name="API_GetApproximateUsageRecords_Example_2_Response"></a>

```
{
    "LookbackPeriod": {
        "End": "2023-12-31",
        "Start": "2023-12-01"
    },
    "Services": {
        "Amazon Virtual Private Cloud": 336,
        "Amazon Relational Database Service": 1344,
        "AmazonCloudWatch": 350,
        "Tax": 0,
        "Amazon DynamoDB": 672
    },
    "TotalRecords": 2702
}
```

## See Also
<a name="API_GetApproximateUsageRecords_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/ce-2017-10-25/GetApproximateUsageRecords) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetApproximateUsageRecords) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetApproximateUsageRecords) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetApproximateUsageRecords) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetApproximateUsageRecords) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetApproximateUsageRecords) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetApproximateUsageRecords) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetApproximateUsageRecords) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetApproximateUsageRecords) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetApproximateUsageRecords) 

# GetCommitmentPurchaseAnalysis
<a name="API_GetCommitmentPurchaseAnalysis"></a>

Retrieves a commitment purchase analysis result based on the `AnalysisId`.

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

```
{
   "AnalysisId": "string"
}
```

## Request Parameters
<a name="API_GetCommitmentPurchaseAnalysis_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.

 ** [AnalysisId](#API_GetCommitmentPurchaseAnalysis_RequestSyntax) **   <a name="awscostmanagement-GetCommitmentPurchaseAnalysis-request-AnalysisId"></a>
The analysis ID that's associated with the commitment purchase analysis.  
Type: String  
Length Constraints: Fixed length of 36.  
Pattern: `^[\S\s]{8}-[\S\s]{4}-[\S\s]{4}-[\S\s]{4}-[\S\s]{12}$`   
Required: Yes

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

```
{
   "AnalysisCompletionTime": "string",
   "AnalysisDetails": { 
      "SavingsPlansPurchaseAnalysisDetails": { 
         "AdditionalMetadata": "string",
         "CurrencyCode": "string",
         "CurrentAverageCoverage": "string",
         "CurrentAverageHourlyOnDemandSpend": "string",
         "CurrentMaximumHourlyOnDemandSpend": "string",
         "CurrentMinimumHourlyOnDemandSpend": "string",
         "CurrentOnDemandSpend": "string",
         "EstimatedAverageCoverage": "string",
         "EstimatedAverageUtilization": "string",
         "EstimatedCommitmentCost": "string",
         "EstimatedMonthlySavingsAmount": "string",
         "EstimatedOnDemandCost": "string",
         "EstimatedOnDemandCostWithCurrentCommitment": "string",
         "EstimatedROI": "string",
         "EstimatedSavingsAmount": "string",
         "EstimatedSavingsPercentage": "string",
         "ExistingHourlyCommitment": "string",
         "HourlyCommitmentToPurchase": "string",
         "LatestUsageTimestamp": "string",
         "LookbackPeriodInHours": "string",
         "MetricsOverLookbackPeriod": [ 
            { 
               "CurrentCoverage": "string",
               "EstimatedCoverage": "string",
               "EstimatedNewCommitmentUtilization": "string",
               "EstimatedOnDemandCost": "string",
               "StartTime": "string"
            }
         ],
         "UpfrontCost": "string"
      }
   },
   "AnalysisId": "string",
   "AnalysisStartedTime": "string",
   "AnalysisStatus": "string",
   "CommitmentPurchaseAnalysisConfiguration": { 
      "SavingsPlansPurchaseAnalysisConfiguration": { 
         "AccountId": "string",
         "AccountScope": "string",
         "AnalysisType": "string",
         "LookBackTimePeriod": { 
            "End": "string",
            "Start": "string"
         },
         "SavingsPlansToAdd": [ 
            { 
               "InstanceFamily": "string",
               "OfferingId": "string",
               "PaymentOption": "string",
               "Region": "string",
               "SavingsPlansCommitment": number,
               "SavingsPlansType": "string",
               "TermInYears": "string"
            }
         ],
         "SavingsPlansToExclude": [ "string" ]
      }
   },
   "ErrorCode": "string",
   "EstimatedCompletionTime": "string"
}
```

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

 ** [AnalysisCompletionTime](#API_GetCommitmentPurchaseAnalysis_ResponseSyntax) **   <a name="awscostmanagement-GetCommitmentPurchaseAnalysis-response-AnalysisCompletionTime"></a>
The completion time of the analysis.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$` 

 ** [AnalysisDetails](#API_GetCommitmentPurchaseAnalysis_ResponseSyntax) **   <a name="awscostmanagement-GetCommitmentPurchaseAnalysis-response-AnalysisDetails"></a>
Details about the analysis.  
Type: [AnalysisDetails](API_AnalysisDetails.md) object

 ** [AnalysisId](#API_GetCommitmentPurchaseAnalysis_ResponseSyntax) **   <a name="awscostmanagement-GetCommitmentPurchaseAnalysis-response-AnalysisId"></a>
The analysis ID that's associated with the commitment purchase analysis.  
Type: String  
Length Constraints: Fixed length of 36.  
Pattern: `^[\S\s]{8}-[\S\s]{4}-[\S\s]{4}-[\S\s]{4}-[\S\s]{12}$` 

 ** [AnalysisStartedTime](#API_GetCommitmentPurchaseAnalysis_ResponseSyntax) **   <a name="awscostmanagement-GetCommitmentPurchaseAnalysis-response-AnalysisStartedTime"></a>
The start time of the analysis.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$` 

 ** [AnalysisStatus](#API_GetCommitmentPurchaseAnalysis_ResponseSyntax) **   <a name="awscostmanagement-GetCommitmentPurchaseAnalysis-response-AnalysisStatus"></a>
The status of the analysis.  
Type: String  
Valid Values: `SUCCEEDED | PROCESSING | FAILED` 

 ** [CommitmentPurchaseAnalysisConfiguration](#API_GetCommitmentPurchaseAnalysis_ResponseSyntax) **   <a name="awscostmanagement-GetCommitmentPurchaseAnalysis-response-CommitmentPurchaseAnalysisConfiguration"></a>
The configuration for the commitment purchase analysis.  
Type: [CommitmentPurchaseAnalysisConfiguration](API_CommitmentPurchaseAnalysisConfiguration.md) object

 ** [ErrorCode](#API_GetCommitmentPurchaseAnalysis_ResponseSyntax) **   <a name="awscostmanagement-GetCommitmentPurchaseAnalysis-response-ErrorCode"></a>
The error code used for the analysis.  
Type: String  
Valid Values: `NO_USAGE_FOUND | INTERNAL_FAILURE | INVALID_SAVINGS_PLANS_TO_ADD | INVALID_SAVINGS_PLANS_TO_EXCLUDE | INVALID_ACCOUNT_ID` 

 ** [EstimatedCompletionTime](#API_GetCommitmentPurchaseAnalysis_ResponseSyntax) **   <a name="awscostmanagement-GetCommitmentPurchaseAnalysis-response-EstimatedCompletionTime"></a>
The estimated time for when the analysis will complete.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$` 

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

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

 ** AnalysisNotFoundException **   
The requested analysis can't be found.  
HTTP Status Code: 400

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## See Also
<a name="API_GetCommitmentPurchaseAnalysis_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/ce-2017-10-25/GetCommitmentPurchaseAnalysis) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetCommitmentPurchaseAnalysis) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetCommitmentPurchaseAnalysis) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetCommitmentPurchaseAnalysis) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetCommitmentPurchaseAnalysis) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetCommitmentPurchaseAnalysis) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetCommitmentPurchaseAnalysis) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetCommitmentPurchaseAnalysis) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetCommitmentPurchaseAnalysis) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetCommitmentPurchaseAnalysis) 

# GetCostAndUsage
<a name="API_GetCostAndUsage"></a>

Retrieves cost and usage metrics for your account. You can specify which cost and usage-related metric that you want the request to return. For example, you can specify `BlendedCosts` or `UsageQuantity`. You can also filter and group your data by various dimensions, such as `SERVICE` or `AZ`, in a specific time range. For a complete list of valid dimensions, see the [GetDimensionValues](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_GetDimensionValues.html) operation. Management account in an organization in AWS Organizations have access to all member accounts.

For information about filter limitations, see [Quotas and restrictions](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-limits.html) in the *Billing and Cost Management User Guide*.

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

```
{
   "BillingViewArn": "string",
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "Granularity": "string",
   "GroupBy": [ 
      { 
         "Key": "string",
         "Type": "string"
      }
   ],
   "Metrics": [ "string" ],
   "NextPageToken": "string",
   "TimePeriod": { 
      "End": "string",
      "Start": "string"
   }
}
```

## Request Parameters
<a name="API_GetCostAndUsage_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.

 ** [BillingViewArn](#API_GetCostAndUsage_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsage-request-BillingViewArn"></a>
The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to AWS Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[-a-zA-Z0-9/:_+=.-@]{1,43}$`   
Required: No

 ** [Filter](#API_GetCostAndUsage_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsage-request-Filter"></a>
Filters AWS costs by different dimensions. For example, you can specify `SERVICE` and `LINKED_ACCOUNT` and get the costs that are associated with that account's usage of that service. You can nest `Expression` objects to define any combination of dimension filters. For more information, see [Expression](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html).   
Valid values for `MatchOptions` for `Dimensions` are `EQUALS` and `CASE_SENSITIVE`.  
Valid values for `MatchOptions` for `CostCategories` and `Tags` are `EQUALS`, `ABSENT`, and `CASE_SENSITIVE`. Default values are `EQUALS` and `CASE_SENSITIVE`.  
Type: [Expression](API_Expression.md) object  
Required: No

 ** [Granularity](#API_GetCostAndUsage_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsage-request-Granularity"></a>
Sets the AWS cost granularity to `MONTHLY` or `DAILY`, or `HOURLY`. If `Granularity` isn't set, the response object doesn't include the `Granularity`, either `MONTHLY` or `DAILY`, or `HOURLY`.   
Type: String  
Valid Values: `DAILY | MONTHLY | HOURLY`   
Required: Yes

 ** [GroupBy](#API_GetCostAndUsage_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsage-request-GroupBy"></a>
You can group AWS costs using up to two different groups, either dimensions, tag keys, cost categories, or any two group by types.  
Valid values for the `DIMENSION` type are `AZ`, `INSTANCE_TYPE`, `LEGAL_ENTITY_NAME`, `INVOICING_ENTITY`, `LINKED_ACCOUNT`, `OPERATION`, `PLATFORM`, `PURCHASE_TYPE`, `SERVICE`, `TENANCY`, `RECORD_TYPE`, and `USAGE_TYPE`.  
When you group by the `TAG` type and include a valid tag key, you get all tag values, including empty strings.  
Type: Array of [GroupDefinition](API_GroupDefinition.md) objects  
Required: No

 ** [Metrics](#API_GetCostAndUsage_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsage-request-Metrics"></a>
Which metrics are returned in the query. For more information about blended and unblended rates, see [Why does the "blended" annotation appear on some line items in my bill?](http://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/).   
Valid values are `AmortizedCost`, `BlendedCost`, `NetAmortizedCost`, `NetUnblendedCost`, `NormalizedUsageAmount`, `UnblendedCost`, and `UsageQuantity`.   
If you return the `UsageQuantity` metric, the service aggregates all usage numbers without taking into account the units. For example, if you aggregate `usageQuantity` across all of Amazon EC2, the results aren't meaningful because Amazon EC2 compute hours and data transfer are measured in different units (for example, hours and GB). To get more meaningful `UsageQuantity` metrics, filter by `UsageType` or `UsageTypeGroups`. 
 `Metrics` is required for `GetCostAndUsage` requests.  
Type: Array of strings  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: Yes

 ** [NextPageToken](#API_GetCostAndUsage_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsage-request-NextPageToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [TimePeriod](#API_GetCostAndUsage_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsage-request-TimePeriod"></a>
Sets the start date and end date for retrieving AWS costs. The start date is inclusive, but the end date is exclusive. For example, if `start` is `2017-01-01` and `end` is `2017-05-01`, then the cost and usage data is retrieved from `2017-01-01` up to and including `2017-04-30` but not including `2017-05-01`.  
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

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

```
{
   "DimensionValueAttributes": [ 
      { 
         "Attributes": { 
            "string" : "string" 
         },
         "Value": "string"
      }
   ],
   "GroupDefinitions": [ 
      { 
         "Key": "string",
         "Type": "string"
      }
   ],
   "NextPageToken": "string",
   "ResultsByTime": [ 
      { 
         "Estimated": boolean,
         "Groups": [ 
            { 
               "Keys": [ "string" ],
               "Metrics": { 
                  "string" : { 
                     "Amount": "string",
                     "Unit": "string"
                  }
               }
            }
         ],
         "TimePeriod": { 
            "End": "string",
            "Start": "string"
         },
         "Total": { 
            "string" : { 
               "Amount": "string",
               "Unit": "string"
            }
         }
      }
   ]
}
```

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

 ** [DimensionValueAttributes](#API_GetCostAndUsage_ResponseSyntax) **   <a name="awscostmanagement-GetCostAndUsage-response-DimensionValueAttributes"></a>
The attributes that apply to a specific dimension value. For example, if the value is a linked account, the attribute is that account name.  
Type: Array of [DimensionValuesWithAttributes](API_DimensionValuesWithAttributes.md) objects

 ** [GroupDefinitions](#API_GetCostAndUsage_ResponseSyntax) **   <a name="awscostmanagement-GetCostAndUsage-response-GroupDefinitions"></a>
The groups that are specified by the `Filter` or `GroupBy` parameters in the request.  
Type: Array of [GroupDefinition](API_GroupDefinition.md) objects

 ** [NextPageToken](#API_GetCostAndUsage_ResponseSyntax) **   <a name="awscostmanagement-GetCostAndUsage-response-NextPageToken"></a>
The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

 ** [ResultsByTime](#API_GetCostAndUsage_ResponseSyntax) **   <a name="awscostmanagement-GetCostAndUsage-response-ResultsByTime"></a>
The time period that's covered by the results in the response.  
Type: Array of [ResultByTime](API_ResultByTime.md) objects

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

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

 ** BillExpirationException **   
The requested report expired. Update the date interval and try again.  
HTTP Status Code: 400

 ** BillingViewHealthStatusException **   
 The billing view status must be `HEALTHY` to perform this action. Try again when the status is `HEALTHY`.   
HTTP Status Code: 400

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** RequestChangedException **   
Your request parameters changed between pages. Try again with the old parameters or without a pagination token.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

## Examples
<a name="API_GetCostAndUsage_Examples"></a>

### Example
<a name="API_GetCostAndUsage_Example_1"></a>

The following is a sample request and response of the `GetCostAndUsage` operation that you can use to retrieve your Amazon S3 costs. For more complex examples, such as multi-level groupings, see [Expression](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html).

#### Sample Request
<a name="API_GetCostAndUsage_Example_1_Request"></a>

```
POST / HTTP/1.1
Host: ce.us-east-1.amazonaws.com
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid,Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: AWSInsightsIndexService.GetCostAndUsage
{
  "TimePeriod": {
    "Start":"2017-09-01",
    "End": "2017-10-01"
  },
  "Granularity": "MONTHLY",
  "Filter": {      
    "Dimensions": {
      "Key": "SERVICE",
      "Values": [
        "Amazon Simple Storage Service"
      ]
    }
  },
  "GroupBy":[
    {
      "Type":"DIMENSION",
      "Key":"SERVICE"
    },
    {
      "Type":"TAG",
      "Key":"Environment"
    }
  ],
   "Metrics":["BlendedCost", "UnblendedCost", "UsageQuantity"]
}
```

#### Sample Response
<a name="API_GetCostAndUsage_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "GroupDefinitions": [
    {
      "Key": "SERVICE",
      "Type": "DIMENSION"
    },
    {
      "Key": "Environment",
      "Type": "TAG"
    }
  ],
  "ResultsByTime": [
    {
      "Estimated": false,
      "Groups": [
        {
          "Keys": [
            "Amazon Simple Storage Service",
            "Environment$Prod"
          ],
          "Metrics": {
            "BlendedCost": {
              "Amount": "39.1603300457",
              "Unit": "USD"
            },
            "UnblendedCost": {
              "Amount": "39.1603300457",
              "Unit": "USD"
            },
            "UsageQuantity": {
              "Amount": "173842.5440074444",
              "Unit": "N/A"
            }
          }
        },
        {
          "Keys": [
            "Amazon Simple Storage Service",
            "Environment$Test"
          ],
          "Metrics": {
            "BlendedCost": {
              "Amount": "0.1337464807",
              "Unit": "USD"
            },
            "UnblendedCost": {
             "Amount": "0.1337464807",
              "Unit": "USD"
            },
            "UsageQuantity": {
              "Amount": "15992.0786663399",
              "Unit": "N/A"
            }
          }
        }
      ],
      "TimePeriod": {
        "End": "2017-10-01",
        "Start": "2017-09-01"
      },
      "Total": {}
    }
  ]
}
```

## See Also
<a name="API_GetCostAndUsage_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/ce-2017-10-25/GetCostAndUsage) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetCostAndUsage) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetCostAndUsage) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetCostAndUsage) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetCostAndUsage) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetCostAndUsage) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetCostAndUsage) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetCostAndUsage) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetCostAndUsage) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetCostAndUsage) 

# GetCostAndUsageComparisons
<a name="API_GetCostAndUsageComparisons"></a>

Retrieves cost and usage comparisons for your account between two periods within the last 13 months. If you have enabled multi-year data at monthly granularity, you can go back up to 38 months.

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

```
{
   "BaselineTimePeriod": { 
      "End": "string",
      "Start": "string"
   },
   "BillingViewArn": "string",
   "ComparisonTimePeriod": { 
      "End": "string",
      "Start": "string"
   },
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "GroupBy": [ 
      { 
         "Key": "string",
         "Type": "string"
      }
   ],
   "MaxResults": number,
   "MetricForComparison": "string",
   "NextPageToken": "string"
}
```

## Request Parameters
<a name="API_GetCostAndUsageComparisons_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.

 ** [BaselineTimePeriod](#API_GetCostAndUsageComparisons_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageComparisons-request-BaselineTimePeriod"></a>
The reference time period for comparison. This time period serves as the baseline against which other cost and usage data will be compared. The interval must start and end on the first day of a month, with a duration of exactly one month.  
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

 ** [BillingViewArn](#API_GetCostAndUsageComparisons_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageComparisons-request-BillingViewArn"></a>
The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to AWS Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[-a-zA-Z0-9/:_+=.-@]{1,43}$`   
Required: No

 ** [ComparisonTimePeriod](#API_GetCostAndUsageComparisons_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageComparisons-request-ComparisonTimePeriod"></a>
The comparison time period for analysis. This time period's cost and usage data will be compared against the baseline time period. The interval must start and end on the first day of a month, with a duration of exactly one month.  
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

 ** [Filter](#API_GetCostAndUsageComparisons_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageComparisons-request-Filter"></a>
Use `Expression` to filter in various Cost Explorer APIs.  
Not all `Expression` types are supported in each API. Refer to the documentation for each specific API to see what is supported.  
There are two patterns:  
+ Simple dimension values.
  + There are three types of simple dimension values: `CostCategories`, `Tags`, and `Dimensions`.
    + Specify the `CostCategories` field to define a filter that acts on Cost Categories.
    + Specify the `Tags` field to define a filter that acts on Cost Allocation Tags.
    + Specify the `Dimensions` field to define a filter that acts on the [https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html).
  + For each filter type, you can set the dimension name and values for the filters that you plan to use.
    + For example, you can filter for `REGION==us-east-1 OR REGION==us-west-1`. For `GetRightsizingRecommendation`, the Region is a full name (for example, `REGION==US East (N. Virginia)`.
    + The corresponding `Expression` for this example is as follows: `{ "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } }` 
    + As shown in the previous example, lists of dimension values are combined with `OR` when applying the filter.
  + You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
    + For example, you can filter for linked account names that start with "a".
    + The corresponding `Expression` for this example is as follows: `{ "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], "Values": [ "a" ] } }` 
+ Compound `Expression` types with logical operations.
  + You can use multiple `Expression` types and the logical operators `AND/OR/NOT` to create a list of one or more `Expression` objects. By doing this, you can filter by more advanced options.
  + For example, you can filter by `((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)`.
  + The corresponding `Expression` for this example is as follows: `{ "And": [ {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } ` 
**Note**  
Because each `Expression` can have only one operator, the service returns an error if more than one is specified. The following example shows an `Expression` object that creates an error: ` { "And": [ ... ], "Dimensions": { "Key": "USAGE_TYPE", "Values": [ "DataTransfer" ] } } `   
The following is an example of the corresponding error message: `"Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"` 
For the `GetRightsizingRecommendation` action, a combination of OR and NOT isn't supported. OR isn't supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited to `LINKED_ACCOUNT`, `REGION`, or `RIGHTSIZING_TYPE`.  
For the `GetReservationPurchaseRecommendation` action, only NOT is supported. AND and OR aren't supported. Dimensions are limited to `LINKED_ACCOUNT`.
Type: [Expression](API_Expression.md) object  
Required: No

 ** [GroupBy](#API_GetCostAndUsageComparisons_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageComparisons-request-GroupBy"></a>
You can group results using the attributes `DIMENSION`, `TAG`, and `COST_CATEGORY`.   
Type: Array of [GroupDefinition](API_GroupDefinition.md) objects  
Required: No

 ** [MaxResults](#API_GetCostAndUsageComparisons_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageComparisons-request-MaxResults"></a>
The maximum number of results that are returned for the request.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 2000.  
Required: No

 ** [MetricForComparison](#API_GetCostAndUsageComparisons_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageComparisons-request-MetricForComparison"></a>
The cost and usage metric to compare. Valid values are `AmortizedCost`, `BlendedCost`, `NetAmortizedCost`, `NetUnblendedCost`, `NormalizedUsageAmount`, `UnblendedCost`, and `UsageQuantity`.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: Yes

 ** [NextPageToken](#API_GetCostAndUsageComparisons_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageComparisons-request-NextPageToken"></a>
The token to retrieve the next set of paginated results.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

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

```
{
   "CostAndUsageComparisons": [ 
      { 
         "CostAndUsageSelector": { 
            "And": [ 
               "Expression"
            ],
            "CostCategories": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            },
            "Dimensions": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            },
            "Not": "Expression",
            "Or": [ 
               "Expression"
            ],
            "Tags": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            }
         },
         "Metrics": { 
            "string" : { 
               "BaselineTimePeriodAmount": "string",
               "ComparisonTimePeriodAmount": "string",
               "Difference": "string",
               "Unit": "string"
            }
         }
      }
   ],
   "NextPageToken": "string",
   "TotalCostAndUsage": { 
      "string" : { 
         "BaselineTimePeriodAmount": "string",
         "ComparisonTimePeriodAmount": "string",
         "Difference": "string",
         "Unit": "string"
      }
   }
}
```

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

 ** [CostAndUsageComparisons](#API_GetCostAndUsageComparisons_ResponseSyntax) **   <a name="awscostmanagement-GetCostAndUsageComparisons-response-CostAndUsageComparisons"></a>
An array of comparison results showing cost and usage metrics between `BaselineTimePeriod` and `ComparisonTimePeriod`.  
Type: Array of [CostAndUsageComparison](API_CostAndUsageComparison.md) objects

 ** [NextPageToken](#API_GetCostAndUsageComparisons_ResponseSyntax) **   <a name="awscostmanagement-GetCostAndUsageComparisons-response-NextPageToken"></a>
The token to retrieve the next set of paginated results.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

 ** [TotalCostAndUsage](#API_GetCostAndUsageComparisons_ResponseSyntax) **   <a name="awscostmanagement-GetCostAndUsageComparisons-response-TotalCostAndUsage"></a>
A summary of the total cost and usage, comparing amounts between `BaselineTimePeriod` and `ComparisonTimePeriod` and their differences. This total represents the aggregate total across all paginated results, if the response spans multiple pages.  
Type: String to [ComparisonMetricValue](API_ComparisonMetricValue.md) object map  
Key Length Constraints: Minimum length of 0. Maximum length of 1024.  
Key Pattern: `[\S\s]*` 

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

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

 ** BillingViewHealthStatusException **   
 The billing view status must be `HEALTHY` to perform this action. Try again when the status is `HEALTHY`.   
HTTP Status Code: 400

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

## See Also
<a name="API_GetCostAndUsageComparisons_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/ce-2017-10-25/GetCostAndUsageComparisons) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetCostAndUsageComparisons) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetCostAndUsageComparisons) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetCostAndUsageComparisons) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetCostAndUsageComparisons) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetCostAndUsageComparisons) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetCostAndUsageComparisons) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetCostAndUsageComparisons) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetCostAndUsageComparisons) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetCostAndUsageComparisons) 

# GetCostAndUsageWithResources
<a name="API_GetCostAndUsageWithResources"></a>

Retrieves cost and usage metrics with resources for your account. You can specify which cost and usage-related metric, such as `BlendedCosts` or `UsageQuantity`, that you want the request to return. You can also filter and group your data by various dimensions, such as `SERVICE` or `AZ`, in a specific time range. For a complete list of valid dimensions, see the [GetDimensionValues](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_GetDimensionValues.html) operation. Management account in an organization in AWS Organizations have access to all member accounts.

Hourly granularity is only available for EC2-Instances (Elastic Compute Cloud) resource-level data. All other resource-level data is available at daily granularity.

**Note**  
This is an opt-in only feature. You can enable this feature from the Cost Explorer Settings page. For information about how to access the Settings page, see [Controlling Access for Cost Explorer](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/ce-access.html) in the * AWS Billing and Cost Management User Guide*.

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

```
{
   "BillingViewArn": "string",
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "Granularity": "string",
   "GroupBy": [ 
      { 
         "Key": "string",
         "Type": "string"
      }
   ],
   "Metrics": [ "string" ],
   "NextPageToken": "string",
   "TimePeriod": { 
      "End": "string",
      "Start": "string"
   }
}
```

## Request Parameters
<a name="API_GetCostAndUsageWithResources_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.

 ** [BillingViewArn](#API_GetCostAndUsageWithResources_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageWithResources-request-BillingViewArn"></a>
The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to AWS Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[-a-zA-Z0-9/:_+=.-@]{1,43}$`   
Required: No

 ** [Filter](#API_GetCostAndUsageWithResources_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageWithResources-request-Filter"></a>
Filters Amazon Web Services costs by different dimensions. For example, you can specify `SERVICE` and `LINKED_ACCOUNT` and get the costs that are associated with that account's usage of that service. You can nest `Expression` objects to define any combination of dimension filters. For more information, see [Expression](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html).   
The `GetCostAndUsageWithResources` operation requires that you either group by or filter by a `ResourceId`. It requires the [Expression](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html) `"SERVICE = Amazon Elastic Compute Cloud - Compute"` in the filter.  
Valid values for `MatchOptions` for `Dimensions` are `EQUALS` and `CASE_SENSITIVE`.  
Valid values for `MatchOptions` for `CostCategories` and `Tags` are `EQUALS`, `ABSENT`, and `CASE_SENSITIVE`. Default values are `EQUALS` and `CASE_SENSITIVE`.  
Type: [Expression](API_Expression.md) object  
Required: Yes

 ** [Granularity](#API_GetCostAndUsageWithResources_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageWithResources-request-Granularity"></a>
Sets the AWS cost granularity to `MONTHLY`, `DAILY`, or `HOURLY`. If `Granularity` isn't set, the response object doesn't include the `Granularity`, `MONTHLY`, `DAILY`, or `HOURLY`.   
Type: String  
Valid Values: `DAILY | MONTHLY | HOURLY`   
Required: Yes

 ** [GroupBy](#API_GetCostAndUsageWithResources_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageWithResources-request-GroupBy"></a>
You can group Amazon Web Services costs using up to two different groups: `DIMENSION`, `TAG`, `COST_CATEGORY`.  
Type: Array of [GroupDefinition](API_GroupDefinition.md) objects  
Required: No

 ** [Metrics](#API_GetCostAndUsageWithResources_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageWithResources-request-Metrics"></a>
Which metrics are returned in the query. For more information about blended and unblended rates, see [Why does the "blended" annotation appear on some line items in my bill?](http://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/).   
Valid values are `AmortizedCost`, `BlendedCost`, `NetAmortizedCost`, `NetUnblendedCost`, `NormalizedUsageAmount`, `UnblendedCost`, and `UsageQuantity`.   
If you return the `UsageQuantity` metric, the service aggregates all usage numbers without taking the units into account. For example, if you aggregate `usageQuantity` across all of Amazon EC2, the results aren't meaningful because Amazon EC2 compute hours and data transfer are measured in different units (for example, hour or GB). To get more meaningful `UsageQuantity` metrics, filter by `UsageType` or `UsageTypeGroups`. 
 `Metrics` is required for `GetCostAndUsageWithResources` requests.  
Type: Array of strings  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

 ** [NextPageToken](#API_GetCostAndUsageWithResources_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageWithResources-request-NextPageToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [TimePeriod](#API_GetCostAndUsageWithResources_RequestSyntax) **   <a name="awscostmanagement-GetCostAndUsageWithResources-request-TimePeriod"></a>
Sets the start and end dates for retrieving Amazon Web Services costs. The range must be within the last 14 days (the start date cannot be earlier than 14 days ago). The start date is inclusive, but the end date is exclusive. For example, if `start` is `2017-01-01` and `end` is `2017-05-01`, then the cost and usage data is retrieved from `2017-01-01` up to and including `2017-04-30` but not including `2017-05-01`.  
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

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

```
{
   "DimensionValueAttributes": [ 
      { 
         "Attributes": { 
            "string" : "string" 
         },
         "Value": "string"
      }
   ],
   "GroupDefinitions": [ 
      { 
         "Key": "string",
         "Type": "string"
      }
   ],
   "NextPageToken": "string",
   "ResultsByTime": [ 
      { 
         "Estimated": boolean,
         "Groups": [ 
            { 
               "Keys": [ "string" ],
               "Metrics": { 
                  "string" : { 
                     "Amount": "string",
                     "Unit": "string"
                  }
               }
            }
         ],
         "TimePeriod": { 
            "End": "string",
            "Start": "string"
         },
         "Total": { 
            "string" : { 
               "Amount": "string",
               "Unit": "string"
            }
         }
      }
   ]
}
```

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

 ** [DimensionValueAttributes](#API_GetCostAndUsageWithResources_ResponseSyntax) **   <a name="awscostmanagement-GetCostAndUsageWithResources-response-DimensionValueAttributes"></a>
The attributes that apply to a specific dimension value. For example, if the value is a linked account, the attribute is that account name.  
Type: Array of [DimensionValuesWithAttributes](API_DimensionValuesWithAttributes.md) objects

 ** [GroupDefinitions](#API_GetCostAndUsageWithResources_ResponseSyntax) **   <a name="awscostmanagement-GetCostAndUsageWithResources-response-GroupDefinitions"></a>
The groups that are specified by the `Filter` or `GroupBy` parameters in the request.  
Type: Array of [GroupDefinition](API_GroupDefinition.md) objects

 ** [NextPageToken](#API_GetCostAndUsageWithResources_ResponseSyntax) **   <a name="awscostmanagement-GetCostAndUsageWithResources-response-NextPageToken"></a>
The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

 ** [ResultsByTime](#API_GetCostAndUsageWithResources_ResponseSyntax) **   <a name="awscostmanagement-GetCostAndUsageWithResources-response-ResultsByTime"></a>
The time period that's covered by the results in the response.  
Type: Array of [ResultByTime](API_ResultByTime.md) objects

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

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

 ** BillExpirationException **   
The requested report expired. Update the date interval and try again.  
HTTP Status Code: 400

 ** BillingViewHealthStatusException **   
 The billing view status must be `HEALTHY` to perform this action. Try again when the status is `HEALTHY`.   
HTTP Status Code: 400

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** RequestChangedException **   
Your request parameters changed between pages. Try again with the old parameters or without a pagination token.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

## Examples
<a name="API_GetCostAndUsageWithResources_Examples"></a>

### Example
<a name="API_GetCostAndUsageWithResources_Example_1"></a>

The following is a sample request and response of the `GetCostAndUsageWithResources` operation that enables you to retrieve your Amazon EC2 costs. For more complex examples, such as multi-level groupings, see [Expression](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html).

#### Sample Request
<a name="API_GetCostAndUsageWithResources_Example_1_Request"></a>

```
POST / HTTP/1.1
Host: ce.us-east-1.amazonaws.com
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid,Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: AWSInsightsIndexService.GetCostAndUsageWithResources
{
  "TimePeriod": {
    "Start":"2018-11-19",
    "End": "2018-11-20"
  },
  "Granularity": "DAILY",
  "Filter": {      
    "Dimensions": {
      "Key": "SERVICE",
      "Values": [
        "Amazon Elastic Compute Cloud - Compute"
      ]
    }
  },
  "GroupBy":[
    {
      "Type":"DIMENSION",
      "Key":"RESOURCE_ID"
    }
  ],
   "Metrics":["BlendedCost", "UnblendedCost", "UsageQuantity"]
}
```

#### Sample Response
<a name="API_GetCostAndUsageWithResources_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "GroupDefinitions": [
    {
      "Key": "RESOURCE_ID",
      "Type": "DIMENSION"
    }
  ],
  "ResultsByTime": [
    {
      "Estimated": true,
      "Groups": [
        {
          "Keys": [
            "i-00cb32c5f3163"
          ],
          "Metrics": {
            "BlendedCost": {
              "Amount": "0.0927335232",
              "Unit": "USD"
            },
            "UnblendedCost": {
              "Amount": "0.1276",
              "Unit": "USD"
            },
            "UsageQuantity": {
              "Amount": "24.0010557602",
              "Unit": "N/A"
            }
          }
        },
        {
          "Keys": [
            "i-04a0089019f41"
          ],
          "Metrics": {
            "BlendedCost": {
              "Amount": "0.1656",
              "Unit": "USD"
            },
            "UnblendedCost": {
              "Amount": "0.1656",
              "Unit": "USD"
            },
            "UsageQuantity": {
              "Amount": "24.0018044403",
              "Unit": "N/A"
            }
          }
        },
        {
          "Keys": [
            "i-03b49bda9fdef"
          ],
          "Metrics": {
            "BlendedCost": {
              "Amount": "0.0927335232",
              "Unit": "USD"
            },
            "UnblendedCost": {
              "Amount": "0.0116",
              "Unit": "USD"
            },
            "UsageQuantity": {
              "Amount": "24.0009345564",
              "Unit": "N/A"
            }
          }
        },
        {
          "Keys": [
            "i-0e56e09d11711"
          ],
          "Metrics": {
            "BlendedCost": {
              "Amount": "0.0927335232",
              "Unit": "USD"
            },
            "UnblendedCost": {
              "Amount": "0.1392",
              "Unit": "USD"
            },
            "UsageQuantity": {
              "Amount": "24.0011066563",
              "Unit": "N/A"
            }
          }
        }
      ],
      "TimePeriod": {
        "End": "2018-11-20T00:00:00Z",
        "Start": "2018-11-19T00:00:00Z"
      },
      "Total": {}
    }
  ]
}
```

## See Also
<a name="API_GetCostAndUsageWithResources_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/ce-2017-10-25/GetCostAndUsageWithResources) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetCostAndUsageWithResources) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetCostAndUsageWithResources) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetCostAndUsageWithResources) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetCostAndUsageWithResources) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetCostAndUsageWithResources) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetCostAndUsageWithResources) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetCostAndUsageWithResources) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetCostAndUsageWithResources) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetCostAndUsageWithResources) 

# GetCostCategories
<a name="API_GetCostCategories"></a>

Retrieves an array of cost category names and values incurred cost.

**Note**  
If some cost category names and values are not associated with any cost, they will not be returned by this API.

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

```
{
   "BillingViewArn": "string",
   "CostCategoryName": "string",
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "MaxResults": number,
   "NextPageToken": "string",
   "SearchString": "string",
   "SortBy": [ 
      { 
         "Key": "string",
         "SortOrder": "string"
      }
   ],
   "TimePeriod": { 
      "End": "string",
      "Start": "string"
   }
}
```

## Request Parameters
<a name="API_GetCostCategories_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.

 ** [BillingViewArn](#API_GetCostCategories_RequestSyntax) **   <a name="awscostmanagement-GetCostCategories-request-BillingViewArn"></a>
The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to AWS Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[-a-zA-Z0-9/:_+=.-@]{1,43}$`   
Required: No

 ** [CostCategoryName](#API_GetCostCategories_RequestSyntax) **   <a name="awscostmanagement-GetCostCategories-request-CostCategoryName"></a>
The unique name of the cost category.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 50.  
Pattern: `^(?! )[\p{L}\p{N}\p{Z}-_]*(?<! )$`   
Required: No

 ** [Filter](#API_GetCostCategories_RequestSyntax) **   <a name="awscostmanagement-GetCostCategories-request-Filter"></a>
Use `Expression` to filter in various Cost Explorer APIs.  
Not all `Expression` types are supported in each API. Refer to the documentation for each specific API to see what is supported.  
There are two patterns:  
+ Simple dimension values.
  + There are three types of simple dimension values: `CostCategories`, `Tags`, and `Dimensions`.
    + Specify the `CostCategories` field to define a filter that acts on Cost Categories.
    + Specify the `Tags` field to define a filter that acts on Cost Allocation Tags.
    + Specify the `Dimensions` field to define a filter that acts on the [https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html).
  + For each filter type, you can set the dimension name and values for the filters that you plan to use.
    + For example, you can filter for `REGION==us-east-1 OR REGION==us-west-1`. For `GetRightsizingRecommendation`, the Region is a full name (for example, `REGION==US East (N. Virginia)`.
    + The corresponding `Expression` for this example is as follows: `{ "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } }` 
    + As shown in the previous example, lists of dimension values are combined with `OR` when applying the filter.
  + You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
    + For example, you can filter for linked account names that start with "a".
    + The corresponding `Expression` for this example is as follows: `{ "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], "Values": [ "a" ] } }` 
+ Compound `Expression` types with logical operations.
  + You can use multiple `Expression` types and the logical operators `AND/OR/NOT` to create a list of one or more `Expression` objects. By doing this, you can filter by more advanced options.
  + For example, you can filter by `((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)`.
  + The corresponding `Expression` for this example is as follows: `{ "And": [ {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } ` 
**Note**  
Because each `Expression` can have only one operator, the service returns an error if more than one is specified. The following example shows an `Expression` object that creates an error: ` { "And": [ ... ], "Dimensions": { "Key": "USAGE_TYPE", "Values": [ "DataTransfer" ] } } `   
The following is an example of the corresponding error message: `"Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"` 
For the `GetRightsizingRecommendation` action, a combination of OR and NOT isn't supported. OR isn't supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited to `LINKED_ACCOUNT`, `REGION`, or `RIGHTSIZING_TYPE`.  
For the `GetReservationPurchaseRecommendation` action, only NOT is supported. AND and OR aren't supported. Dimensions are limited to `LINKED_ACCOUNT`.
Type: [Expression](API_Expression.md) object  
Required: No

 ** [MaxResults](#API_GetCostCategories_RequestSyntax) **   <a name="awscostmanagement-GetCostCategories-request-MaxResults"></a>
This field is only used when the `SortBy` value is provided in the request.  
The maximum number of objects that are returned for this request. If `MaxResults` isn't specified with the `SortBy` value, the request returns 1000 results as the default value for this parameter.  
For `GetCostCategories`, MaxResults has an upper quota of 1000.  
Type: Integer  
Valid Range: Minimum value of 1.  
Required: No

 ** [NextPageToken](#API_GetCostCategories_RequestSyntax) **   <a name="awscostmanagement-GetCostCategories-request-NextPageToken"></a>
If the number of objects that are still available for retrieval exceeds the quota, AWS returns a NextPageToken value in the response. To retrieve the next batch of objects, provide the NextPageToken from the previous call in your next request.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [SearchString](#API_GetCostCategories_RequestSyntax) **   <a name="awscostmanagement-GetCostCategories-request-SearchString"></a>
The value that you want to search the filter values for.  
If you don't specify a `CostCategoryName`, `SearchString` is used to filter cost category names that match the `SearchString` pattern. If you specify a `CostCategoryName`, `SearchString` is used to filter cost category values that match the `SearchString` pattern.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

 ** [SortBy](#API_GetCostCategories_RequestSyntax) **   <a name="awscostmanagement-GetCostCategories-request-SortBy"></a>
The value that you sort the data by.  
The key represents the cost and usage metrics. The following values are supported:  
+  `BlendedCost` 
+  `UnblendedCost` 
+  `AmortizedCost` 
+  `NetAmortizedCost` 
+  `NetUnblendedCost` 
+  `UsageQuantity` 
+  `NormalizedUsageAmount` 
The supported key values for the `SortOrder` value are `ASCENDING` and `DESCENDING`.  
When you use the `SortBy` value, the `NextPageToken` and `SearchString` key values aren't supported.  
Type: Array of [SortDefinition](API_SortDefinition.md) objects  
Required: No

 ** [TimePeriod](#API_GetCostCategories_RequestSyntax) **   <a name="awscostmanagement-GetCostCategories-request-TimePeriod"></a>
The time period of the request.   
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

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

```
{
   "CostCategoryNames": [ "string" ],
   "CostCategoryValues": [ "string" ],
   "NextPageToken": "string",
   "ReturnSize": number,
   "TotalSize": number
}
```

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

 ** [CostCategoryNames](#API_GetCostCategories_ResponseSyntax) **   <a name="awscostmanagement-GetCostCategories-response-CostCategoryNames"></a>
The names of the cost categories.  
Type: Array of strings  
Length Constraints: Minimum length of 1. Maximum length of 50.  
Pattern: `^(?! )[\p{L}\p{N}\p{Z}-_]*(?<! )$` 

 ** [CostCategoryValues](#API_GetCostCategories_ResponseSyntax) **   <a name="awscostmanagement-GetCostCategories-response-CostCategoryValues"></a>
The cost category values.  
If the `CostCategoryName` key isn't specified in the request, the `CostCategoryValues` fields aren't returned.   
Type: Array of strings  
Length Constraints: Minimum length of 1. Maximum length of 50.  
Pattern: `^(?! )[\p{L}\p{N}\p{Z}-_]*(?<! )$` 

 ** [NextPageToken](#API_GetCostCategories_ResponseSyntax) **   <a name="awscostmanagement-GetCostCategories-response-NextPageToken"></a>
If the number of objects that are still available for retrieval exceeds the quota, AWS returns a NextPageToken value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

 ** [ReturnSize](#API_GetCostCategories_ResponseSyntax) **   <a name="awscostmanagement-GetCostCategories-response-ReturnSize"></a>
The number of objects that are returned.  
Type: Integer

 ** [TotalSize](#API_GetCostCategories_ResponseSyntax) **   <a name="awscostmanagement-GetCostCategories-response-TotalSize"></a>
The total number of objects.  
Type: Integer

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

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

 ** BillExpirationException **   
The requested report expired. Update the date interval and try again.  
HTTP Status Code: 400

 ** BillingViewHealthStatusException **   
 The billing view status must be `HEALTHY` to perform this action. Try again when the status is `HEALTHY`.   
HTTP Status Code: 400

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** RequestChangedException **   
Your request parameters changed between pages. Try again with the old parameters or without a pagination token.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

## See Also
<a name="API_GetCostCategories_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/ce-2017-10-25/GetCostCategories) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetCostCategories) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetCostCategories) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetCostCategories) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetCostCategories) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetCostCategories) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetCostCategories) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetCostCategories) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetCostCategories) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetCostCategories) 

# GetCostComparisonDrivers
<a name="API_GetCostComparisonDrivers"></a>

Retrieves key factors driving cost changes between two time periods within the last 13 months, such as usage changes, discount changes, and commitment-based savings. If you have enabled multi-year data at monthly granularity, you can go back up to 38 months.

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

```
{
   "BaselineTimePeriod": { 
      "End": "string",
      "Start": "string"
   },
   "BillingViewArn": "string",
   "ComparisonTimePeriod": { 
      "End": "string",
      "Start": "string"
   },
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "GroupBy": [ 
      { 
         "Key": "string",
         "Type": "string"
      }
   ],
   "MaxResults": number,
   "MetricForComparison": "string",
   "NextPageToken": "string"
}
```

## Request Parameters
<a name="API_GetCostComparisonDrivers_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.

 ** [BaselineTimePeriod](#API_GetCostComparisonDrivers_RequestSyntax) **   <a name="awscostmanagement-GetCostComparisonDrivers-request-BaselineTimePeriod"></a>
The reference time period for comparison. This time period serves as the baseline against which other cost and usage data will be compared. The interval must start and end on the first day of a month, with a duration of exactly one month.  
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

 ** [BillingViewArn](#API_GetCostComparisonDrivers_RequestSyntax) **   <a name="awscostmanagement-GetCostComparisonDrivers-request-BillingViewArn"></a>
The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to AWS Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[-a-zA-Z0-9/:_+=.-@]{1,43}$`   
Required: No

 ** [ComparisonTimePeriod](#API_GetCostComparisonDrivers_RequestSyntax) **   <a name="awscostmanagement-GetCostComparisonDrivers-request-ComparisonTimePeriod"></a>
The comparison time period for analysis. This time period's cost and usage data will be compared against the baseline time period. The interval must start and end on the first day of a month, with a duration of exactly one month.  
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

 ** [Filter](#API_GetCostComparisonDrivers_RequestSyntax) **   <a name="awscostmanagement-GetCostComparisonDrivers-request-Filter"></a>
Use `Expression` to filter in various Cost Explorer APIs.  
Not all `Expression` types are supported in each API. Refer to the documentation for each specific API to see what is supported.  
There are two patterns:  
+ Simple dimension values.
  + There are three types of simple dimension values: `CostCategories`, `Tags`, and `Dimensions`.
    + Specify the `CostCategories` field to define a filter that acts on Cost Categories.
    + Specify the `Tags` field to define a filter that acts on Cost Allocation Tags.
    + Specify the `Dimensions` field to define a filter that acts on the [https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html).
  + For each filter type, you can set the dimension name and values for the filters that you plan to use.
    + For example, you can filter for `REGION==us-east-1 OR REGION==us-west-1`. For `GetRightsizingRecommendation`, the Region is a full name (for example, `REGION==US East (N. Virginia)`.
    + The corresponding `Expression` for this example is as follows: `{ "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } }` 
    + As shown in the previous example, lists of dimension values are combined with `OR` when applying the filter.
  + You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
    + For example, you can filter for linked account names that start with "a".
    + The corresponding `Expression` for this example is as follows: `{ "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], "Values": [ "a" ] } }` 
+ Compound `Expression` types with logical operations.
  + You can use multiple `Expression` types and the logical operators `AND/OR/NOT` to create a list of one or more `Expression` objects. By doing this, you can filter by more advanced options.
  + For example, you can filter by `((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)`.
  + The corresponding `Expression` for this example is as follows: `{ "And": [ {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } ` 
**Note**  
Because each `Expression` can have only one operator, the service returns an error if more than one is specified. The following example shows an `Expression` object that creates an error: ` { "And": [ ... ], "Dimensions": { "Key": "USAGE_TYPE", "Values": [ "DataTransfer" ] } } `   
The following is an example of the corresponding error message: `"Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"` 
For the `GetRightsizingRecommendation` action, a combination of OR and NOT isn't supported. OR isn't supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited to `LINKED_ACCOUNT`, `REGION`, or `RIGHTSIZING_TYPE`.  
For the `GetReservationPurchaseRecommendation` action, only NOT is supported. AND and OR aren't supported. Dimensions are limited to `LINKED_ACCOUNT`.
Type: [Expression](API_Expression.md) object  
Required: No

 ** [GroupBy](#API_GetCostComparisonDrivers_RequestSyntax) **   <a name="awscostmanagement-GetCostComparisonDrivers-request-GroupBy"></a>
You can group results using the attributes `DIMENSION`, `TAG`, and `COST_CATEGORY`. Note that `SERVICE` and `USAGE_TYPE` dimensions are automatically included in the cost comparison drivers analysis.  
Type: Array of [GroupDefinition](API_GroupDefinition.md) objects  
Required: No

 ** [MaxResults](#API_GetCostComparisonDrivers_RequestSyntax) **   <a name="awscostmanagement-GetCostComparisonDrivers-request-MaxResults"></a>
The maximum number of results that are returned for the request.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 10.  
Required: No

 ** [MetricForComparison](#API_GetCostComparisonDrivers_RequestSyntax) **   <a name="awscostmanagement-GetCostComparisonDrivers-request-MetricForComparison"></a>
The cost and usage metric to compare. Valid values are `AmortizedCost`, `BlendedCost`, `NetAmortizedCost`, `NetUnblendedCost`, `NormalizedUsageAmount`, `UnblendedCost`, and `UsageQuantity`.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: Yes

 ** [NextPageToken](#API_GetCostComparisonDrivers_RequestSyntax) **   <a name="awscostmanagement-GetCostComparisonDrivers-request-NextPageToken"></a>
The token to retrieve the next set of paginated results.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

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

```
{
   "CostComparisonDrivers": [ 
      { 
         "CostDrivers": [ 
            { 
               "Metrics": { 
                  "string" : { 
                     "BaselineTimePeriodAmount": "string",
                     "ComparisonTimePeriodAmount": "string",
                     "Difference": "string",
                     "Unit": "string"
                  }
               },
               "Name": "string",
               "Type": "string"
            }
         ],
         "CostSelector": { 
            "And": [ 
               "Expression"
            ],
            "CostCategories": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            },
            "Dimensions": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            },
            "Not": "Expression",
            "Or": [ 
               "Expression"
            ],
            "Tags": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            }
         },
         "Metrics": { 
            "string" : { 
               "BaselineTimePeriodAmount": "string",
               "ComparisonTimePeriodAmount": "string",
               "Difference": "string",
               "Unit": "string"
            }
         }
      }
   ],
   "NextPageToken": "string"
}
```

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

 ** [CostComparisonDrivers](#API_GetCostComparisonDrivers_ResponseSyntax) **   <a name="awscostmanagement-GetCostComparisonDrivers-response-CostComparisonDrivers"></a>
An array of comparison results showing factors that drive significant cost differences between `BaselineTimePeriod` and `ComparisonTimePeriod`.  
Type: Array of [CostComparisonDriver](API_CostComparisonDriver.md) objects

 ** [NextPageToken](#API_GetCostComparisonDrivers_ResponseSyntax) **   <a name="awscostmanagement-GetCostComparisonDrivers-response-NextPageToken"></a>
The token to retrieve the next set of paginated results.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

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

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

 ** BillingViewHealthStatusException **   
 The billing view status must be `HEALTHY` to perform this action. Try again when the status is `HEALTHY`.   
HTTP Status Code: 400

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

## See Also
<a name="API_GetCostComparisonDrivers_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/ce-2017-10-25/GetCostComparisonDrivers) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetCostComparisonDrivers) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetCostComparisonDrivers) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetCostComparisonDrivers) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetCostComparisonDrivers) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetCostComparisonDrivers) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetCostComparisonDrivers) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetCostComparisonDrivers) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetCostComparisonDrivers) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetCostComparisonDrivers) 

# GetCostForecast
<a name="API_GetCostForecast"></a>

Retrieves a forecast for how much Amazon Web Services predicts that you will spend over the forecast time period that you select, based on your past costs. 

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

```
{
   "BillingViewArn": "string",
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "Granularity": "string",
   "Metric": "string",
   "PredictionIntervalLevel": number,
   "TimePeriod": { 
      "End": "string",
      "Start": "string"
   }
}
```

## Request Parameters
<a name="API_GetCostForecast_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.

 ** [BillingViewArn](#API_GetCostForecast_RequestSyntax) **   <a name="awscostmanagement-GetCostForecast-request-BillingViewArn"></a>
The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to AWS Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[-a-zA-Z0-9/:_+=.-@]{1,43}$`   
Required: No

 ** [Filter](#API_GetCostForecast_RequestSyntax) **   <a name="awscostmanagement-GetCostForecast-request-Filter"></a>
The filters that you want to use to filter your forecast. The `GetCostForecast` API supports filtering by the following dimensions:  
+  `AZ` 
+  `INSTANCE_TYPE` 
+  `LINKED_ACCOUNT` 
+  `OPERATION` 
+  `PURCHASE_TYPE` 
+  `REGION` 
+  `SERVICE` 
+  `USAGE_TYPE` 
+  `USAGE_TYPE_GROUP` 
+  `RECORD_TYPE` 
+  `OPERATING_SYSTEM` 
+  `TENANCY` 
+  `SCOPE` 
+  `PLATFORM` 
+  `SUBSCRIPTION_ID` 
+  `LEGAL_ENTITY_NAME` 
+  `DEPLOYMENT_OPTION` 
+  `DATABASE_ENGINE` 
+  `INSTANCE_TYPE_FAMILY` 
+  `BILLING_ENTITY` 
+  `RESERVATION_ID` 
+  `SAVINGS_PLAN_ARN` 
Type: [Expression](API_Expression.md) object  
Required: No

 ** [Granularity](#API_GetCostForecast_RequestSyntax) **   <a name="awscostmanagement-GetCostForecast-request-Granularity"></a>
How granular you want the forecast to be. You can get 3 months of `DAILY` forecasts or 18 months of `MONTHLY` forecasts.  
The `GetCostForecast` operation supports only `DAILY` and `MONTHLY` granularities.  
Type: String  
Valid Values: `DAILY | MONTHLY | HOURLY`   
Required: Yes

 ** [Metric](#API_GetCostForecast_RequestSyntax) **   <a name="awscostmanagement-GetCostForecast-request-Metric"></a>
Which metric Cost Explorer uses to create your forecast. For more information about blended and unblended rates, see [Why does the "blended" annotation appear on some line items in my bill?](http://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/).   
Valid values for a `GetCostForecast` call are the following:  
+ AMORTIZED\$1COST
+ BLENDED\$1COST
+ NET\$1AMORTIZED\$1COST
+ NET\$1UNBLENDED\$1COST
+ UNBLENDED\$1COST
Type: String  
Valid Values: `BLENDED_COST | UNBLENDED_COST | AMORTIZED_COST | NET_UNBLENDED_COST | NET_AMORTIZED_COST | USAGE_QUANTITY | NORMALIZED_USAGE_AMOUNT`   
Required: Yes

 ** [PredictionIntervalLevel](#API_GetCostForecast_RequestSyntax) **   <a name="awscostmanagement-GetCostForecast-request-PredictionIntervalLevel"></a>
Cost Explorer always returns the mean forecast as a single point. You can request a prediction interval around the mean by specifying a confidence level. The higher the confidence level, the more confident Cost Explorer is about the actual value falling in the prediction interval. Higher confidence levels result in wider prediction intervals.  
Type: Integer  
Valid Range: Minimum value of 51. Maximum value of 99.  
Required: No

 ** [TimePeriod](#API_GetCostForecast_RequestSyntax) **   <a name="awscostmanagement-GetCostForecast-request-TimePeriod"></a>
The period of time that you want the forecast to cover. The start date must be equal to or no later than the current date to avoid a validation error.  
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

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

```
{
   "ForecastResultsByTime": [ 
      { 
         "MeanValue": "string",
         "PredictionIntervalLowerBound": "string",
         "PredictionIntervalUpperBound": "string",
         "TimePeriod": { 
            "End": "string",
            "Start": "string"
         }
      }
   ],
   "Total": { 
      "Amount": "string",
      "Unit": "string"
   }
}
```

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

 ** [ForecastResultsByTime](#API_GetCostForecast_ResponseSyntax) **   <a name="awscostmanagement-GetCostForecast-response-ForecastResultsByTime"></a>
The forecasts for your query, in order. For `DAILY` forecasts, this is a list of days. For `MONTHLY` forecasts, this is a list of months.  
Type: Array of [ForecastResult](API_ForecastResult.md) objects

 ** [Total](#API_GetCostForecast_ResponseSyntax) **   <a name="awscostmanagement-GetCostForecast-response-Total"></a>
How much you are forecasted to spend over the forecast period, in `USD`.  
Type: [MetricValue](API_MetricValue.md) object

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

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

 ** BillingViewHealthStatusException **   
 The billing view status must be `HEALTHY` to perform this action. Try again when the status is `HEALTHY`.   
HTTP Status Code: 400

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

## Examples
<a name="API_GetCostForecast_Examples"></a>

### Example
<a name="API_GetCostForecast_Example_1"></a>

The following example shows how to retrieve a forecast using the `GetCostForecast` operation.

#### Sample Request
<a name="API_GetCostForecast_Example_1_Request"></a>

```
POST / HTTP/1.1
Host: ce.us-east-1.amazonaws.com
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid,Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: AWSInsightsIndexService.GetCostForecast
{
  "TimePeriod": {
    "Start":"2017-10-25",
    "End": "2017-10-27"
  },
  "Granularity": "DAILY",
  "Filter": {      
    "Dimensions": {
      "Key": "SERVICE",
      "Values": [
        "Amazon Simple Storage Service"
      ]
    }
  },
  "Metric":"BLENDED_COST",
  "PredictionIntervalLevel":85
}
```

#### Sample Response
<a name="API_GetCostForecast_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "ForecastResultsByTime": [
    {
      "MeanValue": "37.0786663399", 
      "PredictionIntervalLowerBound": "34.9970026341", 
      "PredictionIntervalUpperBound": "39.1603300457", 
      "TimePeriod": {
        "End": "2018-10-26", 
        "Start": "2018-10-25"
      }
    }, 
    {
      "MeanValue": "37.0786663399", 
      "PredictionIntervalLowerBound": "34.9970026341", 
      "PredictionIntervalUpperBound": "39.1603300457", 
      "TimePeriod": {
        "End": "2018-10-27", 
        "Start": "2018-10-26"
      }
    }
  ], 
  "Total": {
      "Amount": "74.1573326798", 
      "Unit": "USD"
  }
}
```

## See Also
<a name="API_GetCostForecast_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/ce-2017-10-25/GetCostForecast) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetCostForecast) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetCostForecast) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetCostForecast) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetCostForecast) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetCostForecast) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetCostForecast) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetCostForecast) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetCostForecast) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetCostForecast) 

# GetDimensionValues
<a name="API_GetDimensionValues"></a>

Retrieves all available filter values for a specified filter over a period of time. You can search the dimension values for an arbitrary string. 

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

```
{
   "BillingViewArn": "string",
   "Context": "string",
   "Dimension": "string",
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "MaxResults": number,
   "NextPageToken": "string",
   "SearchString": "string",
   "SortBy": [ 
      { 
         "Key": "string",
         "SortOrder": "string"
      }
   ],
   "TimePeriod": { 
      "End": "string",
      "Start": "string"
   }
}
```

## Request Parameters
<a name="API_GetDimensionValues_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.

 ** [BillingViewArn](#API_GetDimensionValues_RequestSyntax) **   <a name="awscostmanagement-GetDimensionValues-request-BillingViewArn"></a>
The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to AWS Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[-a-zA-Z0-9/:_+=.-@]{1,43}$`   
Required: No

 ** [Context](#API_GetDimensionValues_RequestSyntax) **   <a name="awscostmanagement-GetDimensionValues-request-Context"></a>
The context for the call to `GetDimensionValues`. This can be `RESERVATIONS` or `COST_AND_USAGE`. The default value is `COST_AND_USAGE`. If the context is set to `RESERVATIONS`, the resulting dimension values can be used in the `GetReservationUtilization` operation. If the context is set to `COST_AND_USAGE`, the resulting dimension values can be used in the `GetCostAndUsage` operation.  
If you set the context to `COST_AND_USAGE`, you can use the following dimensions for searching:  
+ AZ - The Availability Zone. An example is `us-east-1a`.
+ BILLING\$1ENTITY - The AWS seller that your account is with. Possible values are the following:

  - AWS(Amazon Web Services): The entity that sells AWS services.

  - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for AWS services in India.

  - AWS Marketplace: The entity that supports the sale of solutions that are built on AWS by third-party software providers.
+ CACHE\$1ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.
+ DEPLOYMENT\$1OPTION - The scope of Amazon Relational Database Service deployments. Valid values are `SingleAZ` and `MultiAZ`.
+ DATABASE\$1ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL.
+ INSTANCE\$1TYPE - The type of Amazon EC2 instance. An example is `m4.xlarge`.
+ INSTANCE\$1TYPE\$1FAMILY - A family of instance types optimized to fit different use cases. Examples are `Compute Optimized` (for example, `C4`, `C5`, `C6g`, and `C7g`), `Memory Optimization` (for example, `R4`, `R5n`, `R5b`, and `R6g`).
+ INVOICING\$1ENTITY - The name of the entity that issues the AWS invoice.
+ LEGAL\$1ENTITY\$1NAME - The name of the organization that sells you AWS services, such as Amazon Web Services.
+ LINKED\$1ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account.
+ OPERATING\$1SYSTEM - The operating system. Examples are Windows or Linux.
+ OPERATION - The action performed. Examples include `RunInstance` and `CreateBucket`.
+ PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.
+ PURCHASE\$1TYPE - The reservation type of the purchase that this usage is related to. Examples include On-Demand Instances and Standard Reserved Instances.
+ RESERVATION\$1ID - The unique identifier for an AWS Reservation Instance.
+ SAVINGS\$1PLAN\$1ARN - The unique identifier for your Savings Plans.
+ SAVINGS\$1PLANS\$1TYPE - Type of Savings Plans (EC2 Instance or Compute).
+ SERVICE - The AWS service such as Amazon DynamoDB.
+ TENANCY - The tenancy of a resource. Examples are shared or dedicated.
+ USAGE\$1TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the `GetDimensionValues` operation includes a unit attribute. Examples include GB and Hrs.
+ USAGE\$1TYPE\$1GROUP - The grouping of common usage types. An example is Amazon EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute.
+ REGION - The AWS Region.
+ RECORD\$1TYPE - The different types of charges such as Reserved Instance (RI) fees, usage costs, tax refunds, and credits.
+ RESOURCE\$1ID - The unique identifier of the resource. ResourceId is an opt-in feature only available for last 14 days for EC2-Compute Service.
If you set the context to `RESERVATIONS`, you can use the following dimensions for searching:  
+ AZ - The Availability Zone. An example is `us-east-1a`.
+ CACHE\$1ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.
+ DEPLOYMENT\$1OPTION - The scope of Amazon Relational Database Service deployments. Valid values are `SingleAZ` and `MultiAZ`.
+ INSTANCE\$1TYPE - The type of Amazon EC2 instance. An example is `m4.xlarge`.
+ LINKED\$1ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account.
+ PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.
+ REGION - The AWS Region.
+ SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone.
+ TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI).
+ TENANCY - The tenancy of a resource. Examples are shared or dedicated.
If you set the context to `SAVINGS_PLANS`, you can use the following dimensions for searching:  
+ SAVINGS\$1PLANS\$1TYPE - Type of Savings Plans (EC2 Instance or Compute)
+ PAYMENT\$1OPTION - The payment option for the given Savings Plans (for example, All Upfront)
+ REGION - The AWS Region.
+ INSTANCE\$1TYPE\$1FAMILY - The family of instances (For example, `m5`)
+ LINKED\$1ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account.
+ SAVINGS\$1PLAN\$1ARN - The unique identifier for your Savings Plans.
Type: String  
Valid Values: `COST_AND_USAGE | RESERVATIONS | SAVINGS_PLANS`   
Required: No

 ** [Dimension](#API_GetDimensionValues_RequestSyntax) **   <a name="awscostmanagement-GetDimensionValues-request-Dimension"></a>
The name of the dimension. Each `Dimension` is available for a different `Context`. For more information, see `Context`. `LINK_ACCOUNT_NAME` and `SERVICE_CODE` can only be used in [CostCategoryRule](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/AAPI_CostCategoryRule.html).   
Type: String  
Valid Values: `AZ | INSTANCE_TYPE | LINKED_ACCOUNT | PAYER_ACCOUNT | LINKED_ACCOUNT_NAME | OPERATION | PURCHASE_TYPE | REGION | SERVICE | SERVICE_CODE | USAGE_TYPE | USAGE_TYPE_GROUP | RECORD_TYPE | OPERATING_SYSTEM | TENANCY | SCOPE | PLATFORM | SUBSCRIPTION_ID | LEGAL_ENTITY_NAME | DEPLOYMENT_OPTION | DATABASE_ENGINE | CACHE_ENGINE | INSTANCE_TYPE_FAMILY | BILLING_ENTITY | RESERVATION_ID | RESOURCE_ID | RIGHTSIZING_TYPE | SAVINGS_PLANS_TYPE | SAVINGS_PLAN_ARN | PAYMENT_OPTION | AGREEMENT_END_DATE_TIME_AFTER | AGREEMENT_END_DATE_TIME_BEFORE | INVOICING_ENTITY | ANOMALY_TOTAL_IMPACT_ABSOLUTE | ANOMALY_TOTAL_IMPACT_PERCENTAGE`   
Required: Yes

 ** [Filter](#API_GetDimensionValues_RequestSyntax) **   <a name="awscostmanagement-GetDimensionValues-request-Filter"></a>
Use `Expression` to filter in various Cost Explorer APIs.  
Not all `Expression` types are supported in each API. Refer to the documentation for each specific API to see what is supported.  
There are two patterns:  
+ Simple dimension values.
  + There are three types of simple dimension values: `CostCategories`, `Tags`, and `Dimensions`.
    + Specify the `CostCategories` field to define a filter that acts on Cost Categories.
    + Specify the `Tags` field to define a filter that acts on Cost Allocation Tags.
    + Specify the `Dimensions` field to define a filter that acts on the [https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html).
  + For each filter type, you can set the dimension name and values for the filters that you plan to use.
    + For example, you can filter for `REGION==us-east-1 OR REGION==us-west-1`. For `GetRightsizingRecommendation`, the Region is a full name (for example, `REGION==US East (N. Virginia)`.
    + The corresponding `Expression` for this example is as follows: `{ "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } }` 
    + As shown in the previous example, lists of dimension values are combined with `OR` when applying the filter.
  + You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
    + For example, you can filter for linked account names that start with "a".
    + The corresponding `Expression` for this example is as follows: `{ "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], "Values": [ "a" ] } }` 
+ Compound `Expression` types with logical operations.
  + You can use multiple `Expression` types and the logical operators `AND/OR/NOT` to create a list of one or more `Expression` objects. By doing this, you can filter by more advanced options.
  + For example, you can filter by `((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)`.
  + The corresponding `Expression` for this example is as follows: `{ "And": [ {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } ` 
**Note**  
Because each `Expression` can have only one operator, the service returns an error if more than one is specified. The following example shows an `Expression` object that creates an error: ` { "And": [ ... ], "Dimensions": { "Key": "USAGE_TYPE", "Values": [ "DataTransfer" ] } } `   
The following is an example of the corresponding error message: `"Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"` 
For the `GetRightsizingRecommendation` action, a combination of OR and NOT isn't supported. OR isn't supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited to `LINKED_ACCOUNT`, `REGION`, or `RIGHTSIZING_TYPE`.  
For the `GetReservationPurchaseRecommendation` action, only NOT is supported. AND and OR aren't supported. Dimensions are limited to `LINKED_ACCOUNT`.
Type: [Expression](API_Expression.md) object  
Required: No

 ** [MaxResults](#API_GetDimensionValues_RequestSyntax) **   <a name="awscostmanagement-GetDimensionValues-request-MaxResults"></a>
This field is only used when SortBy is provided in the request. The maximum number of objects that are returned for this request. If MaxResults isn't specified with SortBy, the request returns 1000 results as the default value for this parameter.  
For `GetDimensionValues`, MaxResults has an upper limit of 1000.  
Type: Integer  
Valid Range: Minimum value of 1.  
Required: No

 ** [NextPageToken](#API_GetDimensionValues_RequestSyntax) **   <a name="awscostmanagement-GetDimensionValues-request-NextPageToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [SearchString](#API_GetDimensionValues_RequestSyntax) **   <a name="awscostmanagement-GetDimensionValues-request-SearchString"></a>
The value that you want to search the filter values for.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

 ** [SortBy](#API_GetDimensionValues_RequestSyntax) **   <a name="awscostmanagement-GetDimensionValues-request-SortBy"></a>
The value that you want to sort the data by.  
The key represents cost and usage metrics. The following values are supported:  
+  `BlendedCost` 
+  `UnblendedCost` 
+  `AmortizedCost` 
+  `NetAmortizedCost` 
+  `NetUnblendedCost` 
+  `UsageQuantity` 
+  `NormalizedUsageAmount` 
The supported values for the `SortOrder` key are `ASCENDING` or `DESCENDING`.  
When you specify a `SortBy` paramater, the context must be `COST_AND_USAGE`. Further, when using `SortBy`, `NextPageToken` and `SearchString` aren't supported.  
Type: Array of [SortDefinition](API_SortDefinition.md) objects  
Required: No

 ** [TimePeriod](#API_GetDimensionValues_RequestSyntax) **   <a name="awscostmanagement-GetDimensionValues-request-TimePeriod"></a>
The start date and end date for retrieving the dimension values. The start date is inclusive, but the end date is exclusive. For example, if `start` is `2017-01-01` and `end` is `2017-05-01`, then the cost and usage data is retrieved from `2017-01-01` up to and including `2017-04-30` but not including `2017-05-01`.  
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

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

```
{
   "DimensionValues": [ 
      { 
         "Attributes": { 
            "string" : "string" 
         },
         "Value": "string"
      }
   ],
   "NextPageToken": "string",
   "ReturnSize": number,
   "TotalSize": number
}
```

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

 ** [DimensionValues](#API_GetDimensionValues_ResponseSyntax) **   <a name="awscostmanagement-GetDimensionValues-response-DimensionValues"></a>
The filters that you used to filter your request. Some dimensions are available only for a specific context.  
If you set the context to `COST_AND_USAGE`, you can use the following dimensions for searching:  
+ AZ - The Availability Zone. An example is `us-east-1a`.
+ DATABASE\$1ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL.
+ INSTANCE\$1TYPE - The type of Amazon EC2 instance. An example is `m4.xlarge`.
+ LEGAL\$1ENTITY\$1NAME - The name of the organization that sells you AWS services, such as Amazon Web Services.
+ LINKED\$1ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account.
+ OPERATING\$1SYSTEM - The operating system. Examples are Windows or Linux.
+ OPERATION - The action performed. Examples include `RunInstance` and `CreateBucket`.
+ PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.
+ PURCHASE\$1TYPE - The reservation type of the purchase to which this usage is related. Examples include On-Demand Instances and Standard Reserved Instances.
+ SERVICE - The AWS service such as Amazon DynamoDB.
+ USAGE\$1TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the `GetDimensionValues` operation includes a unit attribute. Examples include GB and Hrs.
+ USAGE\$1TYPE\$1GROUP - The grouping of common usage types. An example is Amazon EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute.
+ RECORD\$1TYPE - The different types of charges such as RI fees, usage costs, tax refunds, and credits.
+ RESOURCE\$1ID - The unique identifier of the resource. ResourceId is an opt-in feature only available for last 14 days for EC2-Compute Service. You can opt-in by enabling `Hourly` and `Resource Level Data` in AWS Cost Management Console preferences.
If you set the context to `RESERVATIONS`, you can use the following dimensions for searching:  
+ AZ - The Availability Zone. An example is `us-east-1a`.
+ CACHE\$1ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.
+ DEPLOYMENT\$1OPTION - The scope of Amazon Relational Database Service deployments. Valid values are `SingleAZ` and `MultiAZ`.
+ INSTANCE\$1TYPE - The type of Amazon EC2 instance. An example is `m4.xlarge`.
+ LINKED\$1ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account.
+ PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.
+ REGION - The AWS Region.
+ SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone.
+ TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI).
+ TENANCY - The tenancy of a resource. Examples are shared or dedicated.
If you set the context to `SAVINGS_PLANS`, you can use the following dimensions for searching:  
+ SAVINGS\$1PLANS\$1TYPE - Type of Savings Plans (EC2 Instance or Compute)
+ PAYMENT\$1OPTION - Payment option for the given Savings Plans (for example, All Upfront)
+ REGION - The AWS Region.
+ INSTANCE\$1TYPE\$1FAMILY - The family of instances (For example, `m5`)
+ LINKED\$1ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account.
+ SAVINGS\$1PLAN\$1ARN - The unique identifier for your Savings Plan
Type: Array of [DimensionValuesWithAttributes](API_DimensionValuesWithAttributes.md) objects

 ** [NextPageToken](#API_GetDimensionValues_ResponseSyntax) **   <a name="awscostmanagement-GetDimensionValues-response-NextPageToken"></a>
The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

 ** [ReturnSize](#API_GetDimensionValues_ResponseSyntax) **   <a name="awscostmanagement-GetDimensionValues-response-ReturnSize"></a>
The number of results that AWS returned at one time.  
Type: Integer

 ** [TotalSize](#API_GetDimensionValues_ResponseSyntax) **   <a name="awscostmanagement-GetDimensionValues-response-TotalSize"></a>
The total number of search results.  
Type: Integer

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

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

 ** BillExpirationException **   
The requested report expired. Update the date interval and try again.  
HTTP Status Code: 400

 ** BillingViewHealthStatusException **   
 The billing view status must be `HEALTHY` to perform this action. Try again when the status is `HEALTHY`.   
HTTP Status Code: 400

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** RequestChangedException **   
Your request parameters changed between pages. Try again with the old parameters or without a pagination token.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

## Examples
<a name="API_GetDimensionValues_Examples"></a>

### Example
<a name="API_GetDimensionValues_Example_1"></a>

The following is a sample request and response of the `GetDimensionValues` operation that enables you to search for all the member accounts in an organization in AWS Organizations that have "Elastic" in their name.

#### Sample Request
<a name="API_GetDimensionValues_Example_1_Request"></a>

```
POST / HTTP/1.1
Host: ce.us-east-1.amazonaws.com
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid,Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: AWSInsightsIndexService.GetDimensionValues
{
  "TimePeriod": {
    "Start": "2017-01-01",
    "End": "2017-05-18"
  },
  "SearchString": "Elastic",
  "Dimension": "Service"
}
```

#### Sample Response
<a name="API_GetDimensionValues_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
//Attributes are optional metadata that are returned depending on the dimension that you select.
{
  "DimensionValues": [
    {
      "Attributes": {},
      "Value": "Amazon ElastiCache"
    },
    {
      "Attributes": {},
      "Value": "EC2 - Other"
    },
    {
      "Attributes": {},
      "Value": "Amazon Elastic Compute Cloud - Compute"
    },
    {
      "Attributes": {},
      "Value": "Amazon Elasticsearch Service"
    }
  ],
  "ReturnSize": 4,
  "TotalSize": 4
}
```

## See Also
<a name="API_GetDimensionValues_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/ce-2017-10-25/GetDimensionValues) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetDimensionValues) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetDimensionValues) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetDimensionValues) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetDimensionValues) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetDimensionValues) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetDimensionValues) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetDimensionValues) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetDimensionValues) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetDimensionValues) 

# GetReservationCoverage
<a name="API_GetReservationCoverage"></a>

Retrieves the reservation coverage for your account, which you can use to see how much of your Amazon Elastic Compute Cloud, Amazon ElastiCache, Amazon Relational Database Service, or Amazon Redshift usage is covered by a reservation. An organization's management account can see the coverage of the associated member accounts. This supports dimensions, cost categories, and nested expressions. For any time period, you can filter data about reservation usage by the following dimensions:
+ AZ
+ CACHE\$1ENGINE
+ DATABASE\$1ENGINE
+ DEPLOYMENT\$1OPTION
+ INSTANCE\$1TYPE
+ LINKED\$1ACCOUNT
+ OPERATING\$1SYSTEM
+ PLATFORM
+ REGION
+ SERVICE
+ TAG
+ TENANCY

To determine valid values for a dimension, use the `GetDimensionValues` operation. 

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

```
{
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "Granularity": "string",
   "GroupBy": [ 
      { 
         "Key": "string",
         "Type": "string"
      }
   ],
   "MaxResults": number,
   "Metrics": [ "string" ],
   "NextPageToken": "string",
   "SortBy": { 
      "Key": "string",
      "SortOrder": "string"
   },
   "TimePeriod": { 
      "End": "string",
      "Start": "string"
   }
}
```

## Request Parameters
<a name="API_GetReservationCoverage_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.

 ** [Filter](#API_GetReservationCoverage_RequestSyntax) **   <a name="awscostmanagement-GetReservationCoverage-request-Filter"></a>
Filters utilization data by dimensions. You can filter by the following dimensions:  
+ AZ
+ CACHE\$1ENGINE
+ DATABASE\$1ENGINE
+ DEPLOYMENT\$1OPTION
+ INSTANCE\$1TYPE
+ LINKED\$1ACCOUNT
+ OPERATING\$1SYSTEM
+ PLATFORM
+ REGION
+ SERVICE
+ TAG
+ TENANCY
 `GetReservationCoverage` uses the same [Expression](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html) object as the other operations, but only `AND` is supported among each dimension. You can nest only one level deep. If there are multiple values for a dimension, they are OR'd together.  
If you don't provide a `SERVICE` filter, Cost Explorer defaults to EC2.  
Cost category is also supported.  
Type: [Expression](API_Expression.md) object  
Required: No

 ** [Granularity](#API_GetReservationCoverage_RequestSyntax) **   <a name="awscostmanagement-GetReservationCoverage-request-Granularity"></a>
The granularity of the AWS cost data for the reservation. Valid values are `MONTHLY` and `DAILY`.  
If `GroupBy` is set, `Granularity` can't be set. If `Granularity` isn't set, the response object doesn't include `Granularity`, either `MONTHLY` or `DAILY`.  
The `GetReservationCoverage` operation supports only `DAILY` and `MONTHLY` granularities.  
Type: String  
Valid Values: `DAILY | MONTHLY | HOURLY`   
Required: No

 ** [GroupBy](#API_GetReservationCoverage_RequestSyntax) **   <a name="awscostmanagement-GetReservationCoverage-request-GroupBy"></a>
You can group the data by the following attributes:  
+ AZ
+ CACHE\$1ENGINE
+ DATABASE\$1ENGINE
+ DEPLOYMENT\$1OPTION
+ INSTANCE\$1TYPE
+ INVOICING\$1ENTITY
+ LINKED\$1ACCOUNT
+ OPERATING\$1SYSTEM
+ PLATFORM
+ REGION
+ TENANCY
Type: Array of [GroupDefinition](API_GroupDefinition.md) objects  
Required: No

 ** [MaxResults](#API_GetReservationCoverage_RequestSyntax) **   <a name="awscostmanagement-GetReservationCoverage-request-MaxResults"></a>
The maximum number of objects that you returned for this request. If more objects are available, in the response, AWS provides a NextPageToken value that you can use in a subsequent call to get the next batch of objects.  
Type: Integer  
Valid Range: Minimum value of 1.  
Required: No

 ** [Metrics](#API_GetReservationCoverage_RequestSyntax) **   <a name="awscostmanagement-GetReservationCoverage-request-Metrics"></a>
The measurement that you want your reservation coverage reported in.  
Valid values are `Hour`, `Unit`, and `Cost`. You can use multiple values in a request.  
Type: Array of strings  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

 ** [NextPageToken](#API_GetReservationCoverage_RequestSyntax) **   <a name="awscostmanagement-GetReservationCoverage-request-NextPageToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [SortBy](#API_GetReservationCoverage_RequestSyntax) **   <a name="awscostmanagement-GetReservationCoverage-request-SortBy"></a>
The value by which you want to sort the data.  
The following values are supported for `Key`:  
+  `OnDemandCost` 
+  `CoverageHoursPercentage` 
+  `OnDemandHours` 
+  `ReservedHours` 
+  `TotalRunningHours` 
+  `CoverageNormalizedUnitsPercentage` 
+  `OnDemandNormalizedUnits` 
+  `ReservedNormalizedUnits` 
+  `TotalRunningNormalizedUnits` 
+  `Time` 
Supported values for `SortOrder` are `ASCENDING` or `DESCENDING`.  
Type: [SortDefinition](API_SortDefinition.md) object  
Required: No

 ** [TimePeriod](#API_GetReservationCoverage_RequestSyntax) **   <a name="awscostmanagement-GetReservationCoverage-request-TimePeriod"></a>
The start and end dates of the period that you want to retrieve data about reservation coverage for. You can retrieve data for a maximum of 13 months: the last 12 months and the current month. The start date is inclusive, but the end date is exclusive. For example, if `start` is `2017-01-01` and `end` is `2017-05-01`, then the cost and usage data is retrieved from `2017-01-01` up to and including `2017-04-30` but not including `2017-05-01`.   
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

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

```
{
   "CoveragesByTime": [ 
      { 
         "Groups": [ 
            { 
               "Attributes": { 
                  "string" : "string" 
               },
               "Coverage": { 
                  "CoverageCost": { 
                     "OnDemandCost": "string"
                  },
                  "CoverageHours": { 
                     "CoverageHoursPercentage": "string",
                     "OnDemandHours": "string",
                     "ReservedHours": "string",
                     "TotalRunningHours": "string"
                  },
                  "CoverageNormalizedUnits": { 
                     "CoverageNormalizedUnitsPercentage": "string",
                     "OnDemandNormalizedUnits": "string",
                     "ReservedNormalizedUnits": "string",
                     "TotalRunningNormalizedUnits": "string"
                  }
               }
            }
         ],
         "TimePeriod": { 
            "End": "string",
            "Start": "string"
         },
         "Total": { 
            "CoverageCost": { 
               "OnDemandCost": "string"
            },
            "CoverageHours": { 
               "CoverageHoursPercentage": "string",
               "OnDemandHours": "string",
               "ReservedHours": "string",
               "TotalRunningHours": "string"
            },
            "CoverageNormalizedUnits": { 
               "CoverageNormalizedUnitsPercentage": "string",
               "OnDemandNormalizedUnits": "string",
               "ReservedNormalizedUnits": "string",
               "TotalRunningNormalizedUnits": "string"
            }
         }
      }
   ],
   "NextPageToken": "string",
   "Total": { 
      "CoverageCost": { 
         "OnDemandCost": "string"
      },
      "CoverageHours": { 
         "CoverageHoursPercentage": "string",
         "OnDemandHours": "string",
         "ReservedHours": "string",
         "TotalRunningHours": "string"
      },
      "CoverageNormalizedUnits": { 
         "CoverageNormalizedUnitsPercentage": "string",
         "OnDemandNormalizedUnits": "string",
         "ReservedNormalizedUnits": "string",
         "TotalRunningNormalizedUnits": "string"
      }
   }
}
```

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

 ** [CoveragesByTime](#API_GetReservationCoverage_ResponseSyntax) **   <a name="awscostmanagement-GetReservationCoverage-response-CoveragesByTime"></a>
The amount of time that your reservations covered.  
Type: Array of [CoverageByTime](API_CoverageByTime.md) objects

 ** [NextPageToken](#API_GetReservationCoverage_ResponseSyntax) **   <a name="awscostmanagement-GetReservationCoverage-response-NextPageToken"></a>
The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

 ** [Total](#API_GetReservationCoverage_ResponseSyntax) **   <a name="awscostmanagement-GetReservationCoverage-response-Total"></a>
The total amount of instance usage that a reservation covered.  
Type: [Coverage](API_Coverage.md) object

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

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

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## Examples
<a name="API_GetReservationCoverage_Examples"></a>

### Example
<a name="API_GetReservationCoverage_Example_1"></a>

The following example request for the `GetReservationCoverage` operation retrieves reservation coverage for all `t2.nano` instance types from 2017-07-01 to 2017-10-01.

#### Sample Request
<a name="API_GetReservationCoverage_Example_1_Request"></a>

```
POST / HTTP/1.1
Host: ce.us-east-1.amazonaws.com
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid,Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: AWSInsightsIndexService.GetReservationCoverage
{
  "TimePeriod": {
    "Start":"2017-07-01",
    "End": "2017-10-01"
  },
  "Filter": {     
    "And": [ 
      {"Dimensions": {
        "Key": "INSTANCE_TYPE",
        "Values": [
          "t2.nano"
        ]
      },
      {"Dimensions": {
        "Key": "REGION",
        "Values": [
          "us-east-1"
        ]
      }}
    ]
  },
  "GroupBy":[
    {
      "Type":"Dimension",
      "Key":"REGION"
    }
  ]
}
```

#### Sample Response
<a name="API_GetReservationCoverage_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "CoveragesByTime": [{
    "Groups": [{
      "Attributes": {
        "region": "us-east-1"
      },
      "Coverage": {
        "CoverageHours": {
          "CoverageHoursPercentage": "40%",
          "OnDemandHours": "40",
          "ReservedHours": "40",
          "TotalRunningHours": "80"
        }
        "CoverageNormalizedUnits": {
          "CoverageNormalizedUnitsPercentage": "10",
          "OnDemandNormalizedUnits": "10",
          "ReservedNormalizedUnits": "10",
          "TotalRunningNormalizedUnits": "20"
        }
      }
    }],
    "TimePeriod": {
      "End": "2017-07-01",
      "Start": "2017-10-01"
    },
    "Total": {
      "CoverageHours": {
        "CoverageHoursPercentage": "40%",
        "OnDemandHours": "40",
        "ReservedHours": "40",
        "TotalRunningHours": "80"
      }
      "CoverageNormalizedUnits": {
        "CoverageNormalizedUnitsPercentage": "10",
        "OnDemandNormalizedUnits": "10",
        "ReservedNormalizedUnits": "10",
        "TotalRunningNormalizedUnits": "20"
      }
    }
  }],
  "Total": { 
    "CoverageHours": { 
      "CoverageHoursPercentage": "40%",
      "OnDemandHours": "40",
      "ReservedHours": "40",
      "TotalRunningHours": "80"
    }
  }
}
}
```

## See Also
<a name="API_GetReservationCoverage_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/ce-2017-10-25/GetReservationCoverage) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetReservationCoverage) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetReservationCoverage) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetReservationCoverage) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetReservationCoverage) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetReservationCoverage) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetReservationCoverage) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetReservationCoverage) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetReservationCoverage) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetReservationCoverage) 

# GetReservationPurchaseRecommendation
<a name="API_GetReservationPurchaseRecommendation"></a>

Gets recommendations for reservation purchases. These recommendations might help you to reduce your costs. Reservations provide a discounted hourly rate (up to 75%) compared to On-Demand pricing.

 AWS generates your recommendations by identifying your On-Demand usage during a specific time period and collecting your usage into categories that are eligible for a reservation. After AWS has these categories, it simulates every combination of reservations in each category of usage to identify the best number of each type of Reserved Instance (RI) to purchase to maximize your estimated savings. 

For example, AWS automatically aggregates your Amazon EC2 Linux, shared tenancy, and c4 family usage in the US West (Oregon) Region and recommends that you buy size-flexible regional reservations to apply to the c4 family usage. AWS recommends the smallest size instance in an instance family. This makes it easier to purchase a size-flexible Reserved Instance (RI). AWS also shows the equal number of normalized units. This way, you can purchase any instance size that you want. For this example, your RI recommendation is for `c4.large` because that is the smallest size instance in the c4 instance family.

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

```
{
   "AccountId": "string",
   "AccountScope": "string",
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "LookbackPeriodInDays": "string",
   "NextPageToken": "string",
   "PageSize": number,
   "PaymentOption": "string",
   "Service": "string",
   "ServiceSpecification": { 
      "EC2Specification": { 
         "OfferingClass": "string"
      }
   },
   "TermInYears": "string"
}
```

## Request Parameters
<a name="API_GetReservationPurchaseRecommendation_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.

 ** [AccountId](#API_GetReservationPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetReservationPurchaseRecommendation-request-AccountId"></a>
The account ID that's associated with the recommendation.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

 ** [AccountScope](#API_GetReservationPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetReservationPurchaseRecommendation-request-AccountScope"></a>
The account scope that you want your recommendations for. Amazon Web Services calculates recommendations including the management account and member accounts if the value is set to `PAYER`. If the value is `LINKED`, recommendations are calculated for individual member accounts only.  
Type: String  
Valid Values: `PAYER | LINKED`   
Required: No

 ** [Filter](#API_GetReservationPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetReservationPurchaseRecommendation-request-Filter"></a>
Use `Expression` to filter in various Cost Explorer APIs.  
Not all `Expression` types are supported in each API. Refer to the documentation for each specific API to see what is supported.  
There are two patterns:  
+ Simple dimension values.
  + There are three types of simple dimension values: `CostCategories`, `Tags`, and `Dimensions`.
    + Specify the `CostCategories` field to define a filter that acts on Cost Categories.
    + Specify the `Tags` field to define a filter that acts on Cost Allocation Tags.
    + Specify the `Dimensions` field to define a filter that acts on the [https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html).
  + For each filter type, you can set the dimension name and values for the filters that you plan to use.
    + For example, you can filter for `REGION==us-east-1 OR REGION==us-west-1`. For `GetRightsizingRecommendation`, the Region is a full name (for example, `REGION==US East (N. Virginia)`.
    + The corresponding `Expression` for this example is as follows: `{ "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } }` 
    + As shown in the previous example, lists of dimension values are combined with `OR` when applying the filter.
  + You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
    + For example, you can filter for linked account names that start with "a".
    + The corresponding `Expression` for this example is as follows: `{ "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], "Values": [ "a" ] } }` 
+ Compound `Expression` types with logical operations.
  + You can use multiple `Expression` types and the logical operators `AND/OR/NOT` to create a list of one or more `Expression` objects. By doing this, you can filter by more advanced options.
  + For example, you can filter by `((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)`.
  + The corresponding `Expression` for this example is as follows: `{ "And": [ {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } ` 
**Note**  
Because each `Expression` can have only one operator, the service returns an error if more than one is specified. The following example shows an `Expression` object that creates an error: ` { "And": [ ... ], "Dimensions": { "Key": "USAGE_TYPE", "Values": [ "DataTransfer" ] } } `   
The following is an example of the corresponding error message: `"Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"` 
For the `GetRightsizingRecommendation` action, a combination of OR and NOT isn't supported. OR isn't supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited to `LINKED_ACCOUNT`, `REGION`, or `RIGHTSIZING_TYPE`.  
For the `GetReservationPurchaseRecommendation` action, only NOT is supported. AND and OR aren't supported. Dimensions are limited to `LINKED_ACCOUNT`.
Type: [Expression](API_Expression.md) object  
Required: No

 ** [LookbackPeriodInDays](#API_GetReservationPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetReservationPurchaseRecommendation-request-LookbackPeriodInDays"></a>
The number of previous days that you want AWS to consider when it calculates your recommendations.  
Type: String  
Valid Values: `SEVEN_DAYS | THIRTY_DAYS | SIXTY_DAYS`   
Required: No

 ** [NextPageToken](#API_GetReservationPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetReservationPurchaseRecommendation-request-NextPageToken"></a>
The pagination token that indicates the next set of results that you want to retrieve.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [PageSize](#API_GetReservationPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetReservationPurchaseRecommendation-request-PageSize"></a>
The number of recommendations that you want returned in a single response object.  
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 6000.  
Required: No

 ** [PaymentOption](#API_GetReservationPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetReservationPurchaseRecommendation-request-PaymentOption"></a>
The reservation purchase option that you want recommendations for.  
Type: String  
Valid Values: `NO_UPFRONT | PARTIAL_UPFRONT | ALL_UPFRONT | LIGHT_UTILIZATION | MEDIUM_UTILIZATION | HEAVY_UTILIZATION`   
Required: No

 ** [Service](#API_GetReservationPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetReservationPurchaseRecommendation-request-Service"></a>
The specific service that you want recommendations for.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: Yes

 ** [ServiceSpecification](#API_GetReservationPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetReservationPurchaseRecommendation-request-ServiceSpecification"></a>
The hardware specifications for the service instances that you want recommendations for, such as standard or convertible Amazon EC2 instances.  
Type: [ServiceSpecification](API_ServiceSpecification.md) object  
Required: No

 ** [TermInYears](#API_GetReservationPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetReservationPurchaseRecommendation-request-TermInYears"></a>
The reservation term that you want recommendations for.  
Type: String  
Valid Values: `ONE_YEAR | THREE_YEARS`   
Required: No

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

```
{
   "Metadata": { 
      "AdditionalMetadata": "string",
      "GenerationTimestamp": "string",
      "RecommendationId": "string"
   },
   "NextPageToken": "string",
   "Recommendations": [ 
      { 
         "AccountScope": "string",
         "LookbackPeriodInDays": "string",
         "PaymentOption": "string",
         "RecommendationDetails": [ 
            { 
               "AccountId": "string",
               "AverageNormalizedUnitsUsedPerHour": "string",
               "AverageNumberOfCapacityUnitsUsedPerHour": "string",
               "AverageNumberOfInstancesUsedPerHour": "string",
               "AverageUtilization": "string",
               "CurrencyCode": "string",
               "EstimatedBreakEvenInMonths": "string",
               "EstimatedMonthlyOnDemandCost": "string",
               "EstimatedMonthlySavingsAmount": "string",
               "EstimatedMonthlySavingsPercentage": "string",
               "EstimatedReservationCostForLookbackPeriod": "string",
               "InstanceDetails": { 
                  "EC2InstanceDetails": { 
                     "AvailabilityZone": "string",
                     "CurrentGeneration": boolean,
                     "Family": "string",
                     "InstanceType": "string",
                     "Platform": "string",
                     "Region": "string",
                     "SizeFlexEligible": boolean,
                     "Tenancy": "string"
                  },
                  "ElastiCacheInstanceDetails": { 
                     "CurrentGeneration": boolean,
                     "Family": "string",
                     "NodeType": "string",
                     "ProductDescription": "string",
                     "Region": "string",
                     "SizeFlexEligible": boolean
                  },
                  "ESInstanceDetails": { 
                     "CurrentGeneration": boolean,
                     "InstanceClass": "string",
                     "InstanceSize": "string",
                     "Region": "string",
                     "SizeFlexEligible": boolean
                  },
                  "MemoryDBInstanceDetails": { 
                     "CurrentGeneration": boolean,
                     "Family": "string",
                     "NodeType": "string",
                     "Region": "string",
                     "SizeFlexEligible": boolean
                  },
                  "RDSInstanceDetails": { 
                     "CurrentGeneration": boolean,
                     "DatabaseEdition": "string",
                     "DatabaseEngine": "string",
                     "DeploymentModel": "string",
                     "DeploymentOption": "string",
                     "Family": "string",
                     "InstanceType": "string",
                     "LicenseModel": "string",
                     "Region": "string",
                     "SizeFlexEligible": boolean
                  },
                  "RedshiftInstanceDetails": { 
                     "CurrentGeneration": boolean,
                     "Family": "string",
                     "NodeType": "string",
                     "Region": "string",
                     "SizeFlexEligible": boolean
                  }
               },
               "MaximumNormalizedUnitsUsedPerHour": "string",
               "MaximumNumberOfCapacityUnitsUsedPerHour": "string",
               "MaximumNumberOfInstancesUsedPerHour": "string",
               "MinimumNormalizedUnitsUsedPerHour": "string",
               "MinimumNumberOfCapacityUnitsUsedPerHour": "string",
               "MinimumNumberOfInstancesUsedPerHour": "string",
               "RecommendedNormalizedUnitsToPurchase": "string",
               "RecommendedNumberOfCapacityUnitsToPurchase": "string",
               "RecommendedNumberOfInstancesToPurchase": "string",
               "RecurringStandardMonthlyCost": "string",
               "ReservedCapacityDetails": { 
                  "DynamoDBCapacityDetails": { 
                     "CapacityUnits": "string",
                     "Region": "string"
                  }
               },
               "UpfrontCost": "string"
            }
         ],
         "RecommendationSummary": { 
            "CurrencyCode": "string",
            "TotalEstimatedMonthlySavingsAmount": "string",
            "TotalEstimatedMonthlySavingsPercentage": "string"
         },
         "ServiceSpecification": { 
            "EC2Specification": { 
               "OfferingClass": "string"
            }
         },
         "TermInYears": "string"
      }
   ]
}
```

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

 ** [Metadata](#API_GetReservationPurchaseRecommendation_ResponseSyntax) **   <a name="awscostmanagement-GetReservationPurchaseRecommendation-response-Metadata"></a>
Information about this specific recommendation call, such as the time stamp for when Cost Explorer generated this recommendation.  
Type: [ReservationPurchaseRecommendationMetadata](API_ReservationPurchaseRecommendationMetadata.md) object

 ** [NextPageToken](#API_GetReservationPurchaseRecommendation_ResponseSyntax) **   <a name="awscostmanagement-GetReservationPurchaseRecommendation-response-NextPageToken"></a>
The pagination token for the next set of retrievable results.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

 ** [Recommendations](#API_GetReservationPurchaseRecommendation_ResponseSyntax) **   <a name="awscostmanagement-GetReservationPurchaseRecommendation-response-Recommendations"></a>
Recommendations for reservations to purchase.  
Type: Array of [ReservationPurchaseRecommendation](API_ReservationPurchaseRecommendation.md) objects

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

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

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## See Also
<a name="API_GetReservationPurchaseRecommendation_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/ce-2017-10-25/GetReservationPurchaseRecommendation) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetReservationPurchaseRecommendation) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetReservationPurchaseRecommendation) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetReservationPurchaseRecommendation) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetReservationPurchaseRecommendation) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetReservationPurchaseRecommendation) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetReservationPurchaseRecommendation) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetReservationPurchaseRecommendation) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetReservationPurchaseRecommendation) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetReservationPurchaseRecommendation) 

# GetReservationUtilization
<a name="API_GetReservationUtilization"></a>

Retrieves the reservation utilization for your account. Management account in an organization have access to member accounts. You can filter data by dimensions in a time period. You can use `GetDimensionValues` to determine the possible dimension values. Currently, you can group only by `SUBSCRIPTION_ID`. 

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

```
{
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "Granularity": "string",
   "GroupBy": [ 
      { 
         "Key": "string",
         "Type": "string"
      }
   ],
   "MaxResults": number,
   "NextPageToken": "string",
   "SortBy": { 
      "Key": "string",
      "SortOrder": "string"
   },
   "TimePeriod": { 
      "End": "string",
      "Start": "string"
   }
}
```

## Request Parameters
<a name="API_GetReservationUtilization_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.

 ** [Filter](#API_GetReservationUtilization_RequestSyntax) **   <a name="awscostmanagement-GetReservationUtilization-request-Filter"></a>
Filters utilization data by dimensions. You can filter by the following dimensions:  
+ AZ
+ CACHE\$1ENGINE
+ DEPLOYMENT\$1OPTION
+ INSTANCE\$1TYPE
+ LINKED\$1ACCOUNT
+ OPERATING\$1SYSTEM
+ PLATFORM
+ REGION
+ SERVICE
**Note**  
If not specified, the `SERVICE` filter defaults to Amazon Elastic Compute Cloud - Compute. Supported values for `SERVICE` are Amazon Elastic Compute Cloud - Compute, Amazon Relational Database Service, Amazon ElastiCache, Amazon Redshift, and Amazon Elasticsearch Service. The value for the `SERVICE` filter should not exceed "1".
+ SCOPE
+ TENANCY
 `GetReservationUtilization` uses the same [Expression](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html) object as the other operations, but only `AND` is supported among each dimension, and nesting is supported up to only one level deep. If there are multiple values for a dimension, they are OR'd together.  
Type: [Expression](API_Expression.md) object  
Required: No

 ** [Granularity](#API_GetReservationUtilization_RequestSyntax) **   <a name="awscostmanagement-GetReservationUtilization-request-Granularity"></a>
If `GroupBy` is set, `Granularity` can't be set. If `Granularity` isn't set, the response object doesn't include `Granularity`, either `MONTHLY` or `DAILY`. If both `GroupBy` and `Granularity` aren't set, `GetReservationUtilization` defaults to `DAILY`.  
The `GetReservationUtilization` operation supports only `DAILY` and `MONTHLY` granularities.  
Type: String  
Valid Values: `DAILY | MONTHLY | HOURLY`   
Required: No

 ** [GroupBy](#API_GetReservationUtilization_RequestSyntax) **   <a name="awscostmanagement-GetReservationUtilization-request-GroupBy"></a>
Groups only by `SUBSCRIPTION_ID`. Metadata is included.  
Type: Array of [GroupDefinition](API_GroupDefinition.md) objects  
Required: No

 ** [MaxResults](#API_GetReservationUtilization_RequestSyntax) **   <a name="awscostmanagement-GetReservationUtilization-request-MaxResults"></a>
The maximum number of objects that you returned for this request. If more objects are available, in the response, AWS provides a NextPageToken value that you can use in a subsequent call to get the next batch of objects.  
Type: Integer  
Valid Range: Minimum value of 1.  
Required: No

 ** [NextPageToken](#API_GetReservationUtilization_RequestSyntax) **   <a name="awscostmanagement-GetReservationUtilization-request-NextPageToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [SortBy](#API_GetReservationUtilization_RequestSyntax) **   <a name="awscostmanagement-GetReservationUtilization-request-SortBy"></a>
The value that you want to sort the data by.  
The following values are supported for `Key`:  
+  `UtilizationPercentage` 
+  `UtilizationPercentageInUnits` 
+  `PurchasedHours` 
+  `PurchasedUnits` 
+  `TotalActualHours` 
+  `TotalActualUnits` 
+  `UnusedHours` 
+  `UnusedUnits` 
+  `OnDemandCostOfRIHoursUsed` 
+  `NetRISavings` 
+  `TotalPotentialRISavings` 
+  `AmortizedUpfrontFee` 
+  `AmortizedRecurringFee` 
+  `TotalAmortizedFee` 
+  `RICostForUnusedHours` 
+  `RealizedSavings` 
+  `UnrealizedSavings` 
The supported values for `SortOrder` are `ASCENDING` and `DESCENDING`.  
Type: [SortDefinition](API_SortDefinition.md) object  
Required: No

 ** [TimePeriod](#API_GetReservationUtilization_RequestSyntax) **   <a name="awscostmanagement-GetReservationUtilization-request-TimePeriod"></a>
Sets the start and end dates for retrieving Reserved Instance (RI) utilization. The start date is inclusive, but the end date is exclusive. For example, if `start` is `2017-01-01` and `end` is `2017-05-01`, then the cost and usage data is retrieved from `2017-01-01` up to and including `2017-04-30` but not including `2017-05-01`.   
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

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

```
{
   "NextPageToken": "string",
   "Total": { 
      "AmortizedRecurringFee": "string",
      "AmortizedUpfrontFee": "string",
      "NetRISavings": "string",
      "OnDemandCostOfRIHoursUsed": "string",
      "PurchasedHours": "string",
      "PurchasedUnits": "string",
      "RealizedSavings": "string",
      "RICostForUnusedHours": "string",
      "TotalActualHours": "string",
      "TotalActualUnits": "string",
      "TotalAmortizedFee": "string",
      "TotalPotentialRISavings": "string",
      "UnrealizedSavings": "string",
      "UnusedHours": "string",
      "UnusedUnits": "string",
      "UtilizationPercentage": "string",
      "UtilizationPercentageInUnits": "string"
   },
   "UtilizationsByTime": [ 
      { 
         "Groups": [ 
            { 
               "Attributes": { 
                  "string" : "string" 
               },
               "Key": "string",
               "Utilization": { 
                  "AmortizedRecurringFee": "string",
                  "AmortizedUpfrontFee": "string",
                  "NetRISavings": "string",
                  "OnDemandCostOfRIHoursUsed": "string",
                  "PurchasedHours": "string",
                  "PurchasedUnits": "string",
                  "RealizedSavings": "string",
                  "RICostForUnusedHours": "string",
                  "TotalActualHours": "string",
                  "TotalActualUnits": "string",
                  "TotalAmortizedFee": "string",
                  "TotalPotentialRISavings": "string",
                  "UnrealizedSavings": "string",
                  "UnusedHours": "string",
                  "UnusedUnits": "string",
                  "UtilizationPercentage": "string",
                  "UtilizationPercentageInUnits": "string"
               },
               "Value": "string"
            }
         ],
         "TimePeriod": { 
            "End": "string",
            "Start": "string"
         },
         "Total": { 
            "AmortizedRecurringFee": "string",
            "AmortizedUpfrontFee": "string",
            "NetRISavings": "string",
            "OnDemandCostOfRIHoursUsed": "string",
            "PurchasedHours": "string",
            "PurchasedUnits": "string",
            "RealizedSavings": "string",
            "RICostForUnusedHours": "string",
            "TotalActualHours": "string",
            "TotalActualUnits": "string",
            "TotalAmortizedFee": "string",
            "TotalPotentialRISavings": "string",
            "UnrealizedSavings": "string",
            "UnusedHours": "string",
            "UnusedUnits": "string",
            "UtilizationPercentage": "string",
            "UtilizationPercentageInUnits": "string"
         }
      }
   ]
}
```

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

 ** [NextPageToken](#API_GetReservationUtilization_ResponseSyntax) **   <a name="awscostmanagement-GetReservationUtilization-response-NextPageToken"></a>
The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

 ** [Total](#API_GetReservationUtilization_ResponseSyntax) **   <a name="awscostmanagement-GetReservationUtilization-response-Total"></a>
The total amount of time that you used your Reserved Instances (RIs).  
Type: [ReservationAggregates](API_ReservationAggregates.md) object

 ** [UtilizationsByTime](#API_GetReservationUtilization_ResponseSyntax) **   <a name="awscostmanagement-GetReservationUtilization-response-UtilizationsByTime"></a>
The amount of time that you used your Reserved Instances (RIs).  
Type: Array of [UtilizationByTime](API_UtilizationByTime.md) objects

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

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

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## Examples
<a name="API_GetReservationUtilization_Examples"></a>

### Example
<a name="API_GetReservationUtilization_Example_1"></a>

The following is a sample request and response of the `GetReservationUtilization` operation that enables you to retrieve your RI utilization for all `t2.nano` instance types from 2017-01-01 to 2017-05-01.

#### Sample Request
<a name="API_GetReservationUtilization_Example_1_Request"></a>

```
POST / HTTP/1.1
Host: ce.us-east-1.amazonaws.com
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid,Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: AWSInsightsIndexService.GetReservationUtilization
{
  "TimePeriod": {
    "Start":"2017-07-01",
    "End": "2017-10-01"
  },
  "Filter": {      
    "Dimensions": {
      "Key": "INSTANCE_TYPE",
      "Values": [
        "t2.nano"
      ]
    }
  },
  "GroupBy":[
    {
      "Type":"Dimension",
      "Key":"SUBSCRIPTION_ID"
    }
  ]
}
```

#### Sample Response
<a name="API_GetReservationUtilization_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "UtilizationsByTime": [{
    "Groups": [{
      "Attributes": {
        "AccountId": "0123456789",
        "AccountName": null,
        "AvailabilityZone": "",
        "CancellationDateTime": "2019-09-28T15:22:31.000Z",
        "EndDateTime": "2019-09-28T15:22:31.000Z",
        "InstanceType": "t2.nano",
        "LeaseId": null,
        "NumberOfInstances": "1",
        "OfferingType": "convertible",
        "Platform": "Linux/UNIX",
        "Region": "us-east-1",
        "Scope": "Region",
        "StartDateTime": "2016-09-28T15:22:32.000Z",
        "SubscriptionId": "359809062",
        "SubscriptionStatus": "Active",
        "SubscriptionType": "All Upfront",
        "Tenancy": "Shared"
      },
      "Key": "SUBSCRIPTION_ID",
      "Utilization": {
        "PurchasedHours": 2208,
        "TotalActualHours": 2208,
        "UnusedHours": 0,
        "UtilizationPercentage": 100
      },
      "Value": "359809062"
    },
    {
      "Attributes": {
        "": "0123456789",
        "AccountName": null,
        "AvailabilityZone": "us-east-1d",
        "CancellationDateTime": "2017-09-28T15:22:31.000Z",
        "EndDateTime": "2017-09-28T15:22:31.000Z",
        "InstanceType": "t2.nano",
        "LeaseId": null,
        "NumberOfInstances": "1",
        "OfferingType": "Standard",
        "Platform": "Linux/UNIX",
        "Region": "us-east-1",
        "Scope": "Availability Zone",
        "StartDateTime": "2016-09-28T15:22:32.000Z",
        "SubscriptionId": "359809070",
        "SubscriptionStatus": "Active",
        "SubscriptionType": "All Upfront",
        "Tenancy": "Shared"
      },
      "Key": "SUBSCRIPTION_ID",
      "Utilization": {
        "PurchasedHours": 2151,
        "TotalActualHours": 2151,
        "UnusedHours": 0,
        "UtilizationPercentage": 100
      },
      "Value": "359809070"
    },
    {
      "Attributes": {
        "AccountId": "0123456789",
        "AccountName": null,
        "AvailabilityZone": "us-west-2a",
        "CancellationDateTime": "2017-09-20T04:06:02.000Z",
        "EndDateTime": "2017-09-20T04:06:02.000Z",
        "InstanceType": "t2.nano",
        "LeaseId": null,
        "NumberOfInstances": "1",
        "OfferingType": "Standard",
        "Platform": "Linux/UNIX",
        "Region": "us-west-2",
        "Scope": "Availability Zone",
        "StartDateTime": "2016-09-20T04:06:03.000Z",
        "SubscriptionId": "353571154",
        "SubscriptionStatus": "Active",
        "SubscriptionType": "Partial Upfront",
        "Tenancy": "Shared"
      },
      "Key": "SUBSCRIPTION_ID",
      "Utilization": {
        "PurchasedHours": 1948,
        "TotalActualHours": 0,
        "UnusedHours": 1948,
        "UtilizationPercentage": 0
      },
      "Value": "353571154"
    }
  ],
  "TimePeriod": {
    "End": "2017-10-01",
    "Start": "2017-07-01"
  },
  "Total": {
    "PurchasedHours": 6307,
    "TotalActualHours": 4359,
    "UnusedHours": 1948,
    "UtilizationPercentage": 69.11368320913270968764864436340574
  }
  }]
}
```

## See Also
<a name="API_GetReservationUtilization_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/ce-2017-10-25/GetReservationUtilization) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetReservationUtilization) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetReservationUtilization) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetReservationUtilization) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetReservationUtilization) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetReservationUtilization) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetReservationUtilization) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetReservationUtilization) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetReservationUtilization) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetReservationUtilization) 

# GetRightsizingRecommendation
<a name="API_GetRightsizingRecommendation"></a>

Creates recommendations that help you save cost by identifying idle and underutilized Amazon EC2 instances.

Recommendations are generated to either downsize or terminate instances, along with providing savings detail and metrics. For more information about calculation and function, see [Optimizing Your Cost with Rightsizing Recommendations](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/ce-rightsizing.html) in the * AWS Billing and Cost Management User Guide*.

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

```
{
   "Configuration": { 
      "BenefitsConsidered": boolean,
      "RecommendationTarget": "string"
   },
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "NextPageToken": "string",
   "PageSize": number,
   "Service": "string"
}
```

## Request Parameters
<a name="API_GetRightsizingRecommendation_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.

 ** [Configuration](#API_GetRightsizingRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetRightsizingRecommendation-request-Configuration"></a>
You can use Configuration to customize recommendations across two attributes. You can choose to view recommendations for instances within the same instance families or across different instance families. You can also choose to view your estimated savings that are associated with recommendations with consideration of existing Savings Plans or RI benefits, or neither.   
Type: [RightsizingRecommendationConfiguration](API_RightsizingRecommendationConfiguration.md) object  
Required: No

 ** [Filter](#API_GetRightsizingRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetRightsizingRecommendation-request-Filter"></a>
Use `Expression` to filter in various Cost Explorer APIs.  
Not all `Expression` types are supported in each API. Refer to the documentation for each specific API to see what is supported.  
There are two patterns:  
+ Simple dimension values.
  + There are three types of simple dimension values: `CostCategories`, `Tags`, and `Dimensions`.
    + Specify the `CostCategories` field to define a filter that acts on Cost Categories.
    + Specify the `Tags` field to define a filter that acts on Cost Allocation Tags.
    + Specify the `Dimensions` field to define a filter that acts on the [https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html).
  + For each filter type, you can set the dimension name and values for the filters that you plan to use.
    + For example, you can filter for `REGION==us-east-1 OR REGION==us-west-1`. For `GetRightsizingRecommendation`, the Region is a full name (for example, `REGION==US East (N. Virginia)`.
    + The corresponding `Expression` for this example is as follows: `{ "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } }` 
    + As shown in the previous example, lists of dimension values are combined with `OR` when applying the filter.
  + You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
    + For example, you can filter for linked account names that start with "a".
    + The corresponding `Expression` for this example is as follows: `{ "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], "Values": [ "a" ] } }` 
+ Compound `Expression` types with logical operations.
  + You can use multiple `Expression` types and the logical operators `AND/OR/NOT` to create a list of one or more `Expression` objects. By doing this, you can filter by more advanced options.
  + For example, you can filter by `((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)`.
  + The corresponding `Expression` for this example is as follows: `{ "And": [ {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } ` 
**Note**  
Because each `Expression` can have only one operator, the service returns an error if more than one is specified. The following example shows an `Expression` object that creates an error: ` { "And": [ ... ], "Dimensions": { "Key": "USAGE_TYPE", "Values": [ "DataTransfer" ] } } `   
The following is an example of the corresponding error message: `"Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"` 
For the `GetRightsizingRecommendation` action, a combination of OR and NOT isn't supported. OR isn't supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited to `LINKED_ACCOUNT`, `REGION`, or `RIGHTSIZING_TYPE`.  
For the `GetReservationPurchaseRecommendation` action, only NOT is supported. AND and OR aren't supported. Dimensions are limited to `LINKED_ACCOUNT`.
Type: [Expression](API_Expression.md) object  
Required: No

 ** [NextPageToken](#API_GetRightsizingRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetRightsizingRecommendation-request-NextPageToken"></a>
The pagination token that indicates the next set of results that you want to retrieve.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [PageSize](#API_GetRightsizingRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetRightsizingRecommendation-request-PageSize"></a>
The number of recommendations that you want returned in a single response object.  
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 6000.  
Required: No

 ** [Service](#API_GetRightsizingRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetRightsizingRecommendation-request-Service"></a>
The specific service that you want recommendations for. The only valid value for `GetRightsizingRecommendation` is "`AmazonEC2`".  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: Yes

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

```
{
   "Configuration": { 
      "BenefitsConsidered": boolean,
      "RecommendationTarget": "string"
   },
   "Metadata": { 
      "AdditionalMetadata": "string",
      "GenerationTimestamp": "string",
      "LookbackPeriodInDays": "string",
      "RecommendationId": "string"
   },
   "NextPageToken": "string",
   "RightsizingRecommendations": [ 
      { 
         "AccountId": "string",
         "CurrentInstance": { 
            "CurrencyCode": "string",
            "InstanceName": "string",
            "MonthlyCost": "string",
            "OnDemandHoursInLookbackPeriod": "string",
            "ReservationCoveredHoursInLookbackPeriod": "string",
            "ResourceDetails": { 
               "EC2ResourceDetails": { 
                  "HourlyOnDemandRate": "string",
                  "InstanceType": "string",
                  "Memory": "string",
                  "NetworkPerformance": "string",
                  "Platform": "string",
                  "Region": "string",
                  "Sku": "string",
                  "Storage": "string",
                  "Vcpu": "string"
               }
            },
            "ResourceId": "string",
            "ResourceUtilization": { 
               "EC2ResourceUtilization": { 
                  "DiskResourceUtilization": { 
                     "DiskReadBytesPerSecond": "string",
                     "DiskReadOpsPerSecond": "string",
                     "DiskWriteBytesPerSecond": "string",
                     "DiskWriteOpsPerSecond": "string"
                  },
                  "EBSResourceUtilization": { 
                     "EbsReadBytesPerSecond": "string",
                     "EbsReadOpsPerSecond": "string",
                     "EbsWriteBytesPerSecond": "string",
                     "EbsWriteOpsPerSecond": "string"
                  },
                  "MaxCpuUtilizationPercentage": "string",
                  "MaxMemoryUtilizationPercentage": "string",
                  "MaxStorageUtilizationPercentage": "string",
                  "NetworkResourceUtilization": { 
                     "NetworkInBytesPerSecond": "string",
                     "NetworkOutBytesPerSecond": "string",
                     "NetworkPacketsInPerSecond": "string",
                     "NetworkPacketsOutPerSecond": "string"
                  }
               }
            },
            "SavingsPlansCoveredHoursInLookbackPeriod": "string",
            "Tags": [ 
               { 
                  "Key": "string",
                  "MatchOptions": [ "string" ],
                  "Values": [ "string" ]
               }
            ],
            "TotalRunningHoursInLookbackPeriod": "string"
         },
         "FindingReasonCodes": [ "string" ],
         "ModifyRecommendationDetail": { 
            "TargetInstances": [ 
               { 
                  "CurrencyCode": "string",
                  "DefaultTargetInstance": boolean,
                  "EstimatedMonthlyCost": "string",
                  "EstimatedMonthlySavings": "string",
                  "ExpectedResourceUtilization": { 
                     "EC2ResourceUtilization": { 
                        "DiskResourceUtilization": { 
                           "DiskReadBytesPerSecond": "string",
                           "DiskReadOpsPerSecond": "string",
                           "DiskWriteBytesPerSecond": "string",
                           "DiskWriteOpsPerSecond": "string"
                        },
                        "EBSResourceUtilization": { 
                           "EbsReadBytesPerSecond": "string",
                           "EbsReadOpsPerSecond": "string",
                           "EbsWriteBytesPerSecond": "string",
                           "EbsWriteOpsPerSecond": "string"
                        },
                        "MaxCpuUtilizationPercentage": "string",
                        "MaxMemoryUtilizationPercentage": "string",
                        "MaxStorageUtilizationPercentage": "string",
                        "NetworkResourceUtilization": { 
                           "NetworkInBytesPerSecond": "string",
                           "NetworkOutBytesPerSecond": "string",
                           "NetworkPacketsInPerSecond": "string",
                           "NetworkPacketsOutPerSecond": "string"
                        }
                     }
                  },
                  "PlatformDifferences": [ "string" ],
                  "ResourceDetails": { 
                     "EC2ResourceDetails": { 
                        "HourlyOnDemandRate": "string",
                        "InstanceType": "string",
                        "Memory": "string",
                        "NetworkPerformance": "string",
                        "Platform": "string",
                        "Region": "string",
                        "Sku": "string",
                        "Storage": "string",
                        "Vcpu": "string"
                     }
                  }
               }
            ]
         },
         "RightsizingType": "string",
         "TerminateRecommendationDetail": { 
            "CurrencyCode": "string",
            "EstimatedMonthlySavings": "string"
         }
      }
   ],
   "Summary": { 
      "EstimatedTotalMonthlySavingsAmount": "string",
      "SavingsCurrencyCode": "string",
      "SavingsPercentage": "string",
      "TotalRecommendationCount": "string"
   }
}
```

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

 ** [Configuration](#API_GetRightsizingRecommendation_ResponseSyntax) **   <a name="awscostmanagement-GetRightsizingRecommendation-response-Configuration"></a>
You can use Configuration to customize recommendations across two attributes. You can choose to view recommendations for instances within the same instance families or across different instance families. You can also choose to view your estimated savings that are associated with recommendations with consideration of existing Savings Plans or RI benefits, or neither.   
Type: [RightsizingRecommendationConfiguration](API_RightsizingRecommendationConfiguration.md) object

 ** [Metadata](#API_GetRightsizingRecommendation_ResponseSyntax) **   <a name="awscostmanagement-GetRightsizingRecommendation-response-Metadata"></a>
Information regarding this specific recommendation set.  
Type: [RightsizingRecommendationMetadata](API_RightsizingRecommendationMetadata.md) object

 ** [NextPageToken](#API_GetRightsizingRecommendation_ResponseSyntax) **   <a name="awscostmanagement-GetRightsizingRecommendation-response-NextPageToken"></a>
The token to retrieve the next set of results.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

 ** [RightsizingRecommendations](#API_GetRightsizingRecommendation_ResponseSyntax) **   <a name="awscostmanagement-GetRightsizingRecommendation-response-RightsizingRecommendations"></a>
Recommendations to rightsize resources.  
Type: Array of [RightsizingRecommendation](API_RightsizingRecommendation.md) objects

 ** [Summary](#API_GetRightsizingRecommendation_ResponseSyntax) **   <a name="awscostmanagement-GetRightsizingRecommendation-response-Summary"></a>
Summary of this recommendation set.  
Type: [RightsizingRecommendationSummary](API_RightsizingRecommendationSummary.md) object

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

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

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## See Also
<a name="API_GetRightsizingRecommendation_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/ce-2017-10-25/GetRightsizingRecommendation) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetRightsizingRecommendation) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetRightsizingRecommendation) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetRightsizingRecommendation) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetRightsizingRecommendation) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetRightsizingRecommendation) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetRightsizingRecommendation) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetRightsizingRecommendation) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetRightsizingRecommendation) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetRightsizingRecommendation) 

# GetSavingsPlanPurchaseRecommendationDetails
<a name="API_GetSavingsPlanPurchaseRecommendationDetails"></a>

Retrieves the details for a Savings Plan recommendation. These details include the hourly data-points that construct the cost, coverage, and utilization charts.

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

```
{
   "RecommendationDetailId": "string"
}
```

## Request Parameters
<a name="API_GetSavingsPlanPurchaseRecommendationDetails_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.

 ** [RecommendationDetailId](#API_GetSavingsPlanPurchaseRecommendationDetails_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlanPurchaseRecommendationDetails-request-RecommendationDetailId"></a>
The ID that is associated with the Savings Plan recommendation.  
Type: String  
Length Constraints: Fixed length of 36.  
Pattern: `^[\S\s]{8}-[\S\s]{4}-[\S\s]{4}-[\S\s]{4}-[\S\s]{12}$`   
Required: Yes

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

```
{
   "RecommendationDetailData": { 
      "AccountId": "string",
      "AccountScope": "string",
      "CurrencyCode": "string",
      "CurrentAverageCoverage": "string",
      "CurrentAverageHourlyOnDemandSpend": "string",
      "CurrentMaximumHourlyOnDemandSpend": "string",
      "CurrentMinimumHourlyOnDemandSpend": "string",
      "EstimatedAverageCoverage": "string",
      "EstimatedAverageUtilization": "string",
      "EstimatedMonthlySavingsAmount": "string",
      "EstimatedOnDemandCost": "string",
      "EstimatedOnDemandCostWithCurrentCommitment": "string",
      "EstimatedROI": "string",
      "EstimatedSavingsAmount": "string",
      "EstimatedSavingsPercentage": "string",
      "EstimatedSPCost": "string",
      "ExistingHourlyCommitment": "string",
      "GenerationTimestamp": "string",
      "HourlyCommitmentToPurchase": "string",
      "InstanceFamily": "string",
      "LatestUsageTimestamp": "string",
      "LookbackPeriodInDays": "string",
      "MetricsOverLookbackPeriod": [ 
         { 
            "CurrentCoverage": "string",
            "EstimatedCoverage": "string",
            "EstimatedNewCommitmentUtilization": "string",
            "EstimatedOnDemandCost": "string",
            "StartTime": "string"
         }
      ],
      "OfferingId": "string",
      "PaymentOption": "string",
      "Region": "string",
      "SavingsPlansType": "string",
      "TermInYears": "string",
      "UpfrontCost": "string"
   },
   "RecommendationDetailId": "string"
}
```

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

 ** [RecommendationDetailData](#API_GetSavingsPlanPurchaseRecommendationDetails_ResponseSyntax) **   <a name="awscostmanagement-GetSavingsPlanPurchaseRecommendationDetails-response-RecommendationDetailData"></a>
Contains detailed information about a specific Savings Plan recommendation.  
Type: [RecommendationDetailData](API_RecommendationDetailData.md) object

 ** [RecommendationDetailId](#API_GetSavingsPlanPurchaseRecommendationDetails_ResponseSyntax) **   <a name="awscostmanagement-GetSavingsPlanPurchaseRecommendationDetails-response-RecommendationDetailId"></a>
The ID that is associated with the Savings Plan recommendation.  
Type: String  
Length Constraints: Fixed length of 36.  
Pattern: `^[\S\s]{8}-[\S\s]{4}-[\S\s]{4}-[\S\s]{4}-[\S\s]{12}$` 

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

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

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## See Also
<a name="API_GetSavingsPlanPurchaseRecommendationDetails_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/ce-2017-10-25/GetSavingsPlanPurchaseRecommendationDetails) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetSavingsPlanPurchaseRecommendationDetails) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetSavingsPlanPurchaseRecommendationDetails) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetSavingsPlanPurchaseRecommendationDetails) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetSavingsPlanPurchaseRecommendationDetails) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetSavingsPlanPurchaseRecommendationDetails) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetSavingsPlanPurchaseRecommendationDetails) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetSavingsPlanPurchaseRecommendationDetails) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetSavingsPlanPurchaseRecommendationDetails) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetSavingsPlanPurchaseRecommendationDetails) 

# GetSavingsPlansCoverage
<a name="API_GetSavingsPlansCoverage"></a>

Retrieves the Savings Plans covered for your account. This enables you to see how much of your cost is covered by a Savings Plan. An organization’s management account can see the coverage of the associated member accounts. This supports dimensions, cost categories, and nested expressions. For any time period, you can filter data for Savings Plans usage with the following dimensions:
+  `LINKED_ACCOUNT` 
+  `REGION` 
+  `SERVICE` 
+  `INSTANCE_FAMILY` 

To determine valid values for a dimension, use the `GetDimensionValues` operation.

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

```
{
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "Granularity": "string",
   "GroupBy": [ 
      { 
         "Key": "string",
         "Type": "string"
      }
   ],
   "MaxResults": number,
   "Metrics": [ "string" ],
   "NextToken": "string",
   "SortBy": { 
      "Key": "string",
      "SortOrder": "string"
   },
   "TimePeriod": { 
      "End": "string",
      "Start": "string"
   }
}
```

## Request Parameters
<a name="API_GetSavingsPlansCoverage_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.

 ** [Filter](#API_GetSavingsPlansCoverage_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansCoverage-request-Filter"></a>
Filters Savings Plans coverage data by dimensions. You can filter data for Savings Plans usage with the following dimensions:  
+  `LINKED_ACCOUNT` 
+  `REGION` 
+  `SERVICE` 
+  `INSTANCE_FAMILY` 
 `GetSavingsPlansCoverage` uses the same [Expression](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html) object as the other operations, but only `AND` is supported among each dimension. If there are multiple values for a dimension, they are OR'd together.  
Cost category is also supported.  
Type: [Expression](API_Expression.md) object  
Required: No

 ** [Granularity](#API_GetSavingsPlansCoverage_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansCoverage-request-Granularity"></a>
The granularity of the Amazon Web Services cost data for your Savings Plans. `Granularity` can't be set if `GroupBy` is set.  
The `GetSavingsPlansCoverage` operation supports only `DAILY` and `MONTHLY` granularities.  
Type: String  
Valid Values: `DAILY | MONTHLY | HOURLY`   
Required: No

 ** [GroupBy](#API_GetSavingsPlansCoverage_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansCoverage-request-GroupBy"></a>
You can group the data using the attributes `INSTANCE_FAMILY`, `REGION`, or `SERVICE`.  
Type: Array of [GroupDefinition](API_GroupDefinition.md) objects  
Required: No

 ** [MaxResults](#API_GetSavingsPlansCoverage_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansCoverage-request-MaxResults"></a>
The number of items to be returned in a response. The default is `20`, with a minimum value of `1`.  
Type: Integer  
Valid Range: Minimum value of 1.  
Required: No

 ** [Metrics](#API_GetSavingsPlansCoverage_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansCoverage-request-Metrics"></a>
The measurement that you want your Savings Plans coverage reported in. The only valid value is `SpendCoveredBySavingsPlans`.  
Type: Array of strings  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

 ** [NextToken](#API_GetSavingsPlansCoverage_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansCoverage-request-NextToken"></a>
The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [SortBy](#API_GetSavingsPlansCoverage_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansCoverage-request-SortBy"></a>
The value that you want to sort the data by.  
The following values are supported for `Key`:  
+  `SpendCoveredBySavingsPlan` 
+  `OnDemandCost` 
+  `CoveragePercentage` 
+  `TotalCost` 
+  `InstanceFamily` 
+  `Region` 
+  `Service` 
The supported values for `SortOrder` are `ASCENDING` and `DESCENDING`.  
Type: [SortDefinition](API_SortDefinition.md) object  
Required: No

 ** [TimePeriod](#API_GetSavingsPlansCoverage_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansCoverage-request-TimePeriod"></a>
The time period that you want the usage and costs for. The `Start` date must be within 13 months. The `End` date must be after the `Start` date, and before the current date. Future dates can't be used as an `End` date.  
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

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

```
{
   "NextToken": "string",
   "SavingsPlansCoverages": [ 
      { 
         "Attributes": { 
            "string" : "string" 
         },
         "Coverage": { 
            "CoveragePercentage": "string",
            "OnDemandCost": "string",
            "SpendCoveredBySavingsPlans": "string",
            "TotalCost": "string"
         },
         "TimePeriod": { 
            "End": "string",
            "Start": "string"
         }
      }
   ]
}
```

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

 ** [NextToken](#API_GetSavingsPlansCoverage_ResponseSyntax) **   <a name="awscostmanagement-GetSavingsPlansCoverage-response-NextToken"></a>
The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

 ** [SavingsPlansCoverages](#API_GetSavingsPlansCoverage_ResponseSyntax) **   <a name="awscostmanagement-GetSavingsPlansCoverage-response-SavingsPlansCoverages"></a>
The amount of spend that your Savings Plans covered.  
Type: Array of [SavingsPlansCoverage](API_SavingsPlansCoverage.md) objects

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

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

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## See Also
<a name="API_GetSavingsPlansCoverage_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/ce-2017-10-25/GetSavingsPlansCoverage) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetSavingsPlansCoverage) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetSavingsPlansCoverage) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetSavingsPlansCoverage) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetSavingsPlansCoverage) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetSavingsPlansCoverage) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetSavingsPlansCoverage) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetSavingsPlansCoverage) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetSavingsPlansCoverage) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetSavingsPlansCoverage) 

# GetSavingsPlansPurchaseRecommendation
<a name="API_GetSavingsPlansPurchaseRecommendation"></a>

Retrieves the Savings Plans recommendations for your account. First use `StartSavingsPlansPurchaseRecommendationGeneration` to generate a new set of recommendations, and then use `GetSavingsPlansPurchaseRecommendation` to retrieve them.

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

```
{
   "AccountScope": "string",
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "LookbackPeriodInDays": "string",
   "NextPageToken": "string",
   "PageSize": number,
   "PaymentOption": "string",
   "SavingsPlansType": "string",
   "TermInYears": "string"
}
```

## Request Parameters
<a name="API_GetSavingsPlansPurchaseRecommendation_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.

 ** [AccountScope](#API_GetSavingsPlansPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansPurchaseRecommendation-request-AccountScope"></a>
The account scope that you want your recommendations for. Amazon Web Services calculates recommendations including the management account and member accounts if the value is set to `PAYER`. If the value is `LINKED`, recommendations are calculated for individual member accounts only.  
Type: String  
Valid Values: `PAYER | LINKED`   
Required: No

 ** [Filter](#API_GetSavingsPlansPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansPurchaseRecommendation-request-Filter"></a>
You can filter your recommendations by Account ID with the `LINKED_ACCOUNT` dimension. To filter your recommendations by Account ID, specify `Key` as `LINKED_ACCOUNT` and `Value` as the comma-separated Acount ID(s) that you want to see Savings Plans purchase recommendations for.  
For GetSavingsPlansPurchaseRecommendation, the `Filter` doesn't include `CostCategories` or `Tags`. It only includes `Dimensions`. With `Dimensions`, `Key` must be `LINKED_ACCOUNT` and `Value` can be a single Account ID or multiple comma-separated Account IDs that you want to see Savings Plans Purchase Recommendations for. `AND` and `OR` operators are not supported.  
Type: [Expression](API_Expression.md) object  
Required: No

 ** [LookbackPeriodInDays](#API_GetSavingsPlansPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansPurchaseRecommendation-request-LookbackPeriodInDays"></a>
The lookback period that's used to generate the recommendation.  
Type: String  
Valid Values: `SEVEN_DAYS | THIRTY_DAYS | SIXTY_DAYS`   
Required: Yes

 ** [NextPageToken](#API_GetSavingsPlansPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansPurchaseRecommendation-request-NextPageToken"></a>
The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [PageSize](#API_GetSavingsPlansPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansPurchaseRecommendation-request-PageSize"></a>
The number of recommendations that you want returned in a single response object.  
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 6000.  
Required: No

 ** [PaymentOption](#API_GetSavingsPlansPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansPurchaseRecommendation-request-PaymentOption"></a>
The payment option that's used to generate these recommendations.  
Type: String  
Valid Values: `NO_UPFRONT | PARTIAL_UPFRONT | ALL_UPFRONT | LIGHT_UTILIZATION | MEDIUM_UTILIZATION | HEAVY_UTILIZATION`   
Required: Yes

 ** [SavingsPlansType](#API_GetSavingsPlansPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansPurchaseRecommendation-request-SavingsPlansType"></a>
The Savings Plans recommendation type that's requested.  
Type: String  
Valid Values: `COMPUTE_SP | EC2_INSTANCE_SP | SAGEMAKER_SP | DATABASE_SP`   
Required: Yes

 ** [TermInYears](#API_GetSavingsPlansPurchaseRecommendation_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansPurchaseRecommendation-request-TermInYears"></a>
The savings plan recommendation term that's used to generate these recommendations.  
Type: String  
Valid Values: `ONE_YEAR | THREE_YEARS`   
Required: Yes

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

```
{
   "Metadata": { 
      "AdditionalMetadata": "string",
      "GenerationTimestamp": "string",
      "RecommendationId": "string"
   },
   "NextPageToken": "string",
   "SavingsPlansPurchaseRecommendation": { 
      "AccountScope": "string",
      "LookbackPeriodInDays": "string",
      "PaymentOption": "string",
      "SavingsPlansPurchaseRecommendationDetails": [ 
         { 
            "AccountId": "string",
            "CurrencyCode": "string",
            "CurrentAverageHourlyOnDemandSpend": "string",
            "CurrentMaximumHourlyOnDemandSpend": "string",
            "CurrentMinimumHourlyOnDemandSpend": "string",
            "EstimatedAverageUtilization": "string",
            "EstimatedMonthlySavingsAmount": "string",
            "EstimatedOnDemandCost": "string",
            "EstimatedOnDemandCostWithCurrentCommitment": "string",
            "EstimatedROI": "string",
            "EstimatedSavingsAmount": "string",
            "EstimatedSavingsPercentage": "string",
            "EstimatedSPCost": "string",
            "HourlyCommitmentToPurchase": "string",
            "RecommendationDetailId": "string",
            "SavingsPlansDetails": { 
               "InstanceFamily": "string",
               "OfferingId": "string",
               "Region": "string"
            },
            "UpfrontCost": "string"
         }
      ],
      "SavingsPlansPurchaseRecommendationSummary": { 
         "CurrencyCode": "string",
         "CurrentOnDemandSpend": "string",
         "DailyCommitmentToPurchase": "string",
         "EstimatedMonthlySavingsAmount": "string",
         "EstimatedOnDemandCostWithCurrentCommitment": "string",
         "EstimatedROI": "string",
         "EstimatedSavingsAmount": "string",
         "EstimatedSavingsPercentage": "string",
         "EstimatedTotalCost": "string",
         "HourlyCommitmentToPurchase": "string",
         "TotalRecommendationCount": "string"
      },
      "SavingsPlansType": "string",
      "TermInYears": "string"
   }
}
```

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

 ** [Metadata](#API_GetSavingsPlansPurchaseRecommendation_ResponseSyntax) **   <a name="awscostmanagement-GetSavingsPlansPurchaseRecommendation-response-Metadata"></a>
Information that regards this specific recommendation set.  
Type: [SavingsPlansPurchaseRecommendationMetadata](API_SavingsPlansPurchaseRecommendationMetadata.md) object

 ** [NextPageToken](#API_GetSavingsPlansPurchaseRecommendation_ResponseSyntax) **   <a name="awscostmanagement-GetSavingsPlansPurchaseRecommendation-response-NextPageToken"></a>
The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

 ** [SavingsPlansPurchaseRecommendation](#API_GetSavingsPlansPurchaseRecommendation_ResponseSyntax) **   <a name="awscostmanagement-GetSavingsPlansPurchaseRecommendation-response-SavingsPlansPurchaseRecommendation"></a>
Contains your request parameters, Savings Plan Recommendations Summary, and Details.  
Type: [SavingsPlansPurchaseRecommendation](API_SavingsPlansPurchaseRecommendation.md) object

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

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

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## See Also
<a name="API_GetSavingsPlansPurchaseRecommendation_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/ce-2017-10-25/GetSavingsPlansPurchaseRecommendation) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetSavingsPlansPurchaseRecommendation) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetSavingsPlansPurchaseRecommendation) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetSavingsPlansPurchaseRecommendation) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetSavingsPlansPurchaseRecommendation) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetSavingsPlansPurchaseRecommendation) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetSavingsPlansPurchaseRecommendation) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetSavingsPlansPurchaseRecommendation) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetSavingsPlansPurchaseRecommendation) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetSavingsPlansPurchaseRecommendation) 

# GetSavingsPlansUtilization
<a name="API_GetSavingsPlansUtilization"></a>

Retrieves the Savings Plans utilization for your account across date ranges with daily or monthly granularity. Management account in an organization have access to member accounts. You can use `GetDimensionValues` in `SAVINGS_PLANS` to determine the possible dimension values.

**Note**  
You can't group by any dimension values for `GetSavingsPlansUtilization`.

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

```
{
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "Granularity": "string",
   "SortBy": { 
      "Key": "string",
      "SortOrder": "string"
   },
   "TimePeriod": { 
      "End": "string",
      "Start": "string"
   }
}
```

## Request Parameters
<a name="API_GetSavingsPlansUtilization_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.

 ** [Filter](#API_GetSavingsPlansUtilization_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilization-request-Filter"></a>
Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data with the following dimensions:  
+  `LINKED_ACCOUNT` 
+  `SAVINGS_PLAN_ARN` 
+  `SAVINGS_PLANS_TYPE` 
+  `REGION` 
+  `PAYMENT_OPTION` 
+  `INSTANCE_TYPE_FAMILY` 
 `GetSavingsPlansUtilization` uses the same [Expression](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html) object as the other operations, but only `AND` is supported among each dimension.  
Type: [Expression](API_Expression.md) object  
Required: No

 ** [Granularity](#API_GetSavingsPlansUtilization_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilization-request-Granularity"></a>
The granularity of the Amazon Web Services utillization data for your Savings Plans.  
The `GetSavingsPlansUtilization` operation supports only `DAILY` and `MONTHLY` granularities.  
Type: String  
Valid Values: `DAILY | MONTHLY | HOURLY`   
Required: No

 ** [SortBy](#API_GetSavingsPlansUtilization_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilization-request-SortBy"></a>
The value that you want to sort the data by.  
The following values are supported for `Key`:  
+  `UtilizationPercentage` 
+  `TotalCommitment` 
+  `UsedCommitment` 
+  `UnusedCommitment` 
+  `NetSavings` 
The supported values for `SortOrder` are `ASCENDING` and `DESCENDING`.  
Type: [SortDefinition](API_SortDefinition.md) object  
Required: No

 ** [TimePeriod](#API_GetSavingsPlansUtilization_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilization-request-TimePeriod"></a>
The time period that you want the usage and costs for. The `Start` date must be within 13 months. The `End` date must be after the `Start` date, and before the current date. Future dates can't be used as an `End` date.  
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

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

```
{
   "SavingsPlansUtilizationsByTime": [ 
      { 
         "AmortizedCommitment": { 
            "AmortizedRecurringCommitment": "string",
            "AmortizedUpfrontCommitment": "string",
            "TotalAmortizedCommitment": "string"
         },
         "Savings": { 
            "NetSavings": "string",
            "OnDemandCostEquivalent": "string"
         },
         "TimePeriod": { 
            "End": "string",
            "Start": "string"
         },
         "Utilization": { 
            "TotalCommitment": "string",
            "UnusedCommitment": "string",
            "UsedCommitment": "string",
            "UtilizationPercentage": "string"
         }
      }
   ],
   "Total": { 
      "AmortizedCommitment": { 
         "AmortizedRecurringCommitment": "string",
         "AmortizedUpfrontCommitment": "string",
         "TotalAmortizedCommitment": "string"
      },
      "Savings": { 
         "NetSavings": "string",
         "OnDemandCostEquivalent": "string"
      },
      "Utilization": { 
         "TotalCommitment": "string",
         "UnusedCommitment": "string",
         "UsedCommitment": "string",
         "UtilizationPercentage": "string"
      }
   }
}
```

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

 ** [SavingsPlansUtilizationsByTime](#API_GetSavingsPlansUtilization_ResponseSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilization-response-SavingsPlansUtilizationsByTime"></a>
The amount of cost/commitment that you used your Savings Plans. You can use it to specify date ranges.  
Type: Array of [SavingsPlansUtilizationByTime](API_SavingsPlansUtilizationByTime.md) objects

 ** [Total](#API_GetSavingsPlansUtilization_ResponseSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilization-response-Total"></a>
The total amount of cost/commitment that you used your Savings Plans, regardless of date ranges.  
Type: [SavingsPlansUtilizationAggregates](API_SavingsPlansUtilizationAggregates.md) object

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

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

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## See Also
<a name="API_GetSavingsPlansUtilization_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/ce-2017-10-25/GetSavingsPlansUtilization) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetSavingsPlansUtilization) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetSavingsPlansUtilization) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetSavingsPlansUtilization) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetSavingsPlansUtilization) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetSavingsPlansUtilization) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetSavingsPlansUtilization) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetSavingsPlansUtilization) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetSavingsPlansUtilization) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetSavingsPlansUtilization) 

# GetSavingsPlansUtilizationDetails
<a name="API_GetSavingsPlansUtilizationDetails"></a>

Retrieves attribute data along with aggregate utilization and savings data for a given time period. This doesn't support granular or grouped data (daily/monthly) in response. You can't retrieve data by dates in a single response similar to `GetSavingsPlanUtilization`, but you have the option to make multiple calls to `GetSavingsPlanUtilizationDetails` by providing individual dates. You can use `GetDimensionValues` in `SAVINGS_PLANS` to determine the possible dimension values.

**Note**  
 `GetSavingsPlanUtilizationDetails` internally groups data by `SavingsPlansArn`.

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

```
{
   "DataType": [ "string" ],
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "MaxResults": number,
   "NextToken": "string",
   "SortBy": { 
      "Key": "string",
      "SortOrder": "string"
   },
   "TimePeriod": { 
      "End": "string",
      "Start": "string"
   }
}
```

## Request Parameters
<a name="API_GetSavingsPlansUtilizationDetails_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.

 ** [DataType](#API_GetSavingsPlansUtilizationDetails_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilizationDetails-request-DataType"></a>
The data type.  
Type: Array of strings  
Valid Values: `ATTRIBUTES | UTILIZATION | AMORTIZED_COMMITMENT | SAVINGS`   
Required: No

 ** [Filter](#API_GetSavingsPlansUtilizationDetails_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilizationDetails-request-Filter"></a>
Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data with the following dimensions:  
+  `LINKED_ACCOUNT` 
+  `SAVINGS_PLAN_ARN` 
+  `REGION` 
+  `PAYMENT_OPTION` 
+  `INSTANCE_TYPE_FAMILY` 
 `GetSavingsPlansUtilizationDetails` uses the same [Expression](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html) object as the other operations, but only `AND` is supported among each dimension.  
Type: [Expression](API_Expression.md) object  
Required: No

 ** [MaxResults](#API_GetSavingsPlansUtilizationDetails_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilizationDetails-request-MaxResults"></a>
The number of items to be returned in a response. The default is `20`, with a minimum value of `1`.  
Type: Integer  
Valid Range: Minimum value of 1.  
Required: No

 ** [NextToken](#API_GetSavingsPlansUtilizationDetails_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilizationDetails-request-NextToken"></a>
The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [SortBy](#API_GetSavingsPlansUtilizationDetails_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilizationDetails-request-SortBy"></a>
The value that you want to sort the data by.  
The following values are supported for `Key`:  
+  `UtilizationPercentage` 
+  `TotalCommitment` 
+  `UsedCommitment` 
+  `UnusedCommitment` 
+  `NetSavings` 
+  `AmortizedRecurringCommitment` 
+  `AmortizedUpfrontCommitment` 
The supported values for `SortOrder` are `ASCENDING` and `DESCENDING`.  
Type: [SortDefinition](API_SortDefinition.md) object  
Required: No

 ** [TimePeriod](#API_GetSavingsPlansUtilizationDetails_RequestSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilizationDetails-request-TimePeriod"></a>
The time period that you want the usage and costs for. The `Start` date must be within 13 months. The `End` date must be after the `Start` date, and before the current date. Future dates can't be used as an `End` date.  
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

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

```
{
   "NextToken": "string",
   "SavingsPlansUtilizationDetails": [ 
      { 
         "AmortizedCommitment": { 
            "AmortizedRecurringCommitment": "string",
            "AmortizedUpfrontCommitment": "string",
            "TotalAmortizedCommitment": "string"
         },
         "Attributes": { 
            "string" : "string" 
         },
         "Savings": { 
            "NetSavings": "string",
            "OnDemandCostEquivalent": "string"
         },
         "SavingsPlanArn": "string",
         "Utilization": { 
            "TotalCommitment": "string",
            "UnusedCommitment": "string",
            "UsedCommitment": "string",
            "UtilizationPercentage": "string"
         }
      }
   ],
   "TimePeriod": { 
      "End": "string",
      "Start": "string"
   },
   "Total": { 
      "AmortizedCommitment": { 
         "AmortizedRecurringCommitment": "string",
         "AmortizedUpfrontCommitment": "string",
         "TotalAmortizedCommitment": "string"
      },
      "Savings": { 
         "NetSavings": "string",
         "OnDemandCostEquivalent": "string"
      },
      "Utilization": { 
         "TotalCommitment": "string",
         "UnusedCommitment": "string",
         "UsedCommitment": "string",
         "UtilizationPercentage": "string"
      }
   }
}
```

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

 ** [NextToken](#API_GetSavingsPlansUtilizationDetails_ResponseSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilizationDetails-response-NextToken"></a>
The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

 ** [SavingsPlansUtilizationDetails](#API_GetSavingsPlansUtilizationDetails_ResponseSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilizationDetails-response-SavingsPlansUtilizationDetails"></a>
Retrieves a single daily or monthly Savings Plans utilization rate and details for your account.  
Type: Array of [SavingsPlansUtilizationDetail](API_SavingsPlansUtilizationDetail.md) objects

 ** [TimePeriod](#API_GetSavingsPlansUtilizationDetails_ResponseSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilizationDetails-response-TimePeriod"></a>
The time period of the request.   
Type: [DateInterval](API_DateInterval.md) object

 ** [Total](#API_GetSavingsPlansUtilizationDetails_ResponseSyntax) **   <a name="awscostmanagement-GetSavingsPlansUtilizationDetails-response-Total"></a>
The total Savings Plans utilization, regardless of time period.  
Type: [SavingsPlansUtilizationAggregates](API_SavingsPlansUtilizationAggregates.md) object

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

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

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## See Also
<a name="API_GetSavingsPlansUtilizationDetails_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/ce-2017-10-25/GetSavingsPlansUtilizationDetails) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetSavingsPlansUtilizationDetails) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetSavingsPlansUtilizationDetails) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetSavingsPlansUtilizationDetails) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetSavingsPlansUtilizationDetails) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetSavingsPlansUtilizationDetails) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetSavingsPlansUtilizationDetails) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetSavingsPlansUtilizationDetails) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetSavingsPlansUtilizationDetails) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetSavingsPlansUtilizationDetails) 

# GetTags
<a name="API_GetTags"></a>

Queries for available tag keys and tag values for a specified period. You can search the tag values for an arbitrary string. 

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

```
{
   "BillingViewArn": "string",
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "MaxResults": number,
   "NextPageToken": "string",
   "SearchString": "string",
   "SortBy": [ 
      { 
         "Key": "string",
         "SortOrder": "string"
      }
   ],
   "TagKey": "string",
   "TimePeriod": { 
      "End": "string",
      "Start": "string"
   }
}
```

## Request Parameters
<a name="API_GetTags_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.

 ** [BillingViewArn](#API_GetTags_RequestSyntax) **   <a name="awscostmanagement-GetTags-request-BillingViewArn"></a>
The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to AWS Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[-a-zA-Z0-9/:_+=.-@]{1,43}$`   
Required: No

 ** [Filter](#API_GetTags_RequestSyntax) **   <a name="awscostmanagement-GetTags-request-Filter"></a>
Use `Expression` to filter in various Cost Explorer APIs.  
Not all `Expression` types are supported in each API. Refer to the documentation for each specific API to see what is supported.  
There are two patterns:  
+ Simple dimension values.
  + There are three types of simple dimension values: `CostCategories`, `Tags`, and `Dimensions`.
    + Specify the `CostCategories` field to define a filter that acts on Cost Categories.
    + Specify the `Tags` field to define a filter that acts on Cost Allocation Tags.
    + Specify the `Dimensions` field to define a filter that acts on the [https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html).
  + For each filter type, you can set the dimension name and values for the filters that you plan to use.
    + For example, you can filter for `REGION==us-east-1 OR REGION==us-west-1`. For `GetRightsizingRecommendation`, the Region is a full name (for example, `REGION==US East (N. Virginia)`.
    + The corresponding `Expression` for this example is as follows: `{ "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } }` 
    + As shown in the previous example, lists of dimension values are combined with `OR` when applying the filter.
  + You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
    + For example, you can filter for linked account names that start with "a".
    + The corresponding `Expression` for this example is as follows: `{ "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], "Values": [ "a" ] } }` 
+ Compound `Expression` types with logical operations.
  + You can use multiple `Expression` types and the logical operators `AND/OR/NOT` to create a list of one or more `Expression` objects. By doing this, you can filter by more advanced options.
  + For example, you can filter by `((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)`.
  + The corresponding `Expression` for this example is as follows: `{ "And": [ {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } ` 
**Note**  
Because each `Expression` can have only one operator, the service returns an error if more than one is specified. The following example shows an `Expression` object that creates an error: ` { "And": [ ... ], "Dimensions": { "Key": "USAGE_TYPE", "Values": [ "DataTransfer" ] } } `   
The following is an example of the corresponding error message: `"Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"` 
For the `GetRightsizingRecommendation` action, a combination of OR and NOT isn't supported. OR isn't supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited to `LINKED_ACCOUNT`, `REGION`, or `RIGHTSIZING_TYPE`.  
For the `GetReservationPurchaseRecommendation` action, only NOT is supported. AND and OR aren't supported. Dimensions are limited to `LINKED_ACCOUNT`.
Type: [Expression](API_Expression.md) object  
Required: No

 ** [MaxResults](#API_GetTags_RequestSyntax) **   <a name="awscostmanagement-GetTags-request-MaxResults"></a>
This field is only used when SortBy is provided in the request. The maximum number of objects that are returned for this request. If MaxResults isn't specified with SortBy, the request returns 1000 results as the default value for this parameter.  
For `GetTags`, MaxResults has an upper quota of 1000.  
Type: Integer  
Valid Range: Minimum value of 1.  
Required: No

 ** [NextPageToken](#API_GetTags_RequestSyntax) **   <a name="awscostmanagement-GetTags-request-NextPageToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [SearchString](#API_GetTags_RequestSyntax) **   <a name="awscostmanagement-GetTags-request-SearchString"></a>
The value that you want to search for.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

 ** [SortBy](#API_GetTags_RequestSyntax) **   <a name="awscostmanagement-GetTags-request-SortBy"></a>
The value that you want to sort the data by.  
The key represents cost and usage metrics. The following values are supported:  
+  `BlendedCost` 
+  `UnblendedCost` 
+  `AmortizedCost` 
+  `NetAmortizedCost` 
+  `NetUnblendedCost` 
+  `UsageQuantity` 
+  `NormalizedUsageAmount` 
The supported values for `SortOrder` are `ASCENDING` and `DESCENDING`.  
When you use `SortBy`, `NextPageToken` and `SearchString` aren't supported.  
Type: Array of [SortDefinition](API_SortDefinition.md) objects  
Required: No

 ** [TagKey](#API_GetTags_RequestSyntax) **   <a name="awscostmanagement-GetTags-request-TagKey"></a>
The key of the tag that you want to return values for.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

 ** [TimePeriod](#API_GetTags_RequestSyntax) **   <a name="awscostmanagement-GetTags-request-TimePeriod"></a>
The start and end dates for retrieving the dimension values. The start date is inclusive, but the end date is exclusive. For example, if `start` is `2017-01-01` and `end` is `2017-05-01`, then the cost and usage data is retrieved from `2017-01-01` up to and including `2017-04-30` but not including `2017-05-01`.  
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

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

```
{
   "NextPageToken": "string",
   "ReturnSize": number,
   "Tags": [ "string" ],
   "TotalSize": number
}
```

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

 ** [NextPageToken](#API_GetTags_ResponseSyntax) **   <a name="awscostmanagement-GetTags-response-NextPageToken"></a>
The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

 ** [ReturnSize](#API_GetTags_ResponseSyntax) **   <a name="awscostmanagement-GetTags-response-ReturnSize"></a>
The number of query results that AWS returns at a time.  
Type: Integer

 ** [Tags](#API_GetTags_ResponseSyntax) **   <a name="awscostmanagement-GetTags-response-Tags"></a>
The tags that match your request.  
Type: Array of strings

 ** [TotalSize](#API_GetTags_ResponseSyntax) **   <a name="awscostmanagement-GetTags-response-TotalSize"></a>
The total number of query results.  
Type: Integer

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

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

 ** BillExpirationException **   
The requested report expired. Update the date interval and try again.  
HTTP Status Code: 400

 ** BillingViewHealthStatusException **   
 The billing view status must be `HEALTHY` to perform this action. Try again when the status is `HEALTHY`.   
HTTP Status Code: 400

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** RequestChangedException **   
Your request parameters changed between pages. Try again with the old parameters or without a pagination token.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

## Examples
<a name="API_GetTags_Examples"></a>

### Example
<a name="API_GetTags_Example_1"></a>

The following example shows how to retrieve the list of tag keys using the `GetTags` operation.

#### Sample Request
<a name="API_GetTags_Example_1_Request"></a>

```
POST / HTTP/1.1
Host: ce.us-east-1.amazonaws.com
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid,Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: AWSInsightsIndexService.GetTags
{
  "TimePeriod": {
    "Start": "2017-01-01",
    "End": "2017-05-18"
  },
  "TagKey": "Project",
  "SearchString": "secretProject"
}
```

#### Sample Response
<a name="API_GetTags_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "ReturnSize": 2,
  "Tags": [
    secretProject1",
    "secretProject2"
    ],
  "TotalSize": 2
}
```

## See Also
<a name="API_GetTags_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/ce-2017-10-25/GetTags) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetTags) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetTags) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetTags) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetTags) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetTags) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetTags) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetTags) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetTags) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetTags) 

# GetUsageForecast
<a name="API_GetUsageForecast"></a>

Retrieves a forecast for how much Amazon Web Services predicts that you will use over the forecast time period that you select, based on your past usage. 

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

```
{
   "BillingViewArn": "string",
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "Granularity": "string",
   "Metric": "string",
   "PredictionIntervalLevel": number,
   "TimePeriod": { 
      "End": "string",
      "Start": "string"
   }
}
```

## Request Parameters
<a name="API_GetUsageForecast_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.

 ** [BillingViewArn](#API_GetUsageForecast_RequestSyntax) **   <a name="awscostmanagement-GetUsageForecast-request-BillingViewArn"></a>
The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to AWS Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[-a-zA-Z0-9/:_+=.-@]{1,43}$`   
Required: No

 ** [Filter](#API_GetUsageForecast_RequestSyntax) **   <a name="awscostmanagement-GetUsageForecast-request-Filter"></a>
The filters that you want to use to filter your forecast. The `GetUsageForecast` API supports filtering by the following dimensions:  
+  `AZ` 
+  `INSTANCE_TYPE` 
+  `LINKED_ACCOUNT` 
+  `LINKED_ACCOUNT_NAME` 
+  `OPERATION` 
+  `PURCHASE_TYPE` 
+  `REGION` 
+  `SERVICE` 
+  `USAGE_TYPE` 
+  `USAGE_TYPE_GROUP` 
+  `RECORD_TYPE` 
+  `OPERATING_SYSTEM` 
+  `TENANCY` 
+  `SCOPE` 
+  `PLATFORM` 
+  `SUBSCRIPTION_ID` 
+  `LEGAL_ENTITY_NAME` 
+  `DEPLOYMENT_OPTION` 
+  `DATABASE_ENGINE` 
+  `INSTANCE_TYPE_FAMILY` 
+  `BILLING_ENTITY` 
+  `RESERVATION_ID` 
+  `SAVINGS_PLAN_ARN` 
Type: [Expression](API_Expression.md) object  
Required: No

 ** [Granularity](#API_GetUsageForecast_RequestSyntax) **   <a name="awscostmanagement-GetUsageForecast-request-Granularity"></a>
How granular you want the forecast to be. You can get 3 months of `DAILY` forecasts or 18 months of `MONTHLY` forecasts.  
The `GetUsageForecast` operation supports only `DAILY` and `MONTHLY` granularities.  
Type: String  
Valid Values: `DAILY | MONTHLY | HOURLY`   
Required: Yes

 ** [Metric](#API_GetUsageForecast_RequestSyntax) **   <a name="awscostmanagement-GetUsageForecast-request-Metric"></a>
Which metric Cost Explorer uses to create your forecast.  
Valid values for a `GetUsageForecast` call are the following:  
+ USAGE\$1QUANTITY
+ NORMALIZED\$1USAGE\$1AMOUNT
Type: String  
Valid Values: `BLENDED_COST | UNBLENDED_COST | AMORTIZED_COST | NET_UNBLENDED_COST | NET_AMORTIZED_COST | USAGE_QUANTITY | NORMALIZED_USAGE_AMOUNT`   
Required: Yes

 ** [PredictionIntervalLevel](#API_GetUsageForecast_RequestSyntax) **   <a name="awscostmanagement-GetUsageForecast-request-PredictionIntervalLevel"></a>
 AWS Cost Explorer always returns the mean forecast as a single point. You can request a prediction interval around the mean by specifying a confidence level. The higher the confidence level, the more confident Cost Explorer is about the actual value falling in the prediction interval. Higher confidence levels result in wider prediction intervals.  
Type: Integer  
Valid Range: Minimum value of 51. Maximum value of 99.  
Required: No

 ** [TimePeriod](#API_GetUsageForecast_RequestSyntax) **   <a name="awscostmanagement-GetUsageForecast-request-TimePeriod"></a>
The start and end dates of the period that you want to retrieve usage forecast for. The start date is included in the period, but the end date isn't included in the period. For example, if `start` is `2017-01-01` and `end` is `2017-05-01`, then the cost and usage data is retrieved from `2017-01-01` up to and including `2017-04-30` but not including `2017-05-01`. The start date must be equal to or later than the current date to avoid a validation error.  
Type: [DateInterval](API_DateInterval.md) object  
Required: Yes

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

```
{
   "ForecastResultsByTime": [ 
      { 
         "MeanValue": "string",
         "PredictionIntervalLowerBound": "string",
         "PredictionIntervalUpperBound": "string",
         "TimePeriod": { 
            "End": "string",
            "Start": "string"
         }
      }
   ],
   "Total": { 
      "Amount": "string",
      "Unit": "string"
   }
}
```

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

 ** [ForecastResultsByTime](#API_GetUsageForecast_ResponseSyntax) **   <a name="awscostmanagement-GetUsageForecast-response-ForecastResultsByTime"></a>
The forecasts for your query, in order. For `DAILY` forecasts, this is a list of days. For `MONTHLY` forecasts, this is a list of months.  
Type: Array of [ForecastResult](API_ForecastResult.md) objects

 ** [Total](#API_GetUsageForecast_ResponseSyntax) **   <a name="awscostmanagement-GetUsageForecast-response-Total"></a>
How much you're forecasted to use over the forecast period.  
Type: [MetricValue](API_MetricValue.md) object

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

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

 ** BillingViewHealthStatusException **   
 The billing view status must be `HEALTHY` to perform this action. Try again when the status is `HEALTHY`.   
HTTP Status Code: 400

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

 ** UnresolvableUsageUnitException **   
Cost Explorer was unable to identify the usage unit. Provide `UsageType/UsageTypeGroup` filter selections that contain matching units, for example: `hours`.  
HTTP Status Code: 400

## Examples
<a name="API_GetUsageForecast_Examples"></a>

### Example
<a name="API_GetUsageForecast_Example_1"></a>

The following example shows how to retrieve a forecast using the `GetUsageForecast` operation.

#### Sample Request
<a name="API_GetUsageForecast_Example_1_Request"></a>

```
POST / HTTP/1.1
Host: ce.us-east-1.amazonaws.com
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid,Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: AWSInsightsIndexService.GetUsageForecast
{
  "TimePeriod": {
    "Start":"2018-10-25",
    "End": "2018-10-27"
  },
  "Granularity": "DAILY",
  "Filter": {      
    "Dimensions": {
      "Key": "SERVICE",
      "Values": [
        "Amazon Simple Storage Service"
      ]
    }
  },
  "Metric":"USAGE_QUANTITY",
  "PredictionIntervalLevel":85
}
```

#### Sample Response
<a name="API_GetUsageForecast_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "ForecastResultsByTime": [
    {
      "MeanValue": "37.0786663399", 
      "PredictionIntervalLowerBound": "34.9970026341", 
      "PredictionIntervalUpperBound": "39.1603300457", 
      "TimePeriod": {
        "End": "2019-10-26", 
        "Start": "2019-10-25"
      }
    }, 
    {
      "MeanValue": "37.0786663399", 
      "PredictionIntervalLowerBound": "34.9970026341", 
      "PredictionIntervalUpperBound": "39.1603300457", 
      "TimePeriod": {
        "End": "2019-10-27", 
        "Start": "2019-10-26"
      }
    }
  ], 
  "Total": {
      "Amount": "74.1573326798", 
      "Unit": "Hrs"
  }
}
```

## See Also
<a name="API_GetUsageForecast_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/ce-2017-10-25/GetUsageForecast) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/GetUsageForecast) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/GetUsageForecast) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/GetUsageForecast) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/GetUsageForecast) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/GetUsageForecast) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/GetUsageForecast) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/GetUsageForecast) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/GetUsageForecast) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/GetUsageForecast) 

# ListCommitmentPurchaseAnalyses
<a name="API_ListCommitmentPurchaseAnalyses"></a>

Lists the commitment purchase analyses for your account.

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

```
{
   "AnalysisIds": [ "string" ],
   "AnalysisStatus": "string",
   "NextPageToken": "string",
   "PageSize": number
}
```

## Request Parameters
<a name="API_ListCommitmentPurchaseAnalyses_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.

 ** [AnalysisIds](#API_ListCommitmentPurchaseAnalyses_RequestSyntax) **   <a name="awscostmanagement-ListCommitmentPurchaseAnalyses-request-AnalysisIds"></a>
The analysis IDs associated with the commitment purchase analyses.  
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 600 items.  
Length Constraints: Fixed length of 36.  
Pattern: `^[\S\s]{8}-[\S\s]{4}-[\S\s]{4}-[\S\s]{4}-[\S\s]{12}$`   
Required: No

 ** [AnalysisStatus](#API_ListCommitmentPurchaseAnalyses_RequestSyntax) **   <a name="awscostmanagement-ListCommitmentPurchaseAnalyses-request-AnalysisStatus"></a>
The status of the analysis.  
Type: String  
Valid Values: `SUCCEEDED | PROCESSING | FAILED`   
Required: No

 ** [NextPageToken](#API_ListCommitmentPurchaseAnalyses_RequestSyntax) **   <a name="awscostmanagement-ListCommitmentPurchaseAnalyses-request-NextPageToken"></a>
The token to retrieve the next set of results.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [PageSize](#API_ListCommitmentPurchaseAnalyses_RequestSyntax) **   <a name="awscostmanagement-ListCommitmentPurchaseAnalyses-request-PageSize"></a>
The number of analyses that you want returned in a single response object.  
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 600.  
Required: No

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

```
{
   "AnalysisSummaryList": [ 
      { 
         "AnalysisCompletionTime": "string",
         "AnalysisId": "string",
         "AnalysisStartedTime": "string",
         "AnalysisStatus": "string",
         "CommitmentPurchaseAnalysisConfiguration": { 
            "SavingsPlansPurchaseAnalysisConfiguration": { 
               "AccountId": "string",
               "AccountScope": "string",
               "AnalysisType": "string",
               "LookBackTimePeriod": { 
                  "End": "string",
                  "Start": "string"
               },
               "SavingsPlansToAdd": [ 
                  { 
                     "InstanceFamily": "string",
                     "OfferingId": "string",
                     "PaymentOption": "string",
                     "Region": "string",
                     "SavingsPlansCommitment": number,
                     "SavingsPlansType": "string",
                     "TermInYears": "string"
                  }
               ],
               "SavingsPlansToExclude": [ "string" ]
            }
         },
         "ErrorCode": "string",
         "EstimatedCompletionTime": "string"
      }
   ],
   "NextPageToken": "string"
}
```

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

 ** [AnalysisSummaryList](#API_ListCommitmentPurchaseAnalyses_ResponseSyntax) **   <a name="awscostmanagement-ListCommitmentPurchaseAnalyses-response-AnalysisSummaryList"></a>
The list of analyses.  
Type: Array of [AnalysisSummary](API_AnalysisSummary.md) objects

 ** [NextPageToken](#API_ListCommitmentPurchaseAnalyses_ResponseSyntax) **   <a name="awscostmanagement-ListCommitmentPurchaseAnalyses-response-NextPageToken"></a>
The token to retrieve the next set of results.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

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

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

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## See Also
<a name="API_ListCommitmentPurchaseAnalyses_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/ce-2017-10-25/ListCommitmentPurchaseAnalyses) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/ListCommitmentPurchaseAnalyses) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/ListCommitmentPurchaseAnalyses) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/ListCommitmentPurchaseAnalyses) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/ListCommitmentPurchaseAnalyses) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/ListCommitmentPurchaseAnalyses) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/ListCommitmentPurchaseAnalyses) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/ListCommitmentPurchaseAnalyses) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/ListCommitmentPurchaseAnalyses) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/ListCommitmentPurchaseAnalyses) 

# ListCostAllocationTagBackfillHistory
<a name="API_ListCostAllocationTagBackfillHistory"></a>

 Retrieves a list of your historical cost allocation tag backfill requests. 

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

```
{
   "MaxResults": number,
   "NextToken": "string"
}
```

## Request Parameters
<a name="API_ListCostAllocationTagBackfillHistory_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.

 ** [MaxResults](#API_ListCostAllocationTagBackfillHistory_RequestSyntax) **   <a name="awscostmanagement-ListCostAllocationTagBackfillHistory-request-MaxResults"></a>
 The maximum number of objects that are returned for this request.   
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 1000.  
Required: No

 ** [NextToken](#API_ListCostAllocationTagBackfillHistory_RequestSyntax) **   <a name="awscostmanagement-ListCostAllocationTagBackfillHistory-request-NextToken"></a>
 The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

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

```
{
   "BackfillRequests": [ 
      { 
         "BackfillFrom": "string",
         "BackfillStatus": "string",
         "CompletedAt": "string",
         "LastUpdatedAt": "string",
         "RequestedAt": "string"
      }
   ],
   "NextToken": "string"
}
```

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

 ** [BackfillRequests](#API_ListCostAllocationTagBackfillHistory_ResponseSyntax) **   <a name="awscostmanagement-ListCostAllocationTagBackfillHistory-response-BackfillRequests"></a>
 The list of historical cost allocation tag backfill requests.   
Type: Array of [CostAllocationTagBackfillRequest](API_CostAllocationTagBackfillRequest.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 1000 items.

 ** [NextToken](#API_ListCostAllocationTagBackfillHistory_ResponseSyntax) **   <a name="awscostmanagement-ListCostAllocationTagBackfillHistory-response-NextToken"></a>
 The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

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

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

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## Examples
<a name="API_ListCostAllocationTagBackfillHistory_Examples"></a>

The following are sample requests and responses of the `ListCostAllocationTagBackfillHistory` operations.

### Example 1: List the latest cost allocation tag backfill request
<a name="API_ListCostAllocationTagBackfillHistory_Example_1"></a>

This example illustrates one usage of ListCostAllocationTagBackfillHistory.

#### Sample Request
<a name="API_ListCostAllocationTagBackfillHistory_Example_1_Request"></a>

```
{
    "MaxResults": 1
}
```

#### Sample Response
<a name="API_ListCostAllocationTagBackfillHistory_Example_1_Response"></a>

```
{
    "BackfillRequests": [
        {
            "BackfillFrom":"2024-02-01T00:00:00Z",
            "BackfillStatus":"PROCESSING",
            "RequestedAt":"2024-03-01T09:16:23Z",
            "LastUpdatedAt":"2024-03-01T09:16:23Z"
        }
    ],
    "NextToken": null
}
```

## See Also
<a name="API_ListCostAllocationTagBackfillHistory_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/ce-2017-10-25/ListCostAllocationTagBackfillHistory) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/ListCostAllocationTagBackfillHistory) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/ListCostAllocationTagBackfillHistory) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/ListCostAllocationTagBackfillHistory) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/ListCostAllocationTagBackfillHistory) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/ListCostAllocationTagBackfillHistory) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/ListCostAllocationTagBackfillHistory) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/ListCostAllocationTagBackfillHistory) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/ListCostAllocationTagBackfillHistory) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/ListCostAllocationTagBackfillHistory) 

# ListCostAllocationTags
<a name="API_ListCostAllocationTags"></a>

Get a list of cost allocation tags. All inputs in the API are optional and serve as filters. By default, all cost allocation tags are returned. 

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

```
{
   "MaxResults": number,
   "NextToken": "string",
   "Status": "string",
   "TagKeys": [ "string" ],
   "Type": "string"
}
```

## Request Parameters
<a name="API_ListCostAllocationTags_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.

 ** [MaxResults](#API_ListCostAllocationTags_RequestSyntax) **   <a name="awscostmanagement-ListCostAllocationTags-request-MaxResults"></a>
The maximum number of objects that are returned for this request. By default, the request returns 100 results.   
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 1000.  
Required: No

 ** [NextToken](#API_ListCostAllocationTags_RequestSyntax) **   <a name="awscostmanagement-ListCostAllocationTags-request-NextToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [Status](#API_ListCostAllocationTags_RequestSyntax) **   <a name="awscostmanagement-ListCostAllocationTags-request-Status"></a>
The status of cost allocation tag keys that are returned for this request.   
Type: String  
Valid Values: `Active | Inactive`   
Required: No

 ** [TagKeys](#API_ListCostAllocationTags_RequestSyntax) **   <a name="awscostmanagement-ListCostAllocationTags-request-TagKeys"></a>
The list of cost allocation tag keys that are returned for this request.   
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 100 items.  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

 ** [Type](#API_ListCostAllocationTags_RequestSyntax) **   <a name="awscostmanagement-ListCostAllocationTags-request-Type"></a>
The type of `CostAllocationTag` object that are returned for this request. The `AWSGenerated` type tags are tags that AWS defines and applies to support AWS resources for cost allocation purposes. The `UserDefined` type tags are tags that you define, create, and apply to resources.   
Type: String  
Valid Values: `AWSGenerated | UserDefined`   
Required: No

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

```
{
   "CostAllocationTags": [ 
      { 
         "LastUpdatedDate": "string",
         "LastUsedDate": "string",
         "Status": "string",
         "TagKey": "string",
         "Type": "string"
      }
   ],
   "NextToken": "string"
}
```

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

 ** [CostAllocationTags](#API_ListCostAllocationTags_ResponseSyntax) **   <a name="awscostmanagement-ListCostAllocationTags-response-CostAllocationTags"></a>
A list of cost allocation tags that includes the detailed metadata for each one.   
Type: Array of [CostAllocationTag](API_CostAllocationTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 100 items.

 ** [NextToken](#API_ListCostAllocationTags_ResponseSyntax) **   <a name="awscostmanagement-ListCostAllocationTags-response-NextToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

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

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

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## Examples
<a name="API_ListCostAllocationTags_Examples"></a>

The following are sample requests and responses of the `ListCostAllocationTags` operations.

### Example 1: List all user defined active tags
<a name="API_ListCostAllocationTags_Example_1"></a>

This example illustrates one usage of ListCostAllocationTags.

#### Sample Request
<a name="API_ListCostAllocationTags_Example_1_Request"></a>

```
{
    "Type": "UserDefined",
    "Status": "Active"
}
```

#### Sample Response
<a name="API_ListCostAllocationTags_Example_1_Response"></a>

```
{
    "CostAllocationTags": [
        {
            "TagKey": "tagA",
            "Type": "UserDefined",
            "Status": "Active" 
        }
    ],
    "NextToken": null
}
```

### Example 2: List all tags by tag keys
<a name="API_ListCostAllocationTags_Example_2"></a>

This example illustrates one usage of ListCostAllocationTags.

#### Sample Request
<a name="API_ListCostAllocationTags_Example_2_Request"></a>

```
{
    "TagKeys": ["tagA", "tagB"]
}
```

#### Sample Response
<a name="API_ListCostAllocationTags_Example_2_Response"></a>

```
{
    "CostAllocationTags": [
        {
            "TagKey": "tagA",
            "Type": "UserDefined",
            "Status": "Active" 
        },
        {
            "TagKey": "tagB",
            "Type": "UserDefined",
            "Status": "Inactive"
        }
    ],
    "NextToken": null
}
```

## See Also
<a name="API_ListCostAllocationTags_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/ce-2017-10-25/ListCostAllocationTags) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/ListCostAllocationTags) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/ListCostAllocationTags) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/ListCostAllocationTags) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/ListCostAllocationTags) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/ListCostAllocationTags) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/ListCostAllocationTags) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/ListCostAllocationTags) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/ListCostAllocationTags) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/ListCostAllocationTags) 

# ListCostCategoryDefinitions
<a name="API_ListCostCategoryDefinitions"></a>

Returns the name, Amazon Resource Name (ARN), `NumberOfRules` and effective dates of all cost categories defined in the account. You have the option to use `EffectiveOn` and `SupportedResourceTypes` to return a list of cost categories that were active on a specific date. If there is no `EffectiveOn` specified, you’ll see cost categories that are effective on the current date. If cost category is still effective, `EffectiveEnd` is omitted in the response. `ListCostCategoryDefinitions` supports pagination. The request can have a `MaxResults` range up to 100.

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

```
{
   "EffectiveOn": "string",
   "MaxResults": number,
   "NextToken": "string",
   "SupportedResourceTypes": [ "string" ]
}
```

## Request Parameters
<a name="API_ListCostCategoryDefinitions_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.

 ** [EffectiveOn](#API_ListCostCategoryDefinitions_RequestSyntax) **   <a name="awscostmanagement-ListCostCategoryDefinitions-request-EffectiveOn"></a>
The date when the cost category was effective.   
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$`   
Required: No

 ** [MaxResults](#API_ListCostCategoryDefinitions_RequestSyntax) **   <a name="awscostmanagement-ListCostCategoryDefinitions-request-MaxResults"></a>
The number of entries a paginated response contains.   
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 100.  
Required: No

 ** [NextToken](#API_ListCostCategoryDefinitions_RequestSyntax) **   <a name="awscostmanagement-ListCostCategoryDefinitions-request-NextToken"></a>
The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [SupportedResourceTypes](#API_ListCostCategoryDefinitions_RequestSyntax) **   <a name="awscostmanagement-ListCostCategoryDefinitions-request-SupportedResourceTypes"></a>
 Filter cost category definitions that are supported by given resource types based on the latest version. If the filter is present, the result only includes Cost Categories that supports input resource type. If the filter isn't provided, no filtering is applied. The valid values are `billing:rispgroupsharing` and `billing:billingview`.   
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 5 items.  
Pattern: `^[-a-zA-Z0-9/_]+:[-a-zA-Z0-9/_]+`   
Required: No

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

```
{
   "CostCategoryReferences": [ 
      { 
         "CostCategoryArn": "string",
         "DefaultValue": "string",
         "EffectiveEnd": "string",
         "EffectiveStart": "string",
         "Name": "string",
         "NumberOfRules": number,
         "ProcessingStatus": [ 
            { 
               "Component": "string",
               "Status": "string"
            }
         ],
         "SupportedResourceTypes": [ "string" ],
         "Values": [ "string" ]
      }
   ],
   "NextToken": "string"
}
```

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

 ** [CostCategoryReferences](#API_ListCostCategoryDefinitions_ResponseSyntax) **   <a name="awscostmanagement-ListCostCategoryDefinitions-response-CostCategoryReferences"></a>
A reference to a cost category that contains enough information to identify the Cost Category.   
Type: Array of [CostCategoryReference](API_CostCategoryReference.md) objects

 ** [NextToken](#API_ListCostCategoryDefinitions_ResponseSyntax) **   <a name="awscostmanagement-ListCostCategoryDefinitions-response-NextToken"></a>
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## See Also
<a name="API_ListCostCategoryDefinitions_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/ce-2017-10-25/ListCostCategoryDefinitions) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/ListCostCategoryDefinitions) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/ListCostCategoryDefinitions) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/ListCostCategoryDefinitions) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/ListCostCategoryDefinitions) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/ListCostCategoryDefinitions) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/ListCostCategoryDefinitions) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/ListCostCategoryDefinitions) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/ListCostCategoryDefinitions) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/ListCostCategoryDefinitions) 

# ListCostCategoryResourceAssociations
<a name="API_ListCostCategoryResourceAssociations"></a>

Returns resource associations of all cost categories defined in the account. You have the option to use `CostCategoryArn` to get the association for a specific cost category. `ListCostCategoryResourceAssociations` supports pagination. The request can have a `MaxResults` range up to 100. 

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

```
{
   "CostCategoryArn": "string",
   "MaxResults": number,
   "NextToken": "string"
}
```

## Request Parameters
<a name="API_ListCostCategoryResourceAssociations_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.

 ** [CostCategoryArn](#API_ListCostCategoryResourceAssociations_RequestSyntax) **   <a name="awscostmanagement-ListCostCategoryResourceAssociations-request-CostCategoryArn"></a>
The unique identifier for your cost category.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+`   
Required: No

 ** [MaxResults](#API_ListCostCategoryResourceAssociations_RequestSyntax) **   <a name="awscostmanagement-ListCostCategoryResourceAssociations-request-MaxResults"></a>
 The number of entries a paginated response contains.   
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 100.  
Required: No

 ** [NextToken](#API_ListCostCategoryResourceAssociations_RequestSyntax) **   <a name="awscostmanagement-ListCostCategoryResourceAssociations-request-NextToken"></a>
 The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

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

```
{
   "CostCategoryResourceAssociations": [ 
      { 
         "CostCategoryArn": "string",
         "CostCategoryName": "string",
         "ResourceArn": "string"
      }
   ],
   "NextToken": "string"
}
```

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

 ** [CostCategoryResourceAssociations](#API_ListCostCategoryResourceAssociations_ResponseSyntax) **   <a name="awscostmanagement-ListCostCategoryResourceAssociations-response-CostCategoryResourceAssociations"></a>
 A reference to a cost category association that contains information on an associated resource.   
Type: Array of [CostCategoryResourceAssociation](API_CostCategoryResourceAssociation.md) objects

 ** [NextToken](#API_ListCostCategoryResourceAssociations_ResponseSyntax) **   <a name="awscostmanagement-ListCostCategoryResourceAssociations-response-NextToken"></a>
 The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

## Examples
<a name="API_ListCostCategoryResourceAssociations_Examples"></a>

The following is a sample response of the `ListCostCategoryResourceAssociations` operation that you can use to retrieve all associated cost categories and corresponding associated resources.

### Example
<a name="API_ListCostCategoryResourceAssociations_Example_1"></a>

This example illustrates one usage of ListCostCategoryResourceAssociations.

#### Sample Response
<a name="API_ListCostCategoryResourceAssociations_Example_1_Response"></a>

```
{
  "CostCategoryResourceAssociations": [
    {
      "CostCategoryArn": "arn:aws:ce::111122223333:costcategory/f595cb52-91ec-4575-b99f-15829f405ba3",
      "CostCategoryName": "MyCostCategory",
      "ResourceArn": "arn:aws:billing::111122223333:rispgroupsharing/111122223333"
    }
  ]
}
```

## See Also
<a name="API_ListCostCategoryResourceAssociations_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/ce-2017-10-25/ListCostCategoryResourceAssociations) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/ListCostCategoryResourceAssociations) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/ListCostCategoryResourceAssociations) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/ListCostCategoryResourceAssociations) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/ListCostCategoryResourceAssociations) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/ListCostCategoryResourceAssociations) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/ListCostCategoryResourceAssociations) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/ListCostCategoryResourceAssociations) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/ListCostCategoryResourceAssociations) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/ListCostCategoryResourceAssociations) 

# ListSavingsPlansPurchaseRecommendationGeneration
<a name="API_ListSavingsPlansPurchaseRecommendationGeneration"></a>

Retrieves a list of your historical recommendation generations within the past 30 days.

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

```
{
   "GenerationStatus": "string",
   "NextPageToken": "string",
   "PageSize": number,
   "RecommendationIds": [ "string" ]
}
```

## Request Parameters
<a name="API_ListSavingsPlansPurchaseRecommendationGeneration_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.

 ** [GenerationStatus](#API_ListSavingsPlansPurchaseRecommendationGeneration_RequestSyntax) **   <a name="awscostmanagement-ListSavingsPlansPurchaseRecommendationGeneration-request-GenerationStatus"></a>
The status of the recommendation generation.  
Type: String  
Valid Values: `SUCCEEDED | PROCESSING | FAILED`   
Required: No

 ** [NextPageToken](#API_ListSavingsPlansPurchaseRecommendationGeneration_RequestSyntax) **   <a name="awscostmanagement-ListSavingsPlansPurchaseRecommendationGeneration-request-NextPageToken"></a>
The token to retrieve the next set of results.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*`   
Required: No

 ** [PageSize](#API_ListSavingsPlansPurchaseRecommendationGeneration_RequestSyntax) **   <a name="awscostmanagement-ListSavingsPlansPurchaseRecommendationGeneration-request-PageSize"></a>
The number of recommendations that you want returned in a single response object.  
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 6000.  
Required: No

 ** [RecommendationIds](#API_ListSavingsPlansPurchaseRecommendationGeneration_RequestSyntax) **   <a name="awscostmanagement-ListSavingsPlansPurchaseRecommendationGeneration-request-RecommendationIds"></a>
The IDs for each specific recommendation.  
Type: Array of strings  
Length Constraints: Fixed length of 36.  
Pattern: `^[\S\s]{8}-[\S\s]{4}-[\S\s]{4}-[\S\s]{4}-[\S\s]{12}$`   
Required: No

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

```
{
   "GenerationSummaryList": [ 
      { 
         "EstimatedCompletionTime": "string",
         "GenerationCompletionTime": "string",
         "GenerationStartedTime": "string",
         "GenerationStatus": "string",
         "RecommendationId": "string"
      }
   ],
   "NextPageToken": "string"
}
```

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

 ** [GenerationSummaryList](#API_ListSavingsPlansPurchaseRecommendationGeneration_ResponseSyntax) **   <a name="awscostmanagement-ListSavingsPlansPurchaseRecommendationGeneration-response-GenerationSummaryList"></a>
The list of historical recommendation generations.  
Type: Array of [GenerationSummary](API_GenerationSummary.md) objects

 ** [NextPageToken](#API_ListSavingsPlansPurchaseRecommendationGeneration_ResponseSyntax) **   <a name="awscostmanagement-ListSavingsPlansPurchaseRecommendationGeneration-response-NextPageToken"></a>
The token to retrieve the next set of results.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 8192.  
Pattern: `[\S\s]*` 

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

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

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** InvalidNextTokenException **   
The pagination token is invalid. Try again without a pagination token.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## See Also
<a name="API_ListSavingsPlansPurchaseRecommendationGeneration_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/ce-2017-10-25/ListSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/ListSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/ListSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/ListSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/ListSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/ListSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/ListSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/ListSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/ListSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/ListSavingsPlansPurchaseRecommendationGeneration) 

# ListTagsForResource
<a name="API_ListTagsForResource"></a>

Returns a list of resource tags associated with the resource specified by the Amazon Resource Name (ARN). 

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

```
{
   "ResourceArn": "string"
}
```

## Request Parameters
<a name="API_ListTagsForResource_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.

 ** [ResourceArn](#API_ListTagsForResource_RequestSyntax) **   <a name="awscostmanagement-ListTagsForResource-request-ResourceArn"></a>
The Amazon Resource Name (ARN) of the resource. For a list of supported resources, see [ResourceTag](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ResourceTag.html).  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+`   
Required: Yes

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

```
{
   "ResourceTags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ]
}
```

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

 ** [ResourceTags](#API_ListTagsForResource_ResponseSyntax) **   <a name="awscostmanagement-ListTagsForResource-response-ResourceTags"></a>
A list of tag key value pairs that are associated with the resource.   
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 200 items.

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

## See Also
<a name="API_ListTagsForResource_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/ce-2017-10-25/ListTagsForResource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/ListTagsForResource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/ListTagsForResource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/ListTagsForResource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/ListTagsForResource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/ListTagsForResource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/ListTagsForResource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/ListTagsForResource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/ListTagsForResource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/ListTagsForResource) 

# ProvideAnomalyFeedback
<a name="API_ProvideAnomalyFeedback"></a>

Modifies the feedback property of a given cost anomaly. 

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

```
{
   "AnomalyId": "string",
   "Feedback": "string"
}
```

## Request Parameters
<a name="API_ProvideAnomalyFeedback_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.

 ** [AnomalyId](#API_ProvideAnomalyFeedback_RequestSyntax) **   <a name="awscostmanagement-ProvideAnomalyFeedback-request-AnomalyId"></a>
A cost anomaly ID.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: Yes

 ** [Feedback](#API_ProvideAnomalyFeedback_RequestSyntax) **   <a name="awscostmanagement-ProvideAnomalyFeedback-request-Feedback"></a>
Describes whether the cost anomaly was a planned activity or you considered it an anomaly.   
Type: String  
Valid Values: `YES | NO | PLANNED_ACTIVITY`   
Required: Yes

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

```
{
   "AnomalyId": "string"
}
```

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

 ** [AnomalyId](#API_ProvideAnomalyFeedback_ResponseSyntax) **   <a name="awscostmanagement-ProvideAnomalyFeedback-response-AnomalyId"></a>
The ID of the modified cost anomaly.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*` 

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## See Also
<a name="API_ProvideAnomalyFeedback_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/ce-2017-10-25/ProvideAnomalyFeedback) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/ProvideAnomalyFeedback) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/ProvideAnomalyFeedback) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/ProvideAnomalyFeedback) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/ProvideAnomalyFeedback) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/ProvideAnomalyFeedback) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/ProvideAnomalyFeedback) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/ProvideAnomalyFeedback) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/ProvideAnomalyFeedback) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/ProvideAnomalyFeedback) 

# StartCommitmentPurchaseAnalysis
<a name="API_StartCommitmentPurchaseAnalysis"></a>

Specifies the parameters of a planned commitment purchase and starts the generation of the analysis. This enables you to estimate the cost, coverage, and utilization impact of your planned commitment purchases.

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

```
{
   "CommitmentPurchaseAnalysisConfiguration": { 
      "SavingsPlansPurchaseAnalysisConfiguration": { 
         "AccountId": "string",
         "AccountScope": "string",
         "AnalysisType": "string",
         "LookBackTimePeriod": { 
            "End": "string",
            "Start": "string"
         },
         "SavingsPlansToAdd": [ 
            { 
               "InstanceFamily": "string",
               "OfferingId": "string",
               "PaymentOption": "string",
               "Region": "string",
               "SavingsPlansCommitment": number,
               "SavingsPlansType": "string",
               "TermInYears": "string"
            }
         ],
         "SavingsPlansToExclude": [ "string" ]
      }
   }
}
```

## Request Parameters
<a name="API_StartCommitmentPurchaseAnalysis_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.

 ** [CommitmentPurchaseAnalysisConfiguration](#API_StartCommitmentPurchaseAnalysis_RequestSyntax) **   <a name="awscostmanagement-StartCommitmentPurchaseAnalysis-request-CommitmentPurchaseAnalysisConfiguration"></a>
The configuration for the commitment purchase analysis.  
Type: [CommitmentPurchaseAnalysisConfiguration](API_CommitmentPurchaseAnalysisConfiguration.md) object  
Required: Yes

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

```
{
   "AnalysisId": "string",
   "AnalysisStartedTime": "string",
   "EstimatedCompletionTime": "string"
}
```

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

 ** [AnalysisId](#API_StartCommitmentPurchaseAnalysis_ResponseSyntax) **   <a name="awscostmanagement-StartCommitmentPurchaseAnalysis-response-AnalysisId"></a>
The analysis ID that's associated with the commitment purchase analysis.  
Type: String  
Length Constraints: Fixed length of 36.  
Pattern: `^[\S\s]{8}-[\S\s]{4}-[\S\s]{4}-[\S\s]{4}-[\S\s]{12}$` 

 ** [AnalysisStartedTime](#API_StartCommitmentPurchaseAnalysis_ResponseSyntax) **   <a name="awscostmanagement-StartCommitmentPurchaseAnalysis-response-AnalysisStartedTime"></a>
The start time of the analysis.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$` 

 ** [EstimatedCompletionTime](#API_StartCommitmentPurchaseAnalysis_ResponseSyntax) **   <a name="awscostmanagement-StartCommitmentPurchaseAnalysis-response-EstimatedCompletionTime"></a>
The estimated time for when the analysis will complete.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$` 

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

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

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** GenerationExistsException **   
A request to generate a recommendation or analysis is already in progress.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
 You've reached the limit on the number of resources you can create, or exceeded the size of an individual resource.   
HTTP Status Code: 400

## See Also
<a name="API_StartCommitmentPurchaseAnalysis_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/ce-2017-10-25/StartCommitmentPurchaseAnalysis) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/StartCommitmentPurchaseAnalysis) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/StartCommitmentPurchaseAnalysis) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/StartCommitmentPurchaseAnalysis) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/StartCommitmentPurchaseAnalysis) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/StartCommitmentPurchaseAnalysis) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/StartCommitmentPurchaseAnalysis) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/StartCommitmentPurchaseAnalysis) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/StartCommitmentPurchaseAnalysis) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/StartCommitmentPurchaseAnalysis) 

# StartCostAllocationTagBackfill
<a name="API_StartCostAllocationTagBackfill"></a>

 Request a cost allocation tag backfill. This will backfill the activation status (either `active` or `inactive`) for all tag keys from `para:BackfillFrom` up to the time this request is made.

You can request a backfill once every 24 hours. 

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

```
{
   "BackfillFrom": "string"
}
```

## Request Parameters
<a name="API_StartCostAllocationTagBackfill_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.

 ** [BackfillFrom](#API_StartCostAllocationTagBackfill_RequestSyntax) **   <a name="awscostmanagement-StartCostAllocationTagBackfill-request-BackfillFrom"></a>
 The date you want the backfill to start from. The date can only be a first day of the month (a billing start date). Dates can't precede the previous twelve months, or in the future.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$`   
Required: Yes

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

```
{
   "BackfillRequest": { 
      "BackfillFrom": "string",
      "BackfillStatus": "string",
      "CompletedAt": "string",
      "LastUpdatedAt": "string",
      "RequestedAt": "string"
   }
}
```

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

 ** [BackfillRequest](#API_StartCostAllocationTagBackfill_ResponseSyntax) **   <a name="awscostmanagement-StartCostAllocationTagBackfill-response-BackfillRequest"></a>
 An object containing detailed metadata of your new backfill request.   
Type: [CostAllocationTagBackfillRequest](API_CostAllocationTagBackfillRequest.md) object

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

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

 ** BackfillLimitExceededException **   
 A request to backfill is already in progress. Once the previous request is complete, you can create another request.   
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## Examples
<a name="API_StartCostAllocationTagBackfill_Examples"></a>

The following are sample requests and responses of the `StartCostAllocationTagBackfill` operations.

### Example 1: Successfully request a cost allocation tag backfill
<a name="API_StartCostAllocationTagBackfill_Example_1"></a>

This example illustrates one usage of StartCostAllocationTagBackfill.

#### Sample Request
<a name="API_StartCostAllocationTagBackfill_Example_1_Request"></a>

```
{
    "BackfillFrom": "2024-02-01T00:00:00Z"
}
```

#### Sample Response
<a name="API_StartCostAllocationTagBackfill_Example_1_Response"></a>

```
{
    "BackfillRequest": {
        "BackfillFrom":"2024-02-01T00:00:00Z",
        "BackfillStatus":"PROCESSING",
        "RequestedAt":"2024-03-01T09:16:23Z",
        "LastUpdatedAt":"2024-03-01T09:16:23Z"
    }
}
```

### Example 2: The backfill is skipped because there is no tag status change since the last backfill
<a name="API_StartCostAllocationTagBackfill_Example_2"></a>

The latest successful backfill request is returned instead.

#### Sample Request
<a name="API_StartCostAllocationTagBackfill_Example_2_Request"></a>

```
{
    "BackfillFrom": "2024-02-01T00:00:00Z"
}
```

#### Sample Response
<a name="API_StartCostAllocationTagBackfill_Example_2_Response"></a>

```
{
    "BackfillRequest": {
        "BackfillFrom":"2024-02-01T00:00:00Z",
        "BackfillStatus":"SUCCEEDED",
        "RequestedAt":"2024-03-01T09:16:23Z",
        "LastUpdatedAt":"2024-03-02T06:45:00Z",
        "CompletedAt":"2024-03-02T06:45:00Z"
    }
}
```

## See Also
<a name="API_StartCostAllocationTagBackfill_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/ce-2017-10-25/StartCostAllocationTagBackfill) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/StartCostAllocationTagBackfill) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/StartCostAllocationTagBackfill) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/StartCostAllocationTagBackfill) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/StartCostAllocationTagBackfill) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/StartCostAllocationTagBackfill) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/StartCostAllocationTagBackfill) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/StartCostAllocationTagBackfill) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/StartCostAllocationTagBackfill) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/StartCostAllocationTagBackfill) 

# StartSavingsPlansPurchaseRecommendationGeneration
<a name="API_StartSavingsPlansPurchaseRecommendationGeneration"></a>

Requests a Savings Plans recommendation generation. This enables you to calculate a fresh set of Savings Plans recommendations that takes your latest usage data and current Savings Plans inventory into account. You can refresh Savings Plans recommendations up to three times daily for a consolidated billing family.

**Note**  
 `StartSavingsPlansPurchaseRecommendationGeneration` has no request syntax because no input parameters are needed to support this operation.

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

```
{
   "EstimatedCompletionTime": "string",
   "GenerationStartedTime": "string",
   "RecommendationId": "string"
}
```

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

 ** [EstimatedCompletionTime](#API_StartSavingsPlansPurchaseRecommendationGeneration_ResponseSyntax) **   <a name="awscostmanagement-StartSavingsPlansPurchaseRecommendationGeneration-response-EstimatedCompletionTime"></a>
The estimated time for when the recommendation generation will complete.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$` 

 ** [GenerationStartedTime](#API_StartSavingsPlansPurchaseRecommendationGeneration_ResponseSyntax) **   <a name="awscostmanagement-StartSavingsPlansPurchaseRecommendationGeneration-response-GenerationStartedTime"></a>
The start time of the recommendation generation.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$` 

 ** [RecommendationId](#API_StartSavingsPlansPurchaseRecommendationGeneration_ResponseSyntax) **   <a name="awscostmanagement-StartSavingsPlansPurchaseRecommendationGeneration-response-RecommendationId"></a>
The ID for this specific recommendation.  
Type: String  
Length Constraints: Fixed length of 36.  
Pattern: `^[\S\s]{8}-[\S\s]{4}-[\S\s]{4}-[\S\s]{4}-[\S\s]{12}$` 

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

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

 ** DataUnavailableException **   
The requested data is unavailable.  
HTTP Status Code: 400

 ** GenerationExistsException **   
A request to generate a recommendation or analysis is already in progress.  
HTTP Status Code: 400

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
 You've reached the limit on the number of resources you can create, or exceeded the size of an individual resource.   
HTTP Status Code: 400

## See Also
<a name="API_StartSavingsPlansPurchaseRecommendationGeneration_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/ce-2017-10-25/StartSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/StartSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/StartSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/StartSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/StartSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/StartSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/StartSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/StartSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/StartSavingsPlansPurchaseRecommendationGeneration) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/StartSavingsPlansPurchaseRecommendationGeneration) 

# TagResource
<a name="API_TagResource"></a>

An API operation for adding one or more tags (key-value pairs) to a resource.

You can use the `TagResource` operation with a resource that already has tags. If you specify a new tag key for the resource, this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag value you specify replaces the previous value for that tag.

Although the maximum number of array members is 200, user-tag maximum is 50. The remaining are reserved for AWS use.

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

```
{
   "ResourceArn": "string",
   "ResourceTags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ]
}
```

## Request Parameters
<a name="API_TagResource_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.

 ** [ResourceArn](#API_TagResource_RequestSyntax) **   <a name="awscostmanagement-TagResource-request-ResourceArn"></a>
The Amazon Resource Name (ARN) of the resource. For a list of supported resources, see [ResourceTag](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ResourceTag.html).   
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+`   
Required: Yes

 ** [ResourceTags](#API_TagResource_RequestSyntax) **   <a name="awscostmanagement-TagResource-request-ResourceTags"></a>
 A list of tag key-value pairs to be added to the resource.  
Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions apply to resource tags:  
+ Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource. The remaining are reserved for AWS use
+ The maximum length of a key is 128 characters
+ The maximum length of a value is 256 characters
+ Keys and values can only contain alphanumeric characters, spaces, and any of the following: `_.:/=+@-` 
+ Keys and values are case sensitive
+ Keys and values are trimmed for any leading or trailing whitespaces
+ Don’t use `aws:` as a prefix for your keys. This prefix is reserved for AWS use
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 200 items.  
Required: Yes

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

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

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

 ** TooManyTagsException **   
Can occur if you specify a number of tags for a resource greater than the maximum 50 user tags per resource.  
HTTP Status Code: 400

## See Also
<a name="API_TagResource_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/ce-2017-10-25/TagResource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/TagResource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/TagResource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/TagResource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/TagResource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/TagResource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/TagResource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/TagResource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/TagResource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/TagResource) 

# UntagResource
<a name="API_UntagResource"></a>

Removes one or more tags from a resource. Specify only tag keys in your request. Don't specify the value. 

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

```
{
   "ResourceArn": "string",
   "ResourceTagKeys": [ "string" ]
}
```

## Request Parameters
<a name="API_UntagResource_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.

 ** [ResourceArn](#API_UntagResource_RequestSyntax) **   <a name="awscostmanagement-UntagResource-request-ResourceArn"></a>
The Amazon Resource Name (ARN) of the resource. For a list of supported resources, see [ResourceTag](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ResourceTag.html).   
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+`   
Required: Yes

 ** [ResourceTagKeys](#API_UntagResource_RequestSyntax) **   <a name="awscostmanagement-UntagResource-request-ResourceTagKeys"></a>
A list of tag keys associated with tags that need to be removed from the resource. If you specify a tag key that doesn't exist, it's ignored. Although the maximum number of array members is 200, user-tag maximum is 50. The remaining are reserved for AWS use.   
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 200 items.  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`   
Required: Yes

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

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

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

## See Also
<a name="API_UntagResource_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/ce-2017-10-25/UntagResource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/UntagResource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/UntagResource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/UntagResource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/UntagResource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/UntagResource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/UntagResource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/UntagResource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/UntagResource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/UntagResource) 

# UpdateAnomalyMonitor
<a name="API_UpdateAnomalyMonitor"></a>

Updates an existing cost anomaly monitor. The changes made are applied going forward, and doesn't change anomalies detected in the past. 

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

```
{
   "MonitorArn": "string",
   "MonitorName": "string"
}
```

## Request Parameters
<a name="API_UpdateAnomalyMonitor_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.

 ** [MonitorArn](#API_UpdateAnomalyMonitor_RequestSyntax) **   <a name="awscostmanagement-UpdateAnomalyMonitor-request-MonitorArn"></a>
Cost anomaly monitor Amazon Resource Names (ARNs).   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: Yes

 ** [MonitorName](#API_UpdateAnomalyMonitor_RequestSyntax) **   <a name="awscostmanagement-UpdateAnomalyMonitor-request-MonitorName"></a>
The new name for the cost anomaly monitor.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

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

```
{
   "MonitorArn": "string"
}
```

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

 ** [MonitorArn](#API_UpdateAnomalyMonitor_ResponseSyntax) **   <a name="awscostmanagement-UpdateAnomalyMonitor-response-MonitorArn"></a>
A cost anomaly monitor ARN.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*` 

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** UnknownMonitorException **   
The cost anomaly monitor does not exist for the account.   
HTTP Status Code: 400

## See Also
<a name="API_UpdateAnomalyMonitor_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/ce-2017-10-25/UpdateAnomalyMonitor) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/UpdateAnomalyMonitor) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/UpdateAnomalyMonitor) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/UpdateAnomalyMonitor) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/UpdateAnomalyMonitor) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/UpdateAnomalyMonitor) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/UpdateAnomalyMonitor) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/UpdateAnomalyMonitor) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/UpdateAnomalyMonitor) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/UpdateAnomalyMonitor) 

# UpdateAnomalySubscription
<a name="API_UpdateAnomalySubscription"></a>

Updates an existing cost anomaly subscription. Specify the fields that you want to update. Omitted fields are unchanged.

**Note**  
The JSON below describes the generic construct for each type. See [Request Parameters](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_UpdateAnomalySubscription.html#API_UpdateAnomalySubscription_RequestParameters) for possible values as they apply to `AnomalySubscription`.

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

```
{
   "Frequency": "string",
   "MonitorArnList": [ "string" ],
   "Subscribers": [ 
      { 
         "Address": "string",
         "Status": "string",
         "Type": "string"
      }
   ],
   "SubscriptionArn": "string",
   "SubscriptionName": "string",
   "Threshold": number,
   "ThresholdExpression": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   }
}
```

## Request Parameters
<a name="API_UpdateAnomalySubscription_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.

 ** [Frequency](#API_UpdateAnomalySubscription_RequestSyntax) **   <a name="awscostmanagement-UpdateAnomalySubscription-request-Frequency"></a>
The update to the frequency value that subscribers receive notifications.   
Type: String  
Valid Values: `DAILY | IMMEDIATE | WEEKLY`   
Required: No

 ** [MonitorArnList](#API_UpdateAnomalySubscription_RequestSyntax) **   <a name="awscostmanagement-UpdateAnomalySubscription-request-MonitorArnList"></a>
A list of cost anomaly monitor ARNs.   
Type: Array of strings  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+`   
Required: No

 ** [Subscribers](#API_UpdateAnomalySubscription_RequestSyntax) **   <a name="awscostmanagement-UpdateAnomalySubscription-request-Subscribers"></a>
The update to the subscriber list.   
Type: Array of [Subscriber](API_Subscriber.md) objects  
Required: No

 ** [SubscriptionArn](#API_UpdateAnomalySubscription_RequestSyntax) **   <a name="awscostmanagement-UpdateAnomalySubscription-request-SubscriptionArn"></a>
A cost anomaly subscription Amazon Resource Name (ARN).   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: Yes

 ** [SubscriptionName](#API_UpdateAnomalySubscription_RequestSyntax) **   <a name="awscostmanagement-UpdateAnomalySubscription-request-SubscriptionName"></a>
The new name of the subscription.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*`   
Required: No

 ** [Threshold](#API_UpdateAnomalySubscription_RequestSyntax) **   <a name="awscostmanagement-UpdateAnomalySubscription-request-Threshold"></a>
(deprecated)  
The update to the threshold value for receiving notifications.   
This field has been deprecated. To update a threshold, use ThresholdExpression. Continued use of Threshold will be treated as shorthand syntax for a ThresholdExpression.  
You can specify either Threshold or ThresholdExpression, but not both.  
Type: Double  
Valid Range: Minimum value of 0.0.  
Required: No

 ** [ThresholdExpression](#API_UpdateAnomalySubscription_RequestSyntax) **   <a name="awscostmanagement-UpdateAnomalySubscription-request-ThresholdExpression"></a>
The update to the [Expression](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html) object used to specify the anomalies that you want to generate alerts for. This supports dimensions and nested expressions. The supported dimensions are `ANOMALY_TOTAL_IMPACT_ABSOLUTE` and `ANOMALY_TOTAL_IMPACT_PERCENTAGE`, corresponding to an anomaly’s TotalImpact and TotalImpactPercentage, respectively (see [Impact](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Impact.html) for more details). The supported nested expression types are `AND` and `OR`. The match option `GREATER_THAN_OR_EQUAL` is required. Values must be numbers between 0 and 10,000,000,000 in string format.  
You can specify either Threshold or ThresholdExpression, but not both.  
The following are examples of valid ThresholdExpressions:  
+ Absolute threshold: `{ "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }` 
+ Percentage threshold: `{ "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }` 
+  `AND` two thresholds together: `{ "And": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }` 
+  `OR` two thresholds together: `{ "Or": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }` 
Type: [Expression](API_Expression.md) object  
Required: No

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

```
{
   "SubscriptionArn": "string"
}
```

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

 ** [SubscriptionArn](#API_UpdateAnomalySubscription_ResponseSyntax) **   <a name="awscostmanagement-UpdateAnomalySubscription-response-SubscriptionArn"></a>
A cost anomaly subscription ARN.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Pattern: `[\S\s]*` 

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** UnknownMonitorException **   
The cost anomaly monitor does not exist for the account.   
HTTP Status Code: 400

 ** UnknownSubscriptionException **   
The cost anomaly subscription does not exist for the account.   
HTTP Status Code: 400

## See Also
<a name="API_UpdateAnomalySubscription_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/ce-2017-10-25/UpdateAnomalySubscription) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/UpdateAnomalySubscription) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/UpdateAnomalySubscription) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/UpdateAnomalySubscription) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/UpdateAnomalySubscription) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/UpdateAnomalySubscription) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/UpdateAnomalySubscription) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/UpdateAnomalySubscription) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/UpdateAnomalySubscription) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/UpdateAnomalySubscription) 

# UpdateCostAllocationTagsStatus
<a name="API_UpdateCostAllocationTagsStatus"></a>

Updates status for cost allocation tags in bulk, with maximum batch size of 20. If the tag status that's updated is the same as the existing tag status, the request doesn't fail. Instead, it doesn't have any effect on the tag status (for example, activating the active tag). 

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

```
{
   "CostAllocationTagsStatus": [ 
      { 
         "Status": "string",
         "TagKey": "string"
      }
   ]
}
```

## Request Parameters
<a name="API_UpdateCostAllocationTagsStatus_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.

 ** [CostAllocationTagsStatus](#API_UpdateCostAllocationTagsStatus_RequestSyntax) **   <a name="awscostmanagement-UpdateCostAllocationTagsStatus-request-CostAllocationTagsStatus"></a>
The list of `CostAllocationTagStatusEntry` objects that are used to update cost allocation tags status for this request.   
Type: Array of [CostAllocationTagStatusEntry](API_CostAllocationTagStatusEntry.md) objects  
Array Members: Minimum number of 1 item. Maximum number of 20 items.  
Required: Yes

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

```
{
   "Errors": [ 
      { 
         "Code": "string",
         "Message": "string",
         "TagKey": "string"
      }
   ]
}
```

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

 ** [Errors](#API_UpdateCostAllocationTagsStatus_ResponseSyntax) **   <a name="awscostmanagement-UpdateCostAllocationTagsStatus-response-Errors"></a>
A list of `UpdateCostAllocationTagsStatusError` objects with error details about each cost allocation tag that can't be updated. If there's no failure, an empty array returns.   
Type: Array of [UpdateCostAllocationTagsStatusError](API_UpdateCostAllocationTagsStatusError.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 20 items.

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

## Examples
<a name="API_UpdateCostAllocationTagsStatus_Examples"></a>

The following are sample requests and responses of the `UpdateCostAllocationTagsStatus` operations.

### Example 1: Successfully updated all tag status
<a name="API_UpdateCostAllocationTagsStatus_Example_1"></a>

This example illustrates one usage of UpdateCostAllocationTagsStatus.

#### Sample Request
<a name="API_UpdateCostAllocationTagsStatus_Example_1_Request"></a>

```
{
    "CostAllocationTagsStatus": [
       {
           "TagKey": "tagA",
           "Status": "Active"
       },
       {
           "TagKey": "tagB",
           "Status": "Inactive"
       }
    ]
}
```

#### Sample Response
<a name="API_UpdateCostAllocationTagsStatus_Example_1_Response"></a>

```
{
    "Errors": []
}
```

### Example 2: Failed to update one of the tag statuses
<a name="API_UpdateCostAllocationTagsStatus_Example_2"></a>

This example illustrates one usage of UpdateCostAllocationTagsStatus.

#### Sample Request
<a name="API_UpdateCostAllocationTagsStatus_Example_2_Request"></a>

```
{
    "CostAllocationTagsStatus": [
       {
           "TagKey": "tagC",
           "Status": "Active"
       },
       {
           "TagKey": "tagD",
           "Status": "Inactive"
       }
    ]
}
```

#### Sample Response
<a name="API_UpdateCostAllocationTagsStatus_Example_2_Response"></a>

```
{
    "Errors": [ 
        {
            "TagKey": "tagC",
            "Code": "TagKeysNotFoundException",
            "Message": "Failed to update Cost Allocation Tag: tagC"
        }
    ]
}
```

## See Also
<a name="API_UpdateCostAllocationTagsStatus_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/ce-2017-10-25/UpdateCostAllocationTagsStatus) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/UpdateCostAllocationTagsStatus) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/UpdateCostAllocationTagsStatus) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/UpdateCostAllocationTagsStatus) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/UpdateCostAllocationTagsStatus) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/UpdateCostAllocationTagsStatus) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/UpdateCostAllocationTagsStatus) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/UpdateCostAllocationTagsStatus) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/UpdateCostAllocationTagsStatus) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/UpdateCostAllocationTagsStatus) 

# UpdateCostCategoryDefinition
<a name="API_UpdateCostCategoryDefinition"></a>

Updates an existing cost category. Changes made to the cost category rules will be used to categorize the current month’s expenses and future expenses. This won’t change categorization for the previous months.

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

```
{
   "CostCategoryArn": "string",
   "DefaultValue": "string",
   "EffectiveStart": "string",
   "Rules": [ 
      { 
         "InheritedValue": { 
            "DimensionKey": "string",
            "DimensionName": "string"
         },
         "Rule": { 
            "And": [ 
               "Expression"
            ],
            "CostCategories": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            },
            "Dimensions": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            },
            "Not": "Expression",
            "Or": [ 
               "Expression"
            ],
            "Tags": { 
               "Key": "string",
               "MatchOptions": [ "string" ],
               "Values": [ "string" ]
            }
         },
         "Type": "string",
         "Value": "string"
      }
   ],
   "RuleVersion": "string",
   "SplitChargeRules": [ 
      { 
         "Method": "string",
         "Parameters": [ 
            { 
               "Type": "string",
               "Values": [ "string" ]
            }
         ],
         "Source": "string",
         "Targets": [ "string" ]
      }
   ]
}
```

## Request Parameters
<a name="API_UpdateCostCategoryDefinition_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.

 ** [CostCategoryArn](#API_UpdateCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-UpdateCostCategoryDefinition-request-CostCategoryArn"></a>
The unique identifier for your cost category.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+`   
Required: Yes

 ** [DefaultValue](#API_UpdateCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-UpdateCostCategoryDefinition-request-DefaultValue"></a>
The default value for the cost category.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 50.  
Pattern: `^(?! )[\p{L}\p{N}\p{Z}-_]*(?<! )$`   
Required: No

 ** [EffectiveStart](#API_UpdateCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-UpdateCostCategoryDefinition-request-EffectiveStart"></a>
The cost category's effective start date. It can only be a billing start date (first day of the month). If the date isn't provided, it's the first day of the current month. Dates can't be before the previous twelve months, or in the future.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$`   
Required: No

 ** [Rules](#API_UpdateCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-UpdateCostCategoryDefinition-request-Rules"></a>
The `Expression` object used to categorize costs. For more information, see [CostCategoryRule ](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_CostCategoryRule.html).   
Type: Array of [CostCategoryRule](API_CostCategoryRule.md) objects  
Array Members: Minimum number of 1 item. Maximum number of 500 items.  
Required: Yes

 ** [RuleVersion](#API_UpdateCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-UpdateCostCategoryDefinition-request-RuleVersion"></a>
The rule schema version in this particular cost category.  
Type: String  
Valid Values: `CostCategoryExpression.v1`   
Required: Yes

 ** [SplitChargeRules](#API_UpdateCostCategoryDefinition_RequestSyntax) **   <a name="awscostmanagement-UpdateCostCategoryDefinition-request-SplitChargeRules"></a>
 The split charge rules used to allocate your charges between your cost category values.   
Type: Array of [CostCategorySplitChargeRule](API_CostCategorySplitChargeRule.md) objects  
Array Members: Minimum number of 1 item. Maximum number of 10 items.  
Required: No

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

```
{
   "CostCategoryArn": "string",
   "EffectiveStart": "string"
}
```

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

 ** [CostCategoryArn](#API_UpdateCostCategoryDefinition_ResponseSyntax) **   <a name="awscostmanagement-UpdateCostCategoryDefinition-response-CostCategoryArn"></a>
The unique identifier for your cost category.   
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+` 

 ** [EffectiveStart](#API_UpdateCostCategoryDefinition_ResponseSyntax) **   <a name="awscostmanagement-UpdateCostCategoryDefinition-response-EffectiveStart"></a>
The cost category's effective start date. It can only be a billing start date (first day of the month).  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 25.  
Pattern: `^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$` 

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

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

 ** LimitExceededException **   
You made too many calls in a short period of time. Try again later.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
 The specified ARN in the request doesn't exist.   
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
 You've reached the limit on the number of resources you can create, or exceeded the size of an individual resource.   
HTTP Status Code: 400

## See Also
<a name="API_UpdateCostCategoryDefinition_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/ce-2017-10-25/UpdateCostCategoryDefinition) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ce-2017-10-25/UpdateCostCategoryDefinition) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ce-2017-10-25/UpdateCostCategoryDefinition) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ce-2017-10-25/UpdateCostCategoryDefinition) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ce-2017-10-25/UpdateCostCategoryDefinition) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ce-2017-10-25/UpdateCostCategoryDefinition) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ce-2017-10-25/UpdateCostCategoryDefinition) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ce-2017-10-25/UpdateCostCategoryDefinition) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ce-2017-10-25/UpdateCostCategoryDefinition) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ce-2017-10-25/UpdateCostCategoryDefinition) 