Polls
Works on
- iMessage
Send a poll, vote in one, and read every vote
A poll message asks a question with 2 to 12 choices. Votes come back as events you ask for, and your line can vote too.
Send a poll
curl -X POST https://api.mapier.ai/v1/commands/message.send \
-H "Authorization: Bearer $MAPIER_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: lunch-poll-1" \
-H "x-mapier-version: 2026-12-01" \
-d '{
"target": { "conversationId": "a0000000-0000-4000-8000-000000000001" },
"payload": { "kind": "poll", "question": "Where for lunch?", "options": ["Ramen", "Pho", "Tacos"] }
}'{
"commandId": "0192b3e1-…",
"status": "queued",
"repeated": false,
"lineId": "0192a7b0-…",
"lineSelection": "reused_active_chat",
"channel": "imessage"
}Limits
The question and each choice are 1 to 128 characters on one line, and each choice appears once. Nothing else goes beside them, not even text.
On iMessage a poll goes only into a conversation the person has written in, or a group chat.
Read the votes
Votes reach you only if you ask for them. Open the stream with ?events=polls, or subscribe a webhook to the events by name:
poll.createdwhen a poll appears, yours or the person's, with the id of each choice.poll.votedandpoll.vote_clearedwhen someone votes or takes a vote back.poll.options_changedwith the whole new list when someone adds a choice. Replace the list you hold.
Vote in a poll
Vote in a poll names the poll at payload.pollExternalId and the choice at payload.optionExternalId, both from poll.created. A vote adds a choice; it never takes one back.
Errors you may see
Each of these comes back at once, and nothing is sent.
| Error | Means | Fix |
|---|---|---|
422 validation_failed | A question or choice is too long, or a choice is repeated | Shorten it, and list each choice once |
422 validation_failed, conversation_not_confirmed | The person has not written in this conversation yet | Send a text first |
404 unsupported_command, not_on_channel | The line's channel does not send polls | Send choices where the channel has them, or ask in a text |