{"openapi":"3.1.0","info":{"title":"IAMMETER Voting Integration API","version":"0.2.0","description":"Public voting and application integration API. Keep application API keys on the host backend. Browser CORS requires a registered application_id query for host integrations."},"servers":[{"url":"https://vote.iammeter.com/api/v1"}],"paths":{"/health":{"get":{"summary":"Database readiness","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}}}},"/embed/polls/{id}":{"get":{"summary":"Authorized published poll metadata; never includes counts","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollMetadata"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"application_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/credentials/exchange":{"post":{"summary":"Trusted host identity exchange; scope identity:exchange","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Credential"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"security":[{"ApplicationBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"poll_id":{"type":"string","format":"uuid"},"subject":{"type":"string","minLength":1,"maxLength":200},"parent_origin":{"type":"string"},"identity_domain_id":{"type":"string","format":"uuid"}},"required":["poll_id","subject","parent_origin"]}}}}}},"/credentials/anonymous":{"post":{"summary":"Best-effort anonymous visitor credential","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Credential"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"poll_id":{"type":"string","format":"uuid"},"application_id":{"type":"string","format":"uuid"},"parent_origin":{"type":"string"},"visitor_id":{"type":"string","format":"uuid"}},"required":["poll_id","application_id","parent_origin","visitor_id"]}}}}}},"/polls/{id}/me":{"get":{"summary":"Read this voter’s current ballot, selected option IDs, version and change permission","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoterState"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"security":[{"VoterBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/polls/{id}/ballots":{"post":{"summary":"Cast the first ballot (201); exact operation retries return the original receipt (200)","responses":{"200":{"description":"Idempotent replay","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BallotReceipt"}}}},"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BallotReceipt"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"security":[{"VoterBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":128},"description":"New unique key per intended operation. Reuse key and identical payload for retries, including after obtaining a fresh token for the same voter. Do not reuse a submit key for a change."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"option_ids":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"string","format":"uuid"}}},"required":["option_ids"]}}}},"description":"Append-only initial submission. Returns already_voted for a new operation when this voter already has a ballot. Use PUT /ballot for changes. Fresh credentials can recover an operation using the same key and identical payload."}},"/polls/{id}/results":{"get":{"summary":"Grant and policy controlled results; after_vote requires matching application voter credential","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Results"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"application_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"VoterBearer":[]},{}]}},"/polls":{"post":{"summary":"Create owned draft; scope polls:write","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"security":[{"ApplicationBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollInput"}}}}},"get":{"summary":"Find this application resource links; scope polls:read","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"security":[{"ApplicationBearer":[]}],"parameters":[{"name":"resource_type","in":"query","required":true,"schema":{"type":"string"}},{"name":"resource_id","in":"query","required":true,"schema":{"type":"string"}}]}},"/polls/{id}/publish":{"post":{"summary":"publish own application poll; scope polls:write","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"security":[{"ApplicationBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/polls/{id}/close":{"post":{"summary":"close own application poll; scope polls:write","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"security":[{"ApplicationBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/public/polls/{id}":{"get":{"summary":"Standalone sharing: Authorized published poll metadata; never includes counts","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollMetadata"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/public/polls/{id}/me":{"get":{"summary":"Read this voter’s current ballot, selected option IDs, version and change permission","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoterState"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"security":[{"VoterBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/public/polls/{id}/ballots":{"post":{"summary":"Cast the first ballot (201); exact operation retries return the original receipt (200)","responses":{"200":{"description":"Idempotent replay","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BallotReceipt"}}}},"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BallotReceipt"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"security":[{"VoterBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":128},"description":"New unique key per intended operation. Reuse key and identical payload for retries, including after obtaining a fresh token for the same voter. Do not reuse a submit key for a change."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"option_ids":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"string","format":"uuid"}}},"required":["option_ids"]}}}},"description":"Append-only initial submission. Returns already_voted for a new operation when this voter already has a ballot. Use PUT /ballot for changes. Fresh credentials can recover an operation using the same key and identical payload."}},"/public/polls/{id}/results":{"get":{"summary":"Standalone sharing: Grant and policy controlled results; after_vote requires matching application voter credential","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Results"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"VoterBearer":[]},{}]}},"/public/polls/{id}/credentials":{"post":{"summary":"Public sharing anonymous credential","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Credential"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["visitor_id"],"properties":{"visitor_id":{"type":"string","format":"uuid"}}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/polls/{id}/ballot":{"put":{"summary":"Replace this voter’s ballot choices, with optimistic version checking","responses":{"200":{"description":"Replacement succeeded, or original historical receipt replayed; inspect replayed and version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BallotReceipt"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"vote_changes_not_allowed, revoked/disabled application or grant, unapproved origin, or credential context mismatch.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ballot_version_conflict, ballot_not_found, idempotency_conflict, credential_already_consumed, poll_not_open, poll_not_started or poll_ended. Refresh /me after a version conflict; failed operations do not consume the credential.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"security":[{"VoterBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":128},"description":"New unique key per intended operation. Reuse key and identical payload for retries, including after obtaining a fresh token for the same voter. Do not reuse a submit key for a change."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["option_ids","expected_version"],"properties":{"option_ids":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"items":{"type":"string","format":"uuid"}},"expected_version":{"type":"integer","minimum":1,"maximum":2147483646,"description":"Version from GET /me or the last successful write. Refresh /me after a 409 conflict."}}}}}},"description":"Requires allow_vote_changes=true, an existing ballot, a current authorized fresh single-use voting token, an open poll, and expected_version matching GET /me. Replaces the complete option set atomically, increments version, preserves ballot ID and total voters. Every successful new PUT increments version, even with identical choices. Exact retries return their immutable historical receipt without reapplying it."}},"/public/polls/{id}/ballot":{"put":{"summary":"Replace this voter’s ballot choices, with optimistic version checking","responses":{"200":{"description":"Replacement succeeded, or original historical receipt replayed; inspect replayed and version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BallotReceipt"}}}},"401":{"description":"Missing or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"vote_changes_not_allowed, revoked/disabled application or grant, unapproved origin, or credential context mismatch.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ballot_version_conflict, ballot_not_found, idempotency_conflict, credential_already_consumed, poll_not_open, poll_not_started or poll_ended. Refresh /me after a version conflict; failed operations do not consume the credential.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; text response"}},"security":[{"VoterBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":128},"description":"New unique key per intended operation. Reuse key and identical payload for retries, including after obtaining a fresh token for the same voter. Do not reuse a submit key for a change."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["option_ids","expected_version"],"properties":{"option_ids":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"items":{"type":"string","format":"uuid"}},"expected_version":{"type":"integer","minimum":1,"maximum":2147483646,"description":"Version from GET /me or the last successful write. Refresh /me after a 409 conflict."}}}}}},"description":"Requires allow_vote_changes=true, an existing ballot, a current authorized fresh single-use voting token, an open poll, and expected_version matching GET /me. Replaces the complete option set atomically, increments version, preserves ballot ID and total voters. Every successful new PUT increments version, even with identical choices. Exact retries return their immutable historical receipt without reapplying it."}},"/polls/{id}/vote-change-policy":{"post":{"summary":"Enable or disable vote changes without changing poll content","description":"Only draft or published polls. Host backend requires polls:write and ownership; organization editors/admins use the protected administration variant. Defaults remain false until explicitly enabled. Replays of earlier successful votes are still readable after disabling.","security":[{"ApplicationBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoteChangePolicy"}}}},"responses":{"200":{"description":"Policy updated","content":{"application/json":{"schema":{"type":"object","required":["id","allow_vote_changes"],"properties":{"id":{"type":"string","format":"uuid"},"allow_vote_changes":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid credentials"},"403":{"description":"scope_required, poll_owner_required, or insufficient organization role"},"409":{"description":"vote_change_policy_locked: closed or archived polls cannot change this policy"},"422":{"description":"A boolean allow_vote_changes is required"}}}}},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"request_id":{"type":"string"},"issues":{"type":"array","items":{"type":"object"}}}},"PollMetadata":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":4000,"default":""},"identity_mode":{"type":"string","enum":["anonymous","authenticated","mixed"]},"results_policy":{"type":"string","enum":["public","after_vote","after_close","private"]},"min_choices":{"type":"integer","minimum":1,"maximum":20,"default":1},"max_choices":{"type":"integer","minimum":1,"maximum":20,"default":1},"starts_at":{"type":["string","null"],"format":"date-time"},"ends_at":{"type":["string","null"],"format":"date-time"},"allow_vote_changes":{"type":"boolean","default":false,"description":"Opt in to replacing an existing ballot while voting is open. One ballot per voter remains enforced."},"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["published","closed"]},"options":{"type":"array","items":{"type":"object","required":["id","label","position"],"properties":{"id":{"type":"string","format":"uuid"},"label":{"type":"string"},"position":{"type":"integer"}}}},"allowed_origins":{"type":"array","items":{"type":"string"},"description":"Configured website rules, including bare domains; public-link metadata returns an empty list."},"can_vote":{"type":"boolean","description":"Application grant permission; the poll window and current voter state are separate checks."}},"required":["id","title","options","status","identity_mode","results_policy","allow_vote_changes","can_vote","min_choices","max_choices","allowed_origins"]},"Credential":{"type":"object","required":["token","expires_at","has_voted"],"properties":{"token":{"type":"string","description":"Opaque 256-bit bearer; keep in memory only"},"expires_at":{"type":"string","format":"date-time"},"has_voted":{"type":"boolean"}}},"VoterState":{"type":"object","required":["has_voted","allow_vote_changes","can_change_vote","ballot"],"properties":{"has_voted":{"type":"boolean"},"allow_vote_changes":{"type":"boolean"},"can_change_vote":{"type":"boolean","description":"True only when this voter already has a ballot and the poll policy, voting window and current grant permit changes. A fresh single-use credential is still required for a new write."},"ballot":{"anyOf":[{"$ref":"#/components/schemas/BallotSnapshot"},{"type":"null"}]}}},"BallotSnapshot":{"type":"object","required":["id","version","option_ids","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1},"option_ids":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"items":{"type":"string","format":"uuid"}},"updated_at":{"type":"string","format":"date-time"}}},"BallotReceipt":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"replayed":{"type":"boolean"},"version":{"type":"integer","minimum":1},"option_ids":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"items":{"type":"string","format":"uuid"}}},"required":["id","version","option_ids","replayed"],"description":"Immutable result of this operation. Replays return the original version and choices, which may be older than the current ballot; GET /me is authoritative."},"Results":{"type":"object","required":["total_voters","options"],"properties":{"total_voters":{"type":"integer"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"label":{"type":"string"},"votes":{"type":"integer"},"percentage":{"type":"number"}}}}}},"PollInput":{"type":"object","required":["title","identity_mode","results_policy","options"],"properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":4000,"default":""},"identity_mode":{"type":"string","enum":["anonymous","authenticated","mixed"]},"results_policy":{"type":"string","enum":["public","after_vote","after_close","private"]},"min_choices":{"type":"integer","minimum":1,"maximum":20,"default":1},"max_choices":{"type":"integer","minimum":1,"maximum":20,"default":1},"starts_at":{"type":["string","null"],"format":"date-time"},"ends_at":{"type":["string","null"],"format":"date-time"},"options":{"type":"array","minItems":2,"maxItems":20,"items":{"type":"string","minLength":1,"maxLength":300}},"resource_type":{"type":"string","maxLength":50},"resource_id":{"type":"string","maxLength":200},"allow_vote_changes":{"type":"boolean","default":false,"description":"Opt in to replacing an existing ballot while voting is open. One ballot per voter remains enforced."}}},"VoteChangePolicy":{"type":"object","required":["allow_vote_changes"],"properties":{"allow_vote_changes":{"type":"boolean"}}}},"securitySchemes":{"ApplicationBearer":{"type":"http","scheme":"bearer","bearerFormat":"opaque application key"},"VoterBearer":{"type":"http","scheme":"bearer","bearerFormat":"opaque 5-minute voting credential"}}},"externalDocs":{"description":"Public API documentation","url":"https://vote.iammeter.com/docs/api"}}