Delete trained models APIedit

Deletes an existing trained inference model.


DELETE _ml/trained_models/<model_id>


Requires the manage_ml cluster privilege. This privilege is included in the machine_learning_admin built-in role.

Path parametersedit

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

Query parametersedit

(Optional, Boolean) Use to forcefully delete a trained model that is referenced by ingest pipelines or has a started deployment.

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:

response =
  model_id: 'regression-job-one-1574775307356'
puts response
DELETE _ml/trained_models/regression-job-one-1574775307356

The API returns the following result:

  "acknowledged" : true