Developers / API reference

Poll API

v3

Integrations built for the previous StrawPoll API keep working. Here is how v3 maps onto forms.

Base URL
https://api.strawpoll.com/v3
Spec
OpenAPI 3

Poll API v3 keeps working

Code written for the previous StrawPoll API keeps running. The v3 endpoints are served unchanged at https://api.strawpoll.com/v3 (and https://strawpoll.com/api/v3), take the same X-API-Key header and speak the same JSON, as described in the v3 OpenAPI spec.

New projects should use the Forms API (v4): it covers every question type, drafts, responses and invites. v3 will receive fixes, but no new features.

What a v3 poll is now

Every v3 poll is a form with one question:

v3 typeForm section
multiple_choice with text optionsmultiple_choice
multiple_choice with image optionspicture_choice
ranked_choiceranked_choice
meeting with date and time_range optionsmeeting

The poll id is the form’s slug and option ids are choice ids, so you can mix both APIs: create a poll through v3 and read its responses through v4, or the other way round. require_voter_names adds a contact section that asks for a name.

Forms with more than one question can be read through v3, which shows their first question. Changing them through v3 is refused with 409 unsupported_form, so v3 never removes questions it cannot see; use v4 for those.

Settings

poll_configForm setting
deadline_atclosesAt
duplication_checking: ip, session, invite, noneresponseDuplicateCheck: ip, session, code, none
results_visibility: always, after_vote, after_deadline, neverresultsVisibility: public, public_after_response, public_after_close, private
edit_vote_permissions: admin, admin_voter, voter, nobodyeditResponsePermissions: admin, admin_own_responses, own_responses, nobody
hide_participantsresponsesVisibility: private
allow_commentsallowComments, with public comments
allow_vpn_usersthe opposite of blockVPNUsers
force_appearance: light, dark, autothe light or dark StrawPoll theme, or none
is_multiple_choice, multiple_choice_min, multiple_choice_maxthe same, with 0 meaning no limit
allow_other_optionwrite-in answers
randomize_optionsshuffled options
allow_indeterminate“if need be” answers in meeting polls
require_voter_namesa name question; always on for meeting polls

PUT/polls/{id} keeps every setting you leave out of poll_config, and keeps the votes of options whose id you send back.

Forms set up in the editor can use checks v3 has no word for. They read as the closest v3 value: a name check as session, an email check as invite.

Differences to know about

  • Polls are published immediately. v3 had no drafts. Changes through PUT go live right away; a draft open in the editor is left alone.
  • is_private is always true. Polls are never listed publicly on the new platform.
  • Results. poll_votes are 1 (chosen or yes), 0 (not chosen or no), 2 (if need be) and null (not answered). For ranked_choice they are the place the voter gave the option, 1 being first. poll_participants is empty unless names are public or you own the poll. Results you are not allowed to see yet answer 403 results_hidden.
  • Write-in answers appear as extra options with is_write_in: true.
  • Comments are notes voters leave with their vote. You can list, read and (as the poll owner) delete them; POST/comments and PUT/comments/{id} answer 501.
  • Users. There are no public profiles: /users/@me (or your own id) works, any other user is 404. username is null and user_meta only holds defaults. PATCH/users/@me changes displayname.
  • Media. POST/upload takes images (JPEG, PNG, GIF or WebP, up to 5 MB). Videos, YouTube and Giphy media are not supported, so POST/media and PUT/media/{id} answer 501. DELETE/media/{id} refuses images a poll still shows.
  • Counters that no longer exist, such as view_count and points, are 0.
  • Errors are JSON objects with error and code, and the same rate limits apply as for v4.

Your existing keys

Keys from the previous platform keep working once your account has moved over. You can also create new keys in Settings → API keys; they work for v3 and v4.