# List anomalies

Source: https://docs.levelfour.ai/api-reference/anomalies/get-anomalies


## GET /api/v1/anomalies

### Authentication

Send `Authorization: Bearer <token>`.

### Parameters

- `provider` (query, string, nullable)
- `status` (query, string, nullable)
- `severity` (query, string, nullable)
- `page` (query, integer, default `1`)
- `page_size` (query, integer, default `20`)
- `start` (query, date string, nullable): Only anomalies whose window starts on or after this date
- `end` (query, date string, nullable): Only anomalies whose window starts on or before this date

### Responses

#### 200: Successful Response

- `success` (boolean, default `true`)
- `timestamp` (date-time string)
- `data` (object, required)
  - `items` (array of object, required)
    - `id` (string, required)
    - `severity` (one of `critical`, `warning`, required)
    - `status` (one of `active`, `resolved`, `dismissed`, required)
    - `title` (string, required)
    - `subtitle` (string, nullable): Resource line shown on the anomalies table. Sourced from the AWS DimensionValue stored on the anomaly DB row.
    - `badge_label` (string, nullable)
    - `rca_emphasis` (string, nullable)
    - `rca_tail` (string, nullable)
    - `peak_impact_usd` (number, nullable): Single-day peak cost impact in USD, as reported by AWS Cost Explorer Impact.MaxImpact.
    - `total_impact_usd` (number, nullable): Total accumulated cost impact in USD, as reported by AWS Cost Explorer Impact.TotalImpact.
    - `spike_pct` (number, nullable): Spike size as a percentage, as reported by AWS Cost Explorer Impact.TotalImpactPercentage.
    - `actual_spend_usd` (number, nullable): Cumulative actual spend over the anomaly window, as reported by AWS Cost Explorer Impact.TotalActualSpend.
    - `expected_spend_usd` (number, nullable): Cumulative expected (baseline) spend the model predicted, as reported by AWS Cost Explorer Impact.TotalExpectedSpend.
    - `anomaly_score` (number, nullable): AWS Cost Explorer AnomalyScore.CurrentScore (0.00-1.00). Surfaces the model's confidence in the anomaly.
    - `max_score` (number, nullable): AWS Cost Explorer AnomalyScore.MaxScore (0.00-1.00). Peak confidence observed over the anomaly window.
    - `feedback` (one of `YES`, `NO`, `PLANNED_ACTIVITY`, nullable): Latest feedback recorded for this anomaly (YES confirmed, NO not an anomaly, PLANNED_ACTIVITY expected), mirrored to AWS Cost Explorer.
    - `anomaly_start_date` (string, nullable): ISO date string for when the anomaly window opened, as reported by AWS Cost Explorer.
    - `anomaly_end_date` (string, nullable): ISO date string for when the anomaly window closed, as reported by AWS Cost Explorer. Null while the anomaly is still ongoing.
    - `timestamp` (string, required)
  - `pagination` (object, required)
    - `total_items` (integer, required)
    - `total_pages` (integer, required)
    - `current_page` (integer, required)
    - `page_size` (integer, required)
    - `has_next` (boolean, required)
    - `has_previous` (boolean, required)

#### Errors

- `400`: Bad Request
- `401`: Authentication Error
- `403`: Authorization Error
- `404`: Not Found
- `409`: Conflict
- `422`: Validation Error
- `429`: Rate Limit Exceeded
- `500`: Internal Server Error

Body of `400`, `401`, `403`, `404`, `409`, `422`, `429`, `500`:

- `success` (`false`, required)
- `error` (object, required)
  - `code` (string, required)
  - `message` (string, required)
  - `details` (any)
- `timestamp` (date-time string, required)
