---
type: api
title: Machine learning anomaly detection
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/group/endpoint-ml-anomaly
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/group/endpoint-ml-anomaly
products:
  - Elasticsearch
---

# Machine learning anomaly detection

`ml anomaly`

[Learn more about finding anomalies.](https://www.elastic.co/guide/en/machine-learning/8.19/ml-ad-finding-anomalies.html)

- [Close anomaly detection jobs](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-close-job): `POST` `/_ml/anomaly_detectors/{job_id}/_close`
- [Create a calendar](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-put-calendar): `PUT` `/_ml/calendars/{calendar_id}`
- [Get calendar configuration info
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-calendars): `POST` (also `GET`) `/_ml/calendars/{calendar_id}`, `POST` (also `GET`) `/_ml/calendars`
- [Delete a calendar](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-delete-calendar): `DELETE` `/_ml/calendars/{calendar_id}`
- [Delete events from a calendar](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-delete-calendar-event): `DELETE` `/_ml/calendars/{calendar_id}/events/{event_id}`
- [Add anomaly detection job to calendar](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-put-calendar-job): `PUT` `/_ml/calendars/{calendar_id}/jobs/{job_id}`
- [Delete anomaly jobs from a calendar](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-delete-calendar-job): `DELETE` `/_ml/calendars/{calendar_id}/jobs/{job_id}`
- [Get datafeeds configuration info
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-datafeeds): `GET` `/_ml/datafeeds/{datafeed_id}`, `GET` `/_ml/datafeeds`
- [Create a datafeed](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-put-datafeed): `PUT` `/_ml/datafeeds/{datafeed_id}`
- [Delete a datafeed](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-delete-datafeed): `DELETE` `/_ml/datafeeds/{datafeed_id}`
- [Delete expired ML data
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-delete-expired-data): `DELETE` `/_ml/_delete_expired_data/{job_id}`, `DELETE` `/_ml/_delete_expired_data`
- [Get filters
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-filters): `GET` `/_ml/filters/{filter_id}`, `GET` `/_ml/filters`
- [Create a filter](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-put-filter): `PUT` `/_ml/filters/{filter_id}`
- [Delete a filter](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-delete-filter): `DELETE` `/_ml/filters/{filter_id}`
- [Delete forecasts from a job
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-delete-forecast): `DELETE` `/_ml/anomaly_detectors/{job_id}/_forecast/{forecast_id}`, `DELETE` `/_ml/anomaly_detectors/{job_id}/_forecast`
- [Get anomaly detection jobs configuration info
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-jobs): `GET` `/_ml/anomaly_detectors/{job_id}`, `GET` `/_ml/anomaly_detectors`
- [Create an anomaly detection job](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-put-job): `PUT` `/_ml/anomaly_detectors/{job_id}`
- [Delete an anomaly detection job](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-delete-job): `DELETE` `/_ml/anomaly_detectors/{job_id}`
- [Get model snapshots info
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-model-snapshots): `POST` (also `GET`) `/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}`, `POST` (also `GET`) `/_ml/anomaly_detectors/{job_id}/model_snapshots`
- [Delete a model snapshot](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-delete-model-snapshot): `DELETE` `/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}`
- [Estimate job model memory usage](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-estimate-model-memory): `POST` `/_ml/anomaly_detectors/_estimate_model_memory`
- [Force buffered data to be processed](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-flush-job): `POST` `/_ml/anomaly_detectors/{job_id}/_flush`
- [Predict future behavior of a time series](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-forecast): `POST` `/_ml/anomaly_detectors/{job_id}/_forecast`
- [Get anomaly detection job results for buckets
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-buckets): `POST` (also `GET`) `/_ml/anomaly_detectors/{job_id}/results/buckets/{timestamp}`, `POST` (also `GET`) `/_ml/anomaly_detectors/{job_id}/results/buckets`
- [Get info about events in calendars](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-calendar-events): `GET` `/_ml/calendars/{calendar_id}/events`
- [Add scheduled events to the calendar](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-post-calendar-events): `POST` `/_ml/calendars/{calendar_id}/events`
- [Get anomaly detection job results for categories
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-categories): `POST` (also `GET`) `/_ml/anomaly_detectors/{job_id}/results/categories/{category_id}`, `POST` (also `GET`) `/_ml/anomaly_detectors/{job_id}/results/categories`
- [Get datafeed stats
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-datafeed-stats): `GET` `/_ml/datafeeds/{datafeed_id}/_stats`, `GET` `/_ml/datafeeds/_stats`
- [Get anomaly detection job results for influencers
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-influencers): `POST` (also `GET`) `/_ml/anomaly_detectors/{job_id}/results/influencers`
- [Get anomaly detection job stats
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-job-stats): `GET` `/_ml/anomaly_detectors/{job_id}/_stats`, `GET` `/_ml/anomaly_detectors/_stats`
- [Get anomaly detection job model snapshot upgrade usage info](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-model-snapshot-upgrade-stats): `GET` `/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_upgrade/_stats`
- [Get overall bucket results
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-overall-buckets): `POST` (also `GET`) `/_ml/anomaly_detectors/{job_id}/results/overall_buckets`
- [Get anomaly records for an anomaly detection job
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-records): `POST` (also `GET`) `/_ml/anomaly_detectors/{job_id}/results/records`
- [Open anomaly detection jobs](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-open-job): `POST` `/_ml/anomaly_detectors/{job_id}/_open`
- [Send data to an anomaly detection job for analysis](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-post-data): `POST` `/_ml/anomaly_detectors/{job_id}/_data`
- [Preview a datafeed
](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-preview-datafeed): `POST` (also `GET`) `/_ml/datafeeds/{datafeed_id}/_preview`, `POST` (also `GET`) `/_ml/datafeeds/_preview`
- [Reset an anomaly detection job](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-reset-job): `POST` `/_ml/anomaly_detectors/{job_id}/_reset`
- [Revert to a snapshot](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-revert-model-snapshot): `POST` `/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_revert`
- [Start datafeeds](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-start-datafeed): `POST` `/_ml/datafeeds/{datafeed_id}/_start`
- [Stop datafeeds](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-stop-datafeed): `POST` `/_ml/datafeeds/{datafeed_id}/_stop`
- [Update a datafeed](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-update-datafeed): `POST` `/_ml/datafeeds/{datafeed_id}/_update`
- [Update a filter](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-update-filter): `POST` `/_ml/filters/{filter_id}/_update`
- [Update an anomaly detection job](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-update-job): `POST` `/_ml/anomaly_detectors/{job_id}/_update`
- [Update a snapshot](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-update-model-snapshot): `POST` `/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_update`
- [Upgrade a snapshot](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-upgrade-job-snapshot): `POST` `/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_upgrade`
