Delete Vote
curl --request DELETE \
--url https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions/{id}/vote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userId": "<string>"
}
'import requests
url = "https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions/{id}/vote"
payload = { "userId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({userId: '<string>'})
};
fetch('https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions/{id}/vote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions/{id}/vote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'userId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions/{id}/vote"
payload := strings.NewReader("{\n \"userId\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions/{id}/vote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions/{id}/vote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyVotes
Delete Vote
Delete a vote to remove a user’s support from a suggestion
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 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userId": "<string>"
}
'import requests
url = "https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions/{id}/vote"
payload = { "userId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({userId: '<string>'})
};
fetch('https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions/{id}/vote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions/{id}/vote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'userId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions/{id}/vote"
payload := strings.NewReader("{\n \"userId\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions/{id}/vote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://2d89d8691199.ngrok-free.app/api/v1/sdk/suggestions/{id}/vote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyDelete a vote to remove a user’s support from a suggestion. This allows users to change their mind and unvote suggestions.
string
required
ID of the suggestion to remove vote from (CUID format, e.g., clm7x1a2b000008l7h3k1b2c3)
string
required
ID of the user removing the vote
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
{
"userId": "clm7x1a2b000008l7h3k1b2c3"
}
Example Response
{
"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"} |
Was this page helpful?
⌘I