Poll
GET/api/v1/polls
Authorization
bearer_token In: header
Query Parameters
Full-text search query applied to poll title and description
1-indexed page number
int640 <= valuePage size
int640 <= valueSort field (created_at, total_ballots, option_count, title, closes_at)
Sort order (asc or desc)
Value in
- "asc"
- "desc"
Additional filter expressions in the form field:operator:value
Response Body
application/json
curl -X GET "https://example.com/api/v1/polls"{ "pagination": { "has_more": true, "page": 0, "page_size": 0, "total": 0 }, "polls": [ { "_relations": { "property1": { "has_more": true, "returned": 0, "total": 0 }, "property2": { "has_more": true, "returned": 0, "total": 0 } }, "ballots_visibility": "private", "before_close": "aggregate_only", "closes_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "created_by": "string", "description": "string", "identity_guard": { "allow_change_vote": true, "kind": "jwt_sub" }, "live_stream_enabled": true, "max_selections": 0, "metadata": null, "on_close": "freeze_results", "opens_at": "2019-08-24T14:15:22Z", "option_count": 0, "options": [ { "description": "string", "label": "string", "option_id": "string", "poll_id": "string", "position": 0, "status": "active", "write_in": true } ], "poll_id": "string", "quorum": null, "results_visibility": "public", "status": "draft", "strategy": "single_choice", "title": "string", "total_ballots": 0, "updated_at": "2019-08-24T14:15:22Z", "weighting": { "currency_id": "string", "domain": "string", "kind": "none", "max_weight": 0, "scale": 0, "snapshot": true, "static_weight": 0 }, "write_ins_enabled": true } ]}POST/api/v1/polls
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/polls" \ -H "Content-Type: application/json" \ -d '{ "options": [ "string" ], "title": "string" }'{ "created_at": "2019-08-24T14:15:22Z", "options": [ { "id": "string", "label": "string" } ], "poll_id": "string", "status": "draft"}GET/api/v1/polls/{poll_id}
Authorization
bearer_token In: header
Path Parameters
Query Parameters
Response Body
application/json
curl -X GET "https://example.com/api/v1/polls/string"{ "_relations": { "property1": { "has_more": true, "returned": 0, "total": 0 }, "property2": { "has_more": true, "returned": 0, "total": 0 } }, "ballots_visibility": "private", "before_close": "aggregate_only", "closes_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "created_by": "string", "description": "string", "identity_guard": { "allow_change_vote": true, "kind": "jwt_sub" }, "live_stream_enabled": true, "max_selections": 0, "metadata": null, "on_close": "freeze_results", "opens_at": "2019-08-24T14:15:22Z", "option_count": 0, "options": [ { "description": "string", "label": "string", "option_id": "string", "poll_id": "string", "position": 0, "status": "active", "write_in": true } ], "poll_id": "string", "quorum": null, "results_visibility": "public", "status": "draft", "strategy": "single_choice", "title": "string", "total_ballots": 0, "updated_at": "2019-08-24T14:15:22Z", "weighting": { "currency_id": "string", "domain": "string", "kind": "none", "max_weight": 0, "scale": 0, "snapshot": true, "static_weight": 0 }, "write_ins_enabled": true}GET/api/v1/polls/{poll_id}/ballot
Authorization
bearer_token In: header
Path Parameters
Response Body
application/json
curl -X GET "https://example.com/api/v1/polls/string/ballot"{ "ballot_id": "string", "poll_id": "string", "receipt": { "accepted_at": "2019-08-24T14:15:22Z", "ballot_hash": "string" }, "selections": [ { "option_id": "string", "rank": 0, "weight": 0 } ], "write_in": "string"}POST/api/v1/polls/{poll_id}/close
Authorization
bearer_token In: header
Path Parameters
Response Body
application/json
curl -X POST "https://example.com/api/v1/polls/string/close"{ "poll_id": "string", "status": "draft", "total_ballots": 0}POST/api/v1/polls/{poll_id}/finalize
Authorization
bearer_token In: header
Path Parameters
Response Body
application/json
curl -X POST "https://example.com/api/v1/polls/string/finalize"{ "poll_id": "string", "quorum_met": true, "status": "draft", "total_ballots": 0}POST/api/v1/polls/{poll_id}/options
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/polls/string/options" \ -H "Content-Type: application/json" \ -d '{ "label": "string" }'{ "label": "string", "option_id": "string", "poll_id": "string", "position": 0}GET/api/v1/polls/{poll_id}/results
Authorization
bearer_token In: header
Path Parameters
Response Body
application/json
curl -X GET "https://example.com/api/v1/polls/string/results"{ "irv_rounds": [ { "counts": { "property1": 0, "property2": 0 }, "eliminated": "string", "round": 0 } ], "options": [ { "label": "string", "option_id": "string", "votes": 0, "weighted_votes": 0 } ], "poll_id": "string", "quorum": null, "status": "draft", "strategy": "single_choice", "total_ballots": 0, "updated_at": "2019-08-24T14:15:22Z", "winner": "string"}GET/api/v1/polls/{poll_id}/stream
Authorization
bearer_token In: header
Path Parameters
Query Parameters
JWT token (alternative to the Authorization header for browser clients)
Response Body
curl -X GET "https://example.com/api/v1/polls/string/stream"POST/api/v1/polls/{poll_id}/vote
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/polls/string/vote" \ -H "Content-Type: application/json" \ -d '{}'{ "accepted": true, "ballot_id": "string", "poll_id": "string", "receipt": { "accepted_at": "2019-08-24T14:15:22Z", "ballot_hash": "string" }}