Note: This endpoint is in preview and is subject to change.
If you have any feedback, contact Datadog support.
POST https://api.ap1.datadoghq.com/api/v2/cost/recommendationshttps://api.ap2.datadoghq.com/api/v2/cost/recommendationshttps://api.datadoghq.eu/api/v2/cost/recommendationshttps://api.ddog-gov.com/api/v2/cost/recommendationshttps://api.us2.ddog-gov.com/api/v2/cost/recommendationshttps://api.datadoghq.com/api/v2/cost/recommendationshttps://api.us3.datadoghq.com/api/v2/cost/recommendationshttps://api.us5.datadoghq.com/api/v2/cost/recommendations
Overview
List cost recommendations matching a filter, with pagination and sorting.
OAuth apps require the cloud_cost_management_read authorization scope to access this endpoint.
Arguments
Query Strings
Number of results per page (1–10000).
Pagination token from a previous response.
Request
Body Data (required)
Expand All
Filter expression applied to the recommendations.
Ordered list of sort clauses applied to the result set.
Field to sort by (for example, potential_daily_savings.amount).
Sort direction, either ASC or DESC.
Active view name (for example, active, dismissed, open, in-progress, or completed).
{
"filter": "string",
"sort": [
{
"expression": "string",
"order": "string"
}
],
"view": "string"
}
Response
OK
A page of cost recommendations with pagination metadata.
Expand All
The list of cost recommendations on this page.
Attributes describing a single cost recommendation.
Datadog resource key identifying the recommended resource.
Estimated daily savings if the recommendation is applied.
Numeric amount of the potential daily savings.
ISO 4217 currency code for the savings amount.
The kind of recommendation (for example, terminate or rightsize).
Cloud provider identifier of the resource.
Resource type (for example, aws_ec2_instance).
Tags attached to the recommended resource.
Unique identifier for the recommendation.
Recommendation resource type.
Allowed enum values: recommendation
default: recommendation
Top-level JSON:API meta object for paginated cost recommendation responses.
Pagination metadata for a page of cost recommendations.
The filter expression that was applied to produce this page.
Opaque token used to fetch the next page; absent on the last page.
Number of items returned in this page (1–10000).
Pagination token echoed back from the request.
{
"data": [
{
"attributes": {
"dd_resource_key": "string",
"potential_daily_savings": {
"amount": "number",
"currency": "string"
},
"recommendation_type": "string",
"resource_id": "string",
"resource_type": "string",
"tags": []
},
"id": "string",
"type": "recommendation"
}
],
"meta": {
"page": {
"filter": "string",
"next_page_token": "string",
"page_size": "integer",
"page_token": "string"
}
}
}
Too many requests
{
"errors": [
"Bad Request"
]
}
Code Example
## default
#
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/recommendations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"filter": "@resource_table:aws_ec2_instance",
"sort": [
{
"expression": "potential_daily_savings.amount",
"order": "DESC"
}
]
}
EOF