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

# Stored Procedure Followers & Votes

> Manage followers and votes for stored procedures

# Followers & Votes

Manage followers and votes for stored procedure entities.

## Followers

### Add Follower

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

**id** `string` *required*

UUID of the stored procedure.

**id** `string` *required*

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

### Remove Follower

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

**id** `string` *required*

UUID of the stored procedure.

**userId** `string` *required*

UUID of the user to remove.

## Votes

### Add or Update Vote

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

**id** `string` *required*

UUID of the stored procedure.

**updatedVoteType** `string` *required*

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

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

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

rest = client().ometa.client

sp_id = "770e8400-e29b-41d4-a716-446655440000"
user_id = "user-uuid-here"

# Add a follower
sp = StoredProcedures.add_followers(sp_id, [user_id])
print(f"Followers: {len(sp.followers.root)}")

# Remove a follower
sp = StoredProcedures.remove_followers(sp_id, [user_id])

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

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

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

// client is an initialized OpenMetadataClient.

String spId = "770e8400-e29b-41d4-a716-446655440000";
String userId = "b6f7a1e2-3c4d-4e5f-8a9b-0c1d2e3f4a5b";

// Add a follower
client.getHttpClient().executeForString(
    HttpMethod.PUT,
    "/v1/storedProcedures/" + spId + "/followers",
    UUID.fromString(userId)
);

// Remove a follower
client.getHttpClient().executeForString(
    HttpMethod.DELETE,
    "/v1/storedProcedures/" + spId + "/followers/" + userId,
    null
);

// Add a vote
client.getHttpClient().executeForString(
    HttpMethod.PUT,
    "/v1/storedProcedures/" + spId + "/vote",
    Map.of("updatedVoteType", "votedUp")
);

// Remove a vote
client.getHttpClient().executeForString(
    HttpMethod.PUT,
    "/v1/storedProcedures/" + spId + "/vote",
    Map.of("updatedVoteType", "unVoted")
);
```

```bash PUT /v1/storedProcedures/{id}/followers theme={null}
# Add a follower
curl -X PUT "{base_url}/api/v1/storedProcedures/d02b24fa-a246-4563-adf1-9ad21f251c0e/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/storedProcedures/d02b24fa-a246-4563-adf1-9ad21f251c0e/followers/user-uuid-here" \
  -H "Authorization: Bearer {access_token}"

# Add a vote
curl -X PUT "{base_url}/api/v1/storedProcedures/d02b24fa-a246-4563-adf1-9ad21f251c0e/vote" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{"updatedVoteType": "votedUp"}'

# Remove a vote
curl -X PUT "{base_url}/api/v1/storedProcedures/d02b24fa-a246-4563-adf1-9ad21f251c0e/vote" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{"updatedVoteType": "unVoted"}'
```

```json Response (Add Follower) theme={null}
{
  "id": "d02b24fa-a246-4563-adf1-9ad21f251c0e",
  "name": "calculate_average",
  "fullyQualifiedName": "sample_data.ecommerce_db.shopify.calculate_average",
  "description": "Procedure to calculate average",
  "storedProcedureCode": {
    "code": "CREATE OR REPLACE PROCEDURE calculate_average(numbers INT ARRAY) RETURNS FLOAT NOT NULL LANGUAGE SQL AS $$DECLARE sum_val INT = 0;count_val INT = 0;average_val FLOAT;BEGIN\n  FOR num IN ARRAY numbers DO sum_val := sum_val + num;\n  count_val := count_val + 1;\nEND FOR;\nIF count_val = 0 THEN\n  average_val := 0.0;\nELSE\n  average_val := sum_val / count_val;\nEND IF;\nRETURN average_val;\nEND;$$;"
  },
  "version": 0.1,
  "updatedAt": 1769982660822,
  "updatedBy": "admin",
  "storedProcedureType": "StoredProcedure",
  "databaseSchema": {
    "id": "4dd30184-009c-4792-b296-9562eaed651f",
    "type": "databaseSchema",
    "name": "shopify",
    "fullyQualifiedName": "sample_data.ecommerce_db.shopify"
  },
  "serviceType": "BigQuery",
  "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` | Stored procedure or user does not exist |


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