{"components":{"responses":{"forbidden":{"content":{"application/json":{"example":{"errors":{"details":"Forbidden"}},"schema":{"type":"object"}}},"description":"Forbidden"},"no_content":{"description":"No Content"},"not_found":{"content":{"application/json":{"example":{"errors":{"details":"Not Found"}},"schema":{"type":"object"}}},"description":"Not Found"},"unauthorised":{"content":{"application/json":{"example":{"errors":{"details":"Unauthorised"}},"schema":{"type":"object"}}},"description":"Unauthorised"},"unprocessable_entity":{"content":{"application/json":{"example":{"errors":{"details":"Unprocessable Entity"}},"schema":{"type":"object"}}},"description":"Unprocessable Entity"}},"schemas":{"OkResponse":{"description":"Simple ok boolean response","example":{"ok":true},"properties":{"ok":{"description":"Operation completed successfully","type":"boolean"}},"required":["ok"],"title":"OkResponse","type":"object"},"Poll":{"description":"Public poll with questions and options","properties":{"description":{"nullable":true,"type":"string"},"ends_at":{"format":"date_time","nullable":true,"type":"string"},"intro_heading":{"nullable":true,"type":"string"},"intro_text":{"nullable":true,"type":"string"},"outro_heading":{"nullable":true,"type":"string"},"outro_text":{"nullable":true,"type":"string"},"public_token":{"type":"string"},"questions":{"items":{"$ref":"#/components/schemas/PollQuestion"},"type":"array"},"starts_at":{"format":"date_time","nullable":true,"type":"string"},"status":{"type":"string"},"title":{"type":"string"},"website_domain":{"nullable":true,"type":"string"},"widget_paths":{"items":{"type":"string"},"type":"array"}},"required":["title","status","public_token","questions"],"title":"Poll","type":"object"},"PollOption":{"description":"An option inside a poll question","properties":{"id":{"type":"integer"},"image":{"nullable":true,"type":"string"},"label_text":{"type":"string"},"order":{"type":"integer"}},"required":["id","label_text","order"],"title":"PollOption","type":"object"},"PollQuestion":{"description":"A question in a poll","properties":{"id":{"type":"integer"},"image":{"nullable":true,"type":"string"},"multiple_max_choices":{"nullable":true,"type":"integer"},"options":{"items":{"$ref":"#/components/schemas/PollOption"},"type":"array"},"order":{"type":"integer"},"prompt_text":{"type":"string"},"type":{"type":"string"}},"required":["id","type","prompt_text","order","options"],"title":"PollQuestion","type":"object"},"PollResults":{"description":"Aggregated poll results","properties":{"description":{"nullable":true,"type":"string"},"public_token":{"type":"string"},"questions":{"items":{"$ref":"#/components/schemas/PollResultsQuestion"},"type":"array"},"title":{"type":"string"},"total_responses":{"type":"integer"}},"required":["title","public_token","total_responses","questions"],"title":"PollResults","type":"object"},"PollResultsOption":{"description":"Option with aggregated votes","properties":{"id":{"type":"integer"},"label_text":{"type":"string"},"order":{"type":"integer"},"votes_count":{"type":"integer"}},"required":["id","label_text","order","votes_count"],"title":"PollResultsOption","type":"object"},"PollResultsQuestion":{"description":"Question with aggregated responses","properties":{"id":{"type":"integer"},"options":{"items":{"$ref":"#/components/schemas/PollResultsOption"},"type":"array"},"order":{"type":"integer"},"prompt_text":{"type":"string"},"responses_count":{"type":"integer"},"type":{"type":"string"}},"required":["id","prompt_text","type","order","responses_count","options"],"title":"PollResultsQuestion","type":"object"}},"securitySchemes":{"authorization":{"scheme":"bearer","type":"http"}}},"info":{"title":"Indie Polls API","version":"1.0"},"openapi":"3.0.0","paths":{"/api/polls/{token}":{"get":{"callbacks":{},"description":"Returns poll title, description and questions/options if the poll is active right now.","operationId":"IndiePollsApi.PollsController.show","parameters":[{"description":"Poll public token","in":"path","name":"token","required":true,"schema":{"type":"string"}},{"description":"If provided, the API will return 409 if this user already submitted this poll","in":"query","name":"external_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Poll"}}},"description":"Poll"},"404":{"$ref":"#/components/responses/not_found"}},"summary":"Get public poll by token","tags":["POLLS"]},"post":{"callbacks":{},"description":"Submit answers for a public poll. Requires the poll to be active.","operationId":"IndiePollsApi.PollsController.submit","parameters":[{"description":"Poll public token","in":"path","name":"token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}},"description":"Submitted"},"404":{"$ref":"#/components/responses/not_found"},"422":{"$ref":"#/components/responses/unprocessable_entity"}},"summary":"Submit poll answers","tags":["POLLS"]}},"/api/polls/{token}/results":{"get":{"callbacks":{},"description":"Returns aggregated results for a poll if show_results_public is true.","operationId":"IndiePollsApi.PollsController.result","parameters":[{"description":"Poll public token","in":"path","name":"token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollResults"}}},"description":"Poll Results"},"404":{"$ref":"#/components/responses/not_found"}},"summary":"Get poll results","tags":["POLLS"]}}},"security":[],"servers":[{"url":"https://indiepolls.io","variables":{}}],"tags":[]}