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

# Delete Vote

> Delete a vote to remove a user's support from a suggestion

Delete a vote to remove a user's support from a suggestion. This allows users to change their mind and unvote suggestions.

<ParamField path="id" type="string" required>
  ID of the suggestion to remove vote from (CUID format, e.g., clm7x1a2b000008l7h3k1b2c3)
</ParamField>

<ParamField body="userId" type="string" required>
  ID of the user removing the vote
</ParamField>

## Response Fields

Returns the deleted vote object:

| Field        | Type   | Required | Description                         |
| ------------ | ------ | -------- | ----------------------------------- |
| id           | string | Yes      | Unique vote identifier              |
| suggestionId | string | Yes      | ID of the suggestion                |
| userId       | string | Yes      | ID of the user who removed the vote |

## Example Request

```json theme={null}
{
  "userId": "clm7x1a2b000008l7h3k1b2c3"
}
```

## Example Response

```json theme={null}
{
  "id": "clm7x1a2b000008l7h3k1b2c3",
  "suggestionId": "clm7x1a2b000008l7h3k1b2c3",
  "userId": "clm7x1a2b000008l7h3k1b2c3"
}
```

## Error Responses

| Status Code | Description                    | Example Response                                           |
| :---------- | :----------------------------- | :--------------------------------------------------------- |
| 400         | Bad request - User not found   | `{"error": "User not found"}`                              |
| 401         | Unauthorized - Invalid API key | `{"error": "Unauthorized"}`                                |
| 404         | Vote not found                 | `{"error": "Vote not found for this user and suggestion"}` |
| 500         | Internal server error          | `{"error": "Failed to delete vote"}`                       |
