DELETE /v1/mlmodels/{id}
from metadata.sdk import configure
from metadata.sdk.entities import MLModels
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
MLModels.delete("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2")
# Hard delete
MLModels.delete(
"6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2",
hard_delete=True
)
# Delete by name
MLModels.delete_by_name("mlflow_svc.customer_segmentation")
# Delete by name with options
MLModels.delete_by_name(
"mlflow_svc.customer_segmentation",
hard_delete=True
)
# Restore a soft-deleted ML model
MLModels.restore("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2")
import static org.openmetadata.sdk.fluent.MlModels.*;
// Soft delete
MlModels.delete("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2").execute();
// Hard delete
MlModels.delete("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2")
.hardDelete()
.execute();
// Delete by name
MlModels.deleteByName("mlflow_svc.customer_segmentation").execute();
// Restore
MlModels.restore("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2");
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/mlmodels/6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/mlmodels/6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/mlmodels/name/mlflow_svc.customer_segmentation" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted ML model
curl -X PUT "{base_url}/api/v1/mlmodels/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2"}'
{
"id": "6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2",
"name": "customer_segmentation",
"fullyQualifiedName": "mlflow_svc.customer_segmentation",
"displayName": "Customer Segmentation Model",
"algorithm": "KMeans",
"version": 0.2,
"updatedAt": 1769982669247,
"updatedBy": "admin",
"service": {
"id": "ca22d46e-81b9-4e48-85b5-0adc44980da9",
"type": "mlmodelService",
"name": "mlflow_svc",
"fullyQualifiedName": "mlflow_svc"
},
"serviceType": "Mlflow",
"deleted": true,
"owners": [],
"tags": [],
"domains": []
}
Delete an ML Model
Delete an ML model by ID or name, with soft/hard delete options
DELETE
/
v1
/
mlmodels
/
{id}
DELETE /v1/mlmodels/{id}
from metadata.sdk import configure
from metadata.sdk.entities import MLModels
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
MLModels.delete("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2")
# Hard delete
MLModels.delete(
"6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2",
hard_delete=True
)
# Delete by name
MLModels.delete_by_name("mlflow_svc.customer_segmentation")
# Delete by name with options
MLModels.delete_by_name(
"mlflow_svc.customer_segmentation",
hard_delete=True
)
# Restore a soft-deleted ML model
MLModels.restore("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2")
import static org.openmetadata.sdk.fluent.MlModels.*;
// Soft delete
MlModels.delete("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2").execute();
// Hard delete
MlModels.delete("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2")
.hardDelete()
.execute();
// Delete by name
MlModels.deleteByName("mlflow_svc.customer_segmentation").execute();
// Restore
MlModels.restore("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2");
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/mlmodels/6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/mlmodels/6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/mlmodels/name/mlflow_svc.customer_segmentation" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted ML model
curl -X PUT "{base_url}/api/v1/mlmodels/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2"}'
{
"id": "6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2",
"name": "customer_segmentation",
"fullyQualifiedName": "mlflow_svc.customer_segmentation",
"displayName": "Customer Segmentation Model",
"algorithm": "KMeans",
"version": 0.2,
"updatedAt": 1769982669247,
"updatedBy": "admin",
"service": {
"id": "ca22d46e-81b9-4e48-85b5-0adc44980da9",
"type": "mlmodelService",
"name": "mlflow_svc",
"fullyQualifiedName": "mlflow_svc"
},
"serviceType": "Mlflow",
"deleted": true,
"owners": [],
"tags": [],
"domains": []
}
Delete an ML Model
Delete an ML model by ID or fully qualified name. Supports soft delete (default), hard delete, and restore operations.Delete by ID
string
required
UUID of the ML model to delete.
boolean
default:"false"
Recursively delete child entities.
boolean
default:"false"
Permanently delete the ML model. If
false, the ML model is soft-deleted and can be restored.Delete by Name
UseDELETE /v1/mlmodels/name/{fqn} to delete by fully qualified name.
string
required
Fully qualified name of the ML model (e.g.,
mlflow_svc.customer_segmentation).boolean
default:"false"
Recursively delete child entities.
boolean
default:"false"
Permanently delete the ML model.
Restore a Soft-Deleted ML Model
UsePUT /v1/mlmodels/restore to restore a soft-deleted ML model.
string
required
UUID of the soft-deleted ML model to restore.
DELETE /v1/mlmodels/{id}
from metadata.sdk import configure
from metadata.sdk.entities import MLModels
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
MLModels.delete("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2")
# Hard delete
MLModels.delete(
"6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2",
hard_delete=True
)
# Delete by name
MLModels.delete_by_name("mlflow_svc.customer_segmentation")
# Delete by name with options
MLModels.delete_by_name(
"mlflow_svc.customer_segmentation",
hard_delete=True
)
# Restore a soft-deleted ML model
MLModels.restore("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2")
import static org.openmetadata.sdk.fluent.MlModels.*;
// Soft delete
MlModels.delete("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2").execute();
// Hard delete
MlModels.delete("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2")
.hardDelete()
.execute();
// Delete by name
MlModels.deleteByName("mlflow_svc.customer_segmentation").execute();
// Restore
MlModels.restore("6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2");
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/mlmodels/6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/mlmodels/6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/mlmodels/name/mlflow_svc.customer_segmentation" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted ML model
curl -X PUT "{base_url}/api/v1/mlmodels/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2"}'
{
"id": "6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2",
"name": "customer_segmentation",
"fullyQualifiedName": "mlflow_svc.customer_segmentation",
"displayName": "Customer Segmentation Model",
"algorithm": "KMeans",
"version": 0.2,
"updatedAt": 1769982669247,
"updatedBy": "admin",
"service": {
"id": "ca22d46e-81b9-4e48-85b5-0adc44980da9",
"type": "mlmodelService",
"name": "mlflow_svc",
"fullyQualifiedName": "mlflow_svc"
},
"serviceType": "Mlflow",
"deleted": true,
"owners": [],
"tags": [],
"domains": []
}
Returns
Soft delete returns the ML model object withdeleted: true. Hard delete returns no content (204). Restore returns the restored ML model object.
Error Handling
| Code | Error Type | Description |
|---|---|---|
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to delete this ML model |
404 | NOT_FOUND | ML model with given ID or FQN does not exist |
Was this page helpful?
⌘I