[role="xpack"]
[testenv="basic"]
[[delete-trained-models]]
= Delete trained models API
[subs="attributes"]
++++
Delete trained models
++++
Deletes an existing trained {infer} model that is currently not referenced by an
ingest pipeline.
experimental[]
[[ml-delete-trained-models-request]]
== {api-request-title}
`DELETE _ml/trained_models/`
[[ml-delete-trained-models-prereq]]
== {api-prereq-title}
If the {es} {security-features} are enabled, you must have the following built-in roles or equivalent privileges:
* `machine_learning_admin`
For more information, see <> and {ml-docs-setup-privileges}.
[[ml-delete-trained-models-path-params]]
== {api-path-parms-title}
``::
(Optional, string)
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-id]
[[ml-delete-trained-models-response-codes]]
== {api-response-codes-title}
`409`::
The code indicates that the trained model is referenced by an ingest pipeline
and cannot be deleted.
[[ml-delete-trained-models-example]]
== {api-examples-title}
The following example deletes the `regression-job-one-1574775307356` trained
model:
[source,console]
--------------------------------------------------
DELETE _ml/trained_models/regression-job-one-1574775307356
--------------------------------------------------
// TEST[skip:TBD]
The API returns the following result:
[source,console-result]
----
{
"acknowledged" : true
}
----