Vote on updates
Records an up or downvote for an update. This endpoint powers the reactions on the embeddable release notes widget: you generally don’t need to call it directly, but it’s documented here for completeness and for custom widget integrations.
POST /api/projects/{project_id}/updates/{update_id}/voteAuthentication
Section titled “Authentication”None. This endpoint is public so the widget can record votes from a visitor’s browser without exposing an API token.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
project_id | string | The project the update belongs to. |
update_id | string | The update being voted on. |
Request body
Section titled “Request body”Send a JSON body identifying the voter and the reaction.
| Field | Type | Required | Description |
|---|---|---|---|
tracking_target_id | string | Yes | Identifier for the voter (e.g. a per-visitor ID your widget generates), used to attribute the vote. |
reaction | string | Yes | The vote to record. One of upvote or downvote. |
Vote behaviour
Section titled “Vote behaviour”A voter (identified by tracking_target_id) has at most one active reaction per
update:
- Sending a new reaction records it.
- Sending the same reaction again clears it (a toggle). The response then
reports
reaction: null. - Sending the opposite reaction switches the vote to the new value.
Example request
Section titled “Example request”curl -X POST \ https://updatify.io/api/projects/PROJECT_ID/updates/UPDATE_ID/vote \ -H "Content-Type: application/json" \ -d '{"tracking_target_id": "visitor-12345", "reaction": "upvote"}'Response
Section titled “Response”200 OK on success. reaction echoes the recorded vote, or is null when the
vote was toggled off:
{ "success": true, "update_id": "b3f1c2d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d", "reaction": "upvote"}Errors
Section titled “Errors”The API responds with 422 Unprocessable Entity if the
request can’t be processed.
If tracking_target_id is missing or blank:
{ "success": false, "errors": { "tracking_target_id": ["can't be blank"] }}If reaction is missing or not a supported value:
{ "success": false, "errors": { "reaction": ["must be one of: upvote, downvote"] }}If the update can’t be found for the given project:
{ "success": false, "errors": "Update not found"}If voting is disabled for the project (see voting_enabled):
{ "success": false, "errors": "Voting is disabled for this project"}