2024-02-20 12:09:31 -05:00
---
layout : default
title : Delete controller
parent : Controller APIs
2026-11-30 10:49:53 -05:00
grand_parent : ML APIs
2024-02-20 12:09:31 -05:00
nav_order : 50
---
2026-11-30 10:49:53 -05:00
# Delete Controller API
2024-02-20 12:09:31 -05:00
**Introduced 2.12**
{: .label .label-purple }
Use this API to delete a controller for a model based on the `model_id` .
2026-11-30 10:49:53 -05:00
## Endpoints
2024-02-20 12:09:31 -05:00
```json
2026-11-30 10:49:53 -05:00
DELETE /_plugins/_ml/controllers/ { model_id }
2024-02-20 12:09:31 -05:00
```
## Path parameters
The following table lists the available path parameters.
| Parameter | Data type | Description |
| :--- | :--- | :--- |
| `model_id` | String | The model ID of the model for which to delete the controller. |
2026-11-30 10:49:53 -05:00
## Example request
2024-02-20 12:09:31 -05:00
```json
DELETE /_plugins/_ml/controllers/MzcIJX 8 BA 7 mbufL 6 DOwl
```
{% include copy-curl.html %}
2026-11-30 10:49:53 -05:00
## Example response
2024-02-20 12:09:31 -05:00
```json
{
"_index" : ".plugins-ml-controller" ,
"_id" : "MzcIJX8BA7mbufL6DOwl" ,
"_version" : 2 ,
"result" : "deleted" ,
2026-11-30 10:49:53 -05:00
"forced_refresh" : true ,
2024-02-20 12:09:31 -05:00
"_shards" : {
"total" : 2 ,
"successful" : 2 ,
"failed" : 0
},
"_seq_no" : 27 ,
"_primary_term" : 18
}
```
2026-11-30 10:49:53 -05:00
## Error responses
If you attempt to delete a controller that doesn't exist, OpenSearch returns a 404 Not Found error. The following error is returned when the controller index doesn't exist:
```json
{
"error" : {
"root_cause" : [
{
"type" : "index_not_found_exception" ,
"reason" : "no such index [.plugins-ml-controller]" ,
"index" : ".plugins-ml-controller" ,
"resource.id" : ".plugins-ml-controller" ,
"resource.type" : "index_expression" ,
"index_uuid" : "_na_"
}
],
"type" : "index_not_found_exception" ,
"reason" : "no such index [.plugins-ml-controller]" ,
"index" : ".plugins-ml-controller" ,
"resource.id" : ".plugins-ml-controller" ,
"resource.type" : "index_expression" ,
"index_uuid" : "_na_"
},
"status" : 404
}
```
2024-02-20 12:09:31 -05:00
## Required permissions
If you use the Security plugin, make sure you have the appropriate permissions: `cluster:admin/opensearch/ml/controllers/delete` .