{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-billing-and-cost-management/json-schema/amazon-billing-and-cost-management-get-anomalies-response-schema.json",
  "title": "GetAnomaliesResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-billing-and-cost-management-anomaly-detection-api-openapi.yml#/components/schemas/GetAnomaliesResponse",
  "type": "object",
  "properties": {
    "Anomalies": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Anomaly"
      },
      "description": "A list of cost anomalies."
    },
    "NextPageToken": {
      "type": "string",
      "description": "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."
    }
  },
  "required": [
    "Anomalies"
  ],
  "$defs": {
    "Anomaly": {
      "type": "object",
      "properties": {
        "AnomalyId": {
          "type": "string",
          "description": "The unique identifier for the anomaly."
        },
        "AnomalyStartDate": {
          "type": "string",
          "description": "The first day the anomaly is detected."
        },
        "AnomalyEndDate": {
          "type": "string",
          "description": "The last day the anomaly is detected."
        },
        "DimensionValue": {
          "type": "string",
          "description": "The dimension for the anomaly (for example, an Amazon Web Services service in a service monitor)."
        },
        "RootCauses": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RootCause"
          },
          "description": "The list of identified root causes for the anomaly."
        },
        "AnomalyScore": {
          "$ref": "#/$defs/AnomalyScore"
        },
        "Impact": {
          "$ref": "#/$defs/Impact"
        },
        "MonitorArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) for the cost monitor that generated this anomaly."
        },
        "Feedback": {
          "type": "string",
          "enum": [
            "YES",
            "NO",
            "PLANNED_ACTIVITY"
          ],
          "description": "The feedback value."
        }
      },
      "required": [
        "AnomalyId",
        "AnomalyScore",
        "Impact",
        "MonitorArn"
      ]
    },
    "AnomalyScore": {
      "type": "object",
      "properties": {
        "MaxScore": {
          "type": "number",
          "description": "The maximum score that's observed during the AnomalyDateInterval."
        },
        "CurrentScore": {
          "type": "number",
          "description": "The last observed score."
        }
      },
      "required": [
        "MaxScore",
        "CurrentScore"
      ]
    },
    "Impact": {
      "type": "object",
      "properties": {
        "MaxImpact": {
          "type": "number",
          "description": "The maximum dollar value that's observed for an anomaly."
        },
        "TotalImpact": {
          "type": "number",
          "description": "The cumulative dollar difference between the total actual spend and total expected spend. It is calculated as TotalActualSpend - TotalExpectedSpend."
        },
        "TotalActualSpend": {
          "type": "number",
          "description": "The cumulative dollar amount that was actually spent during the anomaly."
        },
        "TotalExpectedSpend": {
          "type": "number",
          "description": "The cumulative dollar amount that was expected to be spent during the anomaly. It is calculated using advanced machine learning models to determine the typical spending pattern based on historical data for a customer."
        },
        "TotalImpactPercentage": {
          "type": "number",
          "description": "The cumulative percentage difference between the total actual spend and total expected spend. It is calculated as (TotalImpact / TotalExpectedSpend) * 100. When TotalExpectedSpend is zero, this field is omitted. Expected spend can be zero in situations such as when you start to use a service for the first time."
        }
      },
      "required": [
        "MaxImpact"
      ]
    },
    "RootCause": {
      "type": "object",
      "properties": {
        "Service": {
          "type": "string",
          "description": "The Amazon Web Services service name that's associated with the cost anomaly."
        },
        "Region": {
          "type": "string",
          "description": "The Amazon Web Services Region that's associated with the cost anomaly."
        },
        "LinkedAccount": {
          "type": "string",
          "description": "The member account value that's associated with the cost anomaly."
        },
        "LinkedAccountName": {
          "type": "string",
          "description": "The member account name value that's associated with the cost anomaly."
        },
        "UsageType": {
          "type": "string",
          "description": "The UsageType value that's associated with the cost anomaly."
        },
        "Impact": {
          "$ref": "#/$defs/RootCauseImpact"
        }
      }
    },
    "RootCauseImpact": {
      "type": "object",
      "properties": {
        "Contribution": {
          "type": "number",
          "description": "The dollar amount that this root cause contributed to the anomaly's TotalImpact."
        }
      },
      "required": [
        "Contribution"
      ]
    }
  }
}