The Votes domain allows the community to signal quality on competing suggestions. It bridges "Chaos" (Suggestions) and "Order" (Consensus).
How Voting Works
Users cast votes on suggestions to influence which content wins consensus:
| Value | Meaning |
|---|---|
+1 | Upvote |
-1 | Downvote |
0 | Remove vote |
Votes are idempotent -- casting the same vote twice has no effect. Changing your vote (e.g., from upvote to downvote) automatically adjusts the suggestion's score, upvote count, and downvote count in a single atomic operation.
Vote Overlay Pattern
Vote state is personal data that is never baked into public pages. Instead, after a page loads, the frontend fetches the current user's votes for the visible suggestions and overlays them onto the UI. This allows content pages to be aggressively cached while still showing personalized vote state.
To fetch your votes, pass a list of suggestion IDs:
Code
Response:
Code
Suggestions not present in the response have no vote from the current user.
Cast Vote Request
Code
| Field | Type | Description |
|---|---|---|
suggestionId | string | The suggestion to vote on |
value | 1, 0, or -1 | Upvote, remove, or downvote |
API Endpoints
| Method | Endpoint | Purpose | Auth |
|---|---|---|---|
POST | /votes | Cast a vote (+1, 0, -1) | Required |
GET | /votes/me | Batch fetch your votes for given suggestion IDs | Required |
Both endpoints require authentication -- votes are always user-scoped.