Delete trained models APIedit

Deletes an existing trained inference model that is currently not referenced by an ingest pipeline.

This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.


DELETE _ml/trained_models/<model_id>


If the Elasticsearch security features are enabled, you must have the following built-in roles or equivalent privileges:

  • machine_learning_admin

For more information, see Built-in roles and Machine learning security privileges.

Path parametersedit

(Optional, string) The unique identifier of the trained model.

Response codesedit

The code indicates that the trained model is referenced by an ingest pipeline and cannot be deleted.


The following example deletes the regression-job-one-1574775307356 trained model:

DELETE _ml/trained_models/regression-job-one-1574775307356

The API returns the following result:

  "acknowledged" : true