> ## 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.

# ML Model Followers & Votes

> Manage followers and votes for ML models

# Followers & Votes

Manage followers and votes for ML model entities.

## Followers

### Add Follower

`PUT /v1/mlmodels/{id}/followers`

**id** `string` *required*

UUID of the ML model.

**id** `string` *required*

UUID of the user to add as a follower (sent as request body string).

### Remove Follower

`DELETE /v1/mlmodels/{id}/followers/{userId}`

**id** `string` *required*

UUID of the ML model.

**userId** `string` *required*

UUID of the user to remove.

## Votes

### Add or Update Vote

`PUT /v1/mlmodels/{id}/vote`

**id** `string` *required*

UUID of the ML model.

**updatedVoteType** `string` *required*

Vote type: `votedUp`, `votedDown`, or `unVoted`.

```python PUT /v1/mlmodels/{id}/followers theme={null}
from metadata.sdk import client, configure
from metadata.sdk.entities import MLModels

configure(
    host="https://your-company.open-metadata.org/api",
    jwt_token="your-jwt-token"
)
rest = client().ometa.client

model_id = "6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2"
user_id = "user-uuid-here"

# Add a follower
model = MLModels.add_followers(model_id, [user_id])
print(f"Followers: {len(model.followers.root)}")

# Remove a follower
model = MLModels.remove_followers(model_id, [user_id])

# Add a vote
rest.put(f"/mlmodels/{model_id}/vote", json={"updatedVoteType": "votedUp"})

# Remove a vote
rest.put(f"/mlmodels/{model_id}/vote", json={"updatedVoteType": "unVoted"})
```

```java PUT /v1/mlmodels/{id}/followers theme={null}
import java.util.Map;
import java.util.UUID;
import org.openmetadata.sdk.network.HttpClient;
import org.openmetadata.sdk.network.HttpMethod;

// client is an initialized OpenMetadataClient.

HttpClient http = client.getHttpClient();

String modelId = "6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2";
UUID userId = UUID.fromString("b6f7a1e2-3c4d-4e5f-8a9b-0c1d2e3f4a5b");

// Add a follower
http.executeForString(HttpMethod.PUT, "/v1/mlmodels/" + modelId + "/followers", userId);

// Remove a follower
http.executeForString(HttpMethod.DELETE, "/v1/mlmodels/" + modelId + "/followers/" + userId, null);

// Add a vote
http.executeForString(HttpMethod.PUT, "/v1/mlmodels/" + modelId + "/vote", Map.of("updatedVoteType", "votedUp"));

// Remove a vote
http.executeForString(HttpMethod.PUT, "/v1/mlmodels/" + modelId + "/vote", Map.of("updatedVoteType", "unVoted"));
```

```bash PUT /v1/mlmodels/{id}/followers theme={null}
# Add a follower
curl -X PUT "{base_url}/api/v1/mlmodels/6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2/followers" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '"user-uuid-here"'

# Remove a follower
curl -X DELETE "{base_url}/api/v1/mlmodels/6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2/followers/user-uuid-here" \
  -H "Authorization: Bearer {access_token}"

# Add a vote
curl -X PUT "{base_url}/api/v1/mlmodels/6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2/vote" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{"updatedVoteType": "votedUp"}'

# Remove a vote
curl -X PUT "{base_url}/api/v1/mlmodels/6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2/vote" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{"updatedVoteType": "unVoted"}'
```

```json Response (Add Follower) theme={null}
{
  "id": "6b04e1d8-b66d-4f78-ab21-beb5be2cf4f2",
  "name": "customer_segmentation",
  "fullyQualifiedName": "mlflow_svc.customer_segmentation",
  "displayName": "Customer Segmentation Model",
  "algorithm": "KMeans",
  "version": 0.1,
  "updatedAt": 1769982669247,
  "updatedBy": "admin",
  "service": {
    "id": "ca22d46e-81b9-4e48-85b5-0adc44980da9",
    "type": "mlmodelService",
    "name": "mlflow_svc",
    "fullyQualifiedName": "mlflow_svc"
  },
  "serviceType": "Mlflow",
  "deleted": false,
  "followers": [
    {
      "id": "user-uuid-here",
      "type": "user",
      "name": "john.doe"
    }
  ],
  "owners": [],
  "tags": [],
  "domains": []
}
```

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission |
| `404` | `NOT_FOUND` | ML model or user does not exist |


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