Skip to main content
The cost anomaly endpoints expose Flux’s seasonal median/MAD anomaly detection results at subscription, service, and resource scope. Flux evaluates finalized daily spend against a matching-weekday baseline, producing deterministic k-scores and severity classifications that persist across sync cycles. Admins can advance findings through an investigation lifecycle. Evidence packs with contributor drilldown are available through companion endpoints.

GET /api/cost/anomalies

Returns a paginated list of cost anomaly findings for the current evaluation run, filtered to the requested scope and severity. Authentication: reader

Query parameters

Response

Each item in items contains:

Example


GET /api/cost/anomalies/export

Streams the filtered anomaly list as a CSV file. Accepts the same filter parameters as GET /api/cost/anomalies (without limit/offset) and returns up to 50,000 rows. The output format is always CSV. Authentication: reader

Query parameters

Same as GET /api/cost/anomalies minus limit and offset.

CSV columns

evaluationDate, costType, scopeType, scopeId, subscriptionId, resourceName, resourceId, resourceType, resourceGroup, serviceName, severity, currentAmount, baselineMedian, absoluteChange, percentChange, currency, baselinePoints, kScore, reason, reviewStatus, reviewNote, reviewedBy, reviewedAt, methodVersion

PUT /api/cost/anomalies/review

Advances a cost anomaly finding through the investigation lifecycle. Only admins may call this endpoint. The updated-by attribution is derived from the authenticated principal’s identity. Authentication: admin

Request body

Response

Returns the full updated anomaly record with the new reviewStatus, reviewNote, reviewedBy, and reviewedAt fields populated. Returns 404 if no matching anomaly record exists for the provided runId, costType, scopeType, and scopeId combination.

GET /api/cost/anomalies/contributors

Returns the previous-week service and resource contributors for a specific anomaly finding, enabling a “why did this scope spike?” drilldown without leaving the anomaly context. Authentication: reader

Query parameters

All four parameters are required.

Response

Example