Pollunit Votes API

The Votes API from Pollunit — 2 operation(s) for votes.

GitHub OpenAPI

Operations 5

GET /api/v1/polls/{poll_id}/votes List poll votes #
POST /api/v1/polls/{poll_id}/votes Create vote #
GET /api/v1/polls/{poll_id}/votes/{id} Get vote #
PATCH /api/v1/polls/{poll_id}/votes/{id} Update vote #
DELETE /api/v1/polls/{poll_id}/votes/{id} Delete vote #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/pollunit-com:pollunit-com-votes-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

pollunit-com-votes-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Pollunit Com Votes API
  version: v1
  description: 'Operations tagged Votes across 2 of this provider''s published API definitions: pollunit-com-openapi.json, pollunit-com-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://pollunit.com
  description: Production
- url: http://localhost:3000
  description: Development
security:
- bearerAuth: []
tags:
- name: Votes
paths:
  /api/v1/polls/{poll_id}/votes:
    parameters:
    - name: poll_id
      in: path
      description: Poll member_hash or admin_hash
      required: true
      schema:
        type: string
    - name: organization_id
      in: query
      required: false
      description: public_id of an organization the user belongs to. When given, the request runs in that organization context instead of the personal account.
      schema:
        type: string
    get:
      summary: List poll votes
      tags:
      - Votes
      security:
      - bearerAuth: []
      description: Returns one page of the votes of the poll, oldest first. Polls that hide their votes only list them with admin access. Pass `voter_id` or `option_id` to list the votes of one participant or one option. Use the X-Total-Pages / X-Total-Count response headers to page through the full list.
      parameters:
      - name: voter_id
        in: query
        required: false
        description: 'Voter public_id: only list the votes of this participant.'
        schema:
          type: string
      - name: option_id
        in: query
        required: false
        description: 'Option public_id: only list the votes for this option. Ignored when `voter_id` is given.'
        schema:
          type: string
      - name: page
        in: query
        required: false
        description: Page to return, 1-based. Defaults to 1.
        schema:
          type: integer
      - name: per
        in: query
        required: false
        description: Votes per page. Defaults to 30. At most 100.
        schema:
          type: integer
      responses:
        '200':
          description: votes listed
          headers:
            X-Page:
              schema:
                type: integer
              description: Current page, 1-based
            X-Per-Page:
              schema:
                type: integer
              description: Votes per page
            X-Total-Pages:
              schema:
                type: integer
              description: Number of pages
            X-Total-Count:
              schema:
                type: integer
              description: Total number of votes matching the request
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Vote'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '403':
          description: poll hides its votes
        '404':
          description: poll, participant or option not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
      operationId: getApiV1PollsByPollIdVotes
      x-operation-id-source: derived
    post:
      summary: Create vote
      tags:
      - Votes
      security:
      - bearerAuth: []
      description: Casts a vote of a participant for an option. Create the participant first; the participant has to belong to the requesting user — identified by the private token or, for anonymous users, by the X-POLLUNIT-USER-IDENTIFIER header. The poll has to accept votes, and its vote limits and access restrictions apply. For pairwise comparisons `option_id` is the winner and has to be one of the two options the options list currently returns for the participant; the other one is stored as `loser_option_id`. Polls that require a double opt in answer with 422 until the participant confirmed the opt in email; the vote is kept and cast on confirmation.
      parameters:
      - name: X-POLLUNIT-USER-IDENTIFIER
        in: header
        required: false
        description: 'Your own identification of the user on whose behalf the request is made, any string. The user identifiers should not be guessable and stay secret, otherwise users could get access to other users'' contents. Only used with a public API token: the created or changed object belongs to that anonymous user instead of the token owner, which keeps the user in control of it in later requests with the same identifier.'
        schema:
          type: string
      - name: X-POLLUNIT-POLL-PASSWORD
        in: header
        required: false
        description: Access password of the poll. Only needed for password protected polls.
        schema:
          type: string
      responses:
        '201':
          description: vote created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Vote'
        '200':
          description: bought votes have to be paid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VotePayment'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '403':
          description: forbidden (the participant belongs to somebody else)
        '404':
          description: poll, participant or option not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '422':
          description: invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoteCreateRequest'
      operationId: postApiV1PollsByPollIdVotes
      x-operation-id-source: derived
    servers:
    - url: https://pollunit.com
      description: Production
    - url: http://localhost:3000
      description: Development
  /api/v1/polls/{poll_id}/votes/{id}:
    parameters:
    - name: poll_id
      in: path
      description: Poll member_hash or admin_hash
      required: true
      schema:
        type: string
    - name: id
      in: path
      description: Vote id
      required: true
      schema:
        type: string
    - name: organization_id
      in: query
      required: false
      description: public_id of an organization the user belongs to. When given, the request runs in that organization context instead of the personal account.
      schema:
        type: string
    get:
      summary: Get vote
      tags:
      - Votes
      security:
      - bearerAuth: []
      description: Polls that hide their votes only return the own votes of the requesting user, or any vote with admin access. For polls with `vote_per_day` only the votes of the current day are found.
      parameters:
      - name: X-POLLUNIT-USER-IDENTIFIER
        in: header
        required: false
        description: 'Your own identification of the user on whose behalf the request is made, any string. The user identifiers should not be guessable and stay secret, otherwise users could get access to other users'' contents. Only used with a public API token: the created or changed object belongs to that anonymous user instead of the token owner, which keeps the user in control of it in later requests with the same identifier.'
        schema:
          type: string
      - name: X-POLLUNIT-POLL-PASSWORD
        in: header
        required: false
        description: Access password of the poll. Only needed for password protected polls.
        schema:
          type: string
      responses:
        '200':
          description: vote found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Vote'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '403':
          description: poll hides the votes of other participants
        '404':
          description: vote not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
      operationId: getApiV1PollsByPollIdVotesById
      x-operation-id-source: derived
    patch:
      summary: Update vote
      tags:
      - Votes
      security:
      - bearerAuth: []
      description: Changes the value of a vote. The vote has to belong to the requesting user and the poll has to still accept votes. Admins may additionally change the votes of other participants of voting and table polls. Polls that sell votes do not allow lowering `vote`, and answer with the payment page instead of the vote when more votes are bought. For polls with `vote_per_day` only the votes of the current day can be changed.
      parameters:
      - name: X-POLLUNIT-USER-IDENTIFIER
        in: header
        required: false
        description: 'Your own identification of the user on whose behalf the request is made, any string. The user identifiers should not be guessable and stay secret, otherwise users could get access to other users'' contents. Only used with a public API token: the created or changed object belongs to that anonymous user instead of the token owner, which keeps the user in control of it in later requests with the same identifier.'
        schema:
          type: string
      - name: X-POLLUNIT-POLL-PASSWORD
        in: header
        required: false
        description: Access password of the poll. Only needed for password protected polls.
        schema:
          type: string
      responses:
        '200':
          description: vote updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Vote'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '403':
          description: forbidden (the vote belongs to somebody else)
        '404':
          description: vote not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '422':
          description: invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoteUpdateRequest'
      operationId: patchApiV1PollsByPollIdVotesById
      x-operation-id-source: derived
    delete:
      summary: Delete vote
      tags:
      - Votes
      security:
      - bearerAuth: []
      description: Removes a vote. Requires that the vote belongs to the requesting user and the poll still accepts votes, or admin access with an account that allows deleting. Votes of polls with a voting wallet can not be deleted. For polls with `vote_per_day` only the votes of the current day can be deleted.
      parameters:
      - name: X-POLLUNIT-USER-IDENTIFIER
        in: header
        required: false
        description: 'Your own identification of the user on whose behalf the request is made, any string. The user identifiers should not be guessable and stay secret, otherwise users could get access to other users'' contents. Only used with a public API token: the created or changed object belongs to that anonymous user instead of the token owner, which keeps the user in control of it in later requests with the same identifier.'
        schema:
          type: string
      - name: X-POLLUNIT-POLL-PASSWORD
        in: header
        required: false
        description: Access password of the poll. Only needed for password protected polls.
        schema:
          type: string
      responses:
        '204':
          description: vote deleted
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '403':
          description: forbidden (the vote belongs to somebody else)
        '404':
          description: vote not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
      operationId: deleteApiV1PollsByPollIdVotesById
      x-operation-id-source: derived
    servers:
    - url: https://pollunit.com
      description: Production
    - url: http://localhost:3000
      description: Development
components:
  schemas:
    VotePayment:
      type: object
      description: Returned instead of the vote when the poll sells votes (`voting_fee_type` `voting_sell_votes`). The vote is saved, but the bought votes only count once the payment page has been completed.
      properties:
        message:
          type: string
          example: Complete payment for voter
        url:
          type: string
          format: uri
          description: Payment page for the bought votes.
    VoteCreateRequest:
      type: object
      properties:
        voter_id:
          type: string
          description: Voter public_id of the participant who votes
        option_id:
          type: string
          description: Option public_id
        vote:
          allOf:
          - $ref: '#/components/schemas/VoteInput'
          - type: object
            properties:
              voting_category_id:
                type:
                - integer
                - 'null'
                description: 'Required when the poll has `voting_categories`: id of one of them, as listed in the poll show response.'
      required:
      - voter_id
      - option_id
      - vote
    NotFound:
      type: object
      properties:
        error:
          type: string
          example: Not Found
    Unauthorized:
      type: object
      properties:
        error:
          type: string
          example: Unauthorized
    VoteUpdateRequest:
      type: object
      properties:
        vote:
          $ref: '#/components/schemas/VoteInput'
      required:
      - vote
    VoteInput:
      type: object
      properties:
        vote:
          type:
          - integer
          - 'null'
          example: 1
          description: Numeric value of the vote. Its meaning depends on the poll's `vote_type`, e.g. `1` for yes or the number of stars. For polls with `voting_fee_type` `voting_sell_votes` it is the number of votes to buy.
        vote_text:
          type:
          - string
          - 'null'
          description: Value of text votes, e.g. table columns.
    Errors:
      type: object
      properties:
        error:
          type: string
          example: Unprocessable Entity
        errors:
          type: object
    Vote:
      type: object
      description: A vote of one participant for one option. Which value field is set depends on the poll's `vote_type`.
      properties:
        id:
          type: string
          description: Vote id
        type:
          type: string
          example: Votes::RatingVote
        created_at:
          type:
          - string
          - 'null'
          format: date-time
        updated_at:
          type:
          - string
          - 'null'
          format: date-time
        option_id:
          type:
          - string
          - 'null'
          description: Option public_id. For pairwise comparisons the option that won the comparison.
        loser_option_id:
          type:
          - string
          - 'null'
          description: 'Pairwise comparisons only: option public_id of the option that lost the comparison.'
        voter_id:
          type:
          - string
          - 'null'
          description: Voter public_id
        vote:
          anyOf:
          - type:
            - number
            - 'null'
          - type:
            - string
            - 'null'
          description: The value of the vote, whichever of `vote`, `vote_date`, `vote_text` or the decimal value is set.
        vote_date:
          type:
          - string
          - 'null'
          format: date
          description: Day the vote was cast on, for polls with `vote_per_day`.
        vote_text:
          type:
          - string
          - 'null'
          description: Value of text votes, e.g. table columns.
        paid:
          type:
          - boolean
          - 'null'
          description: Admin access only, and only for polls with a voting wallet. `false` while bought votes are not paid yet.
        voting_category_id:
          type:
          - integer
          - 'null'
          description: Only for polls with `voting_categories`.
      required:
      - id
      - type
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: Personal API token — find yours under My Account → API.
x-refined-from:
- pollunit-com-openapi.json
- pollunit-com-openapi.yml