DELETE
/
api
/
v1
/
sdk
/
suggestions
/
{id}
/
vote
Delete Vote
curl --request DELETE \
  --url https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions/{id}/vote \
  --header 'Content-Type: application/json' \
  --data '{
  "userId": "<string>"
}'
Delete a vote to remove a user’s support from a suggestion. This allows users to change their mind and unvote suggestions.
id
string
required
ID of the suggestion to remove vote from (CUID format, e.g., clm7x1a2b000008l7h3k1b2c3)
userId
string
required
ID of the user removing the vote

Response Fields

Returns the deleted vote object:
FieldTypeRequiredDescription
idstringYesUnique vote identifier
suggestionIdstringYesID of the suggestion
userIdstringYesID of the user who removed the vote

Example Request

{
  "userId": "clm7x1a2b000008l7h3k1b2c3"
}

Example Response

{
  "id": "clm7x1a2b000008l7h3k1b2c3",
  "suggestionId": "clm7x1a2b000008l7h3k1b2c3",
  "userId": "clm7x1a2b000008l7h3k1b2c3"
}

Error Responses

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