Delete an unreferenced trained model Generally available; Added in 7.10.0

DELETE /_ml/trained_models/{model_id}

The request deletes a trained inference model that is not referenced by an ingest pipeline.

Required authorization

  • Cluster privileges: manage_ml

Path parameters

  • model_id string Required

    The unique identifier of the trained model.

Query parameters

  • force boolean

    Forcefully deletes a trained model that is referenced by ingest pipelines or has a started deployment.

  • timeout string

    Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

    Values are -1 or 0.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • acknowledged boolean Required

      For a successful response, this value is always true. On failure, an exception is returned instead.

DELETE /_ml/trained_models/{model_id}
DELETE _ml/trained_models/regression-job-one-1574775307356
resp = client.ml.delete_trained_model(
    model_id="regression-job-one-1574775307356",
)
const response = await client.ml.deleteTrainedModel({
  model_id: "regression-job-one-1574775307356",
});
response = client.ml.delete_trained_model(
  model_id: "regression-job-one-1574775307356"
)
$resp = $client->ml()->deleteTrainedModel([
    "model_id" => "regression-job-one-1574775307356",
]);
curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/regression-job-one-1574775307356"
Response examples (200)
A successful response when deleting an existing trained inference model.
{
  "acknowledged": true
}