> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Update an ML Model Service

> Create or update an ML model service with a full request body

# Update an ML Model Service

Create an ML model service or update it if it already exists, using `PUT /v1/services/mlmodelServices` with the full request body. Send the complete definition, not just the fields you want to change. To change only some fields, use `PATCH` with a JSON Patch array and the `application/json-patch+json` content type, as shown in the PATCH examples below.

## Body Parameters

**name** `string` *required*

Name of the ML model service. Must be unique across all ML model services.

**serviceType** `string` *required*

Type of ML model service, for example `Mlflow`, `Sklearn`, `SageMaker`, `CustomMlModel`.

**connection** `object` *required*

Connection configuration specific to the service type.

**properties**

**config** `object`

Service-specific connection configuration, for example `trackingUri`, `registryUri` for Mlflow.

**displayName** `string`

Human-readable display name for the ML model service.

**description** `string`

Description of the ML model service in Markdown format.

**owners** `array`

Array of owner references (users or teams) to assign to the service.

**properties**

**id** `string`

UUID of the owner entity.

**type** `string`

Type of owner entity, for example `user`, `team`.

**name** `string`

Name of the owner entity.

**domains** `array`

Fully qualified names of the domains to assign for governance purposes.

**tags** `array`

Array of classification tags to apply to the ML model service.

**properties**

**tagFQN** `string` *required*

Fully qualified name of the tag.

**labelType** `string`

Type of label, for example `Manual`, `Derived`, `Propagated`.

**state** `string`

State of the tag, for example `Suggested`, `Confirmed`.

```bash PUT /v1/services/mlmodelServices theme={null}
curl -X PUT "{base_url}/api/v1/services/mlmodelServices" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "mlflow_svc",
    "serviceType": "Mlflow",
    "description": "Production MLflow tracking server",
    "connection": {
      "config": {
        "type": "Mlflow",
        "trackingUri": "http://localhost:8088",
        "registryUri": "http://localhost:8088",
        "supportsMetadataExtraction": true
      }
    }
  }'
```

```python PATCH /v1/services/mlmodelServices/{id} theme={null}
from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import (
    AuthProvider,
    OpenMetadataConnection,
)
from metadata.generated.schema.security.client.openMetadataJWTClientConfig import (
    OpenMetadataJWTClientConfig,
)
from metadata.ingestion.ometa.ometa_api import OpenMetadata
from metadata.generated.schema.entity.services.mlmodelService import MlModelService

metadata = OpenMetadata(
    OpenMetadataConnection(
        hostPort="https://your-company.open-metadata.org/api",
        authProvider=AuthProvider.openmetadata,
        securityConfig=OpenMetadataJWTClientConfig(jwtToken="your-jwt-token"),
    )
)

# Retrieve, modify, and update
svc = metadata.get_by_id(entity=MlModelService, entity_id="ca22d46e-81b9-4e48-85b5-0adc44980da9")
modified = svc.model_copy(deep=True)
modified.description = "Updated: Production MLflow tracking server with model registry"
modified.connection.config.trackingUri = "http://mlflow-prod:8088"
modified.connection.config.registryUri = "http://mlflow-prod:8088"
updated = metadata.patch(entity=MlModelService, source=svc, destination=modified)

print(f"Updated to version {updated.version.root}")
```

```java PATCH /v1/services/mlmodelServices/{id} theme={null}
import org.openmetadata.schema.entity.services.MlModelService;
import org.openmetadata.sdk.fluent.MlModelServices;

// Retrieve, modify, and update
MlModelService service = MlModelServices.retrieve("ca22d46e-81b9-4e48-85b5-0adc44980da9");
service.setDescription("Updated: Production MLflow tracking server with model registry");
MlModelService updated = MlModelServices.update(service);
```

```bash PATCH /v1/services/mlmodelServices/{id} theme={null}
# Update by ID
curl -X PATCH "{base_url}/api/v1/services/mlmodelServices/ca22d46e-81b9-4e48-85b5-0adc44980da9" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json-patch+json" \
  -d '[
    {"op": "replace", "path": "/description", "value": "Updated: Production MLflow tracking server with model registry"}
  ]'

# Update by name
curl -X PATCH "{base_url}/api/v1/services/mlmodelServices/name/mlflow_svc" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json-patch+json" \
  -d '[
    {"op": "replace", "path": "/description", "value": "Updated: Production MLflow tracking server with model registry"}
  ]'
```

```json Response theme={null}
{
  "id": "ca22d46e-81b9-4e48-85b5-0adc44980da9",
  "name": "mlflow_svc",
  "fullyQualifiedName": "mlflow_svc",
  "serviceType": "Mlflow",
  "description": "Updated: Production MLflow tracking server with model registry",
  "version": 0.2,
  "updatedAt": 1769982621618,
  "updatedBy": "admin",
  "href": "http://localhost:8585/api/v1/services/mlmodelServices/ca22d46e-81b9-4e48-85b5-0adc44980da9",
  "connection": {
    "config": {
      "type": "Mlflow",
      "trackingUri": "http://mlflow-prod:8088",
      "registryUri": "http://mlflow-prod:8088",
      "supportsMetadataExtraction": true
    }
  },
  "owners": [],
  "tags": [],
  "deleted": false,
  "domains": []
}
```

***

## Returns

Returns the updated ML model service object with the new version number.

## Response

**id** `string`

Unique identifier for the ML model service (UUID format).

**name** `string`

ML model service name.

**fullyQualifiedName** `string`

Fully qualified name of the service.

**description** `string`

Updated description.

**version** `number`

Incremented version number.

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `400` | `BAD_REQUEST` | Invalid or malformed request body |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to update this ML model service |
| `409` | `CONFLICT` | Concurrent modification detected |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.