Skip to main content
POST
/
votes
/
:id_movie
/
:id_user
curl -X POST https://api.marsai.com/votes/5/10 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "note": 8.5,
    "comments": "Outstanding film with great performances"
  }'
{
  "message": "Vote créé",
  "newVote": {
    "id_vote": 1,
    "id_user": 10,
    "id_movie": 5,
    "note": 8.5,
    "comments": "Outstanding film with great performances"
  }
}
This endpoint requires ADMIN authentication.
Creates a new vote for a specific movie and user. This is an admin-only endpoint for manual vote creation.

Path Parameters

id_movie
integer
required
The ID of the movie to vote on
id_user
integer
required
The ID of the user casting the vote

Body Parameters

note
number
required
The vote rating. Will be parsed as a float value.
comments
string
Optional comments about the movie

Response

message
string
Success message: “Vote créé”
newVote
object
The created vote object
curl -X POST https://api.marsai.com/votes/5/10 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "note": 8.5,
    "comments": "Outstanding film with great performances"
  }'
{
  "message": "Vote créé",
  "newVote": {
    "id_vote": 1,
    "id_user": 10,
    "id_movie": 5,
    "note": 8.5,
    "comments": "Outstanding film with great performances"
  }
}

Error Responses

409 Conflict
Vote already exists for this movie and user
{
  "message": "Vote déjà existant",
  "existingVote": { ... }
}
400 Bad Request
Invalid note value
{
  "error": "Note invalide"
}