{"openapi":"3.1.0","info":{"title":"AnonPolls public API","version":"1.0.0","summary":"Create an anonymous poll and read public totals. No login.","description":"AnonPolls doesn't collect accounts or names. Creators see only totals, never who voted for what. To limit repeat votes, it stores a one-way hash of the voter's network address with the vote, not the address itself. Normally each network votes once per poll, checked on the server. In classroom or office mode, each browser votes once. Polls are public to anyone with the link. Question at most 200 characters; 2–6 options for standard polls. POST /api/polls is the website create path (2 polls / 10 minutes per network). MCP at /mcp allows 300 creates/hour per network address, 20/hour per MCP session when a session id is present, and 2000/day globally. GET /api/polls/{id} returns the same public totals as the results page. It never includes voter-level data or the creator token."},"servers":[{"url":"https://anonpolls.com"}],"paths":{"/api/polls":{"post":{"operationId":"createPoll","summary":"Create an anonymous poll","description":"Same limits as the website form. Returns a creatorToken on create only — give the matching /my-polls/{token} URL only to the person who asked for the poll.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePollRequest"}}}},"responses":{"201":{"description":"Poll created. Includes creatorToken for the manage URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatorPoll"}}}},"400":{"description":"Invalid question, options, or vote limit fields."},"429":{"description":"Creating polls too quickly (2 per 10 minutes per network)."}}}},"/api/polls/{id}":{"get":{"operationId":"getPollResults","summary":"Public poll totals","description":"Same payload as the public results page. Never includes creatorToken, voter codes, or who voted.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Public poll with option totals.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicPoll"}}}},"404":{"description":"Poll is missing or not publicly available."}}}}},"components":{"schemas":{"CreatePollRequest":{"type":"object","required":["poll","options"],"properties":{"poll":{"type":"object","required":["question"],"properties":{"question":{"type":"string","minLength":1,"maxLength":200},"type":{"type":"string","default":"single"},"voteLimitMode":{"type":"string","enum":["network","device","code"],"default":"network"},"voterCodeLimit":{"type":"integer","minimum":1,"maximum":300,"description":"Required when voteLimitMode is code."},"isListed":{"type":"boolean","default":false,"description":"Opt in to public discovery. MCP creates always stay false."},"duration":{"type":"integer","minimum":0,"description":"Days. 0 means no expiry."}}},"options":{"type":"array","minItems":2,"maxItems":6,"items":{"type":"object","required":["text"],"properties":{"text":{"type":"string","minLength":1,"maxLength":100}}}}}},"PublicPollOption":{"type":"object","properties":{"id":{"type":"integer"},"pollId":{"type":"integer"},"text":{"type":"string"},"voteCount":{"type":"integer","nullable":true}}},"PublicPoll":{"type":"object","description":"Allowlisted public fields only. No creatorToken, codes, or addresses.","properties":{"id":{"type":"integer"},"question":{"type":"string"},"options":{"type":"array","items":{"$ref":"#/components/schemas/PublicPollOption"}},"totalVotes":{"type":"integer"},"voteLimitMode":{"type":"string","enum":["network","device","code"]}}},"CreatorPoll":{"allOf":[{"$ref":"#/components/schemas/PublicPoll"},{"type":"object","properties":{"creatorToken":{"type":"string","description":"Private. Use only to build /my-polls/{token} for the creator."},"voterCodes":{"type":"array","items":{"type":"string"},"description":"Plaintext codes on create only, code mode."}}}]}}}}