FeedIndex

Votes

API endpoint for toggling votes on posts.

Toggle vote

Toggle a vote on a post. If the caller hasn't voted, this adds a vote. If they have, it removes it. Requires an API key.

POST /api/v1/public/posts/:id/vote

No request body is needed. The vote is identified by the caller's IP address and User-Agent (SHA-256 hashed).

The vote endpoint only works when anonymous voting is enabled on the board. If anonymous voting is disabled, the endpoint returns 403.

Response

{
  "hasVoted": true,
  "voteCount": 43
}
FieldTypeDescription
hasVotedbooleanWhether the caller now has an active vote
voteCountnumberUpdated total vote count for the post

Deduplication

For this API endpoint, votes are deduplicated by a salted SHA-256 hash of the caller's IP address + User-Agent — because server-to-server requests have no browser cookie to key on. The same client (same IP + UA) toggling the endpoint will alternate between adding and removing their vote.

On the hosted portal (/p/[orgSlug]/[boardSlug]), FeedIndex uses a different mechanism: a random identifier stored in a first-party cookie. No IP address is processed for portal voting. The cookie-based and hash-based votes share the same underlying column, so a voter who votes both through the portal and through this API from the same device will be counted twice (different identifiers). In practice this rarely matters because this endpoint is for server-to-server automation, not end-user interaction.

On this page