Skip to main content
PUT
/
votes
/
:id_vote
curl -X PUT https://api.marsai.com/votes/1 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "note": 9.0,
    "comments": "Revised opinion: truly exceptional cinematography"
  }'
{
  "id_vote": 1,
  "id_user": 10,
  "id_movie": 5,
  "note": 9.0,
  "comments": "Revised opinion: truly exceptional cinematography",
  "modification_count": 0
}
This endpoint requires ADMIN authentication.
Updates an existing vote’s rating or comments.

Path Parameters

id_vote
integer
required
The ID of the vote to update

Body Parameters

note
number
Updated vote rating (will be parsed as float)
comments
string
Updated comments
Both parameters are optional. Only provided fields will be updated.

Response

Returns the updated vote object with all fields.
id_vote
integer
Unique identifier for the vote
id_user
integer
ID of the user who cast the vote
id_movie
integer
ID of the movie being voted on
note
number
Updated vote rating
comments
string
Updated comments
modification_count
integer
Number of times the vote has been modified
curl -X PUT https://api.marsai.com/votes/1 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "note": 9.0,
    "comments": "Revised opinion: truly exceptional cinematography"
  }'
{
  "id_vote": 1,
  "id_user": 10,
  "id_movie": 5,
  "note": 9.0,
  "comments": "Revised opinion: truly exceptional cinematography",
  "modification_count": 0
}

Error Responses

404 Not Found
Vote not found
{
  "error": "Vote non trouvé"
}