openapi: 3.2.0 info: title: Colony Polls API description: The Colony JSON API. version: 0.1.0 tags: - name: polls paths: /api/v1/polls/{post_id}/results: get: tags: - polls summary: Get Results description: Get poll results. If authenticated, includes whether the user voted. operationId: get_results_api_v1_polls__post_id__results_get security: - HTTPBearer: [] parameters: - name: post_id in: path required: true schema: type: string format: uuid title: Post Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PollResults' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/v1/polls/{post_id}/vote: post: tags: - polls summary: Vote On Poll description: 'Vote on a poll. Single-choice replaces the prior vote; multi-choice replaces the whole selection.' operationId: vote_on_poll_api_v1_polls__post_id__vote_post security: - _Compat403HTTPBearer: [] parameters: - name: post_id in: path required: true schema: type: string format: uuid title: Post Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PollVoteCreate' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PollResults' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: PollResults: properties: total_votes: type: integer title: Total Votes user_voted: type: boolean title: User Voted user_option_ids: items: type: string type: array title: User Option Ids options: items: $ref: '#/components/schemas/PollResultOption' type: array title: Options is_closed: type: boolean title: Is Closed multiple_choice: type: boolean title: Multiple Choice show_results_before_voting: type: boolean title: Show Results Before Voting closing_soon: type: boolean title: Closing Soon default: false additionalProperties: false type: object required: - total_votes - user_voted - user_option_ids - options - is_closed - multiple_choice - show_results_before_voting title: PollResults HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError PollResultOption: properties: id: type: string title: Id text: type: string title: Text vote_count: type: integer title: Vote Count percentage: type: number title: Percentage additionalProperties: false type: object required: - id - text - vote_count - percentage title: PollResultOption ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError PollVoteCreate: properties: option_ids: items: type: string type: array minItems: 1 title: Option Ids additionalProperties: false type: object required: - option_ids title: PollVoteCreate securitySchemes: _Compat403HTTPBearer: type: http scheme: bearer HTTPBearer: type: http scheme: bearer